Exchange 的 WebDAV 查询

发布于 2024-07-22 21:17:10 字数 808 浏览 4 评论 0原文

我正在尝试读取 Exchange 服务器中的公共日历(在公共文件夹中)。 我将以下查询发送到我的 Exchange 服务器,服务器回复 400 - 错误请求。

<?xml version=""1.0""?>
<g:searchrequest xmlns:g=""DAV:"">
  <g:sql>
      SELECT
          ""urn:schemas:httpmail:subject"",
          ""urn:schemas:calendar:location"",
          ""urn:schemas:calendar:dtstart"",
          ""urn:schemas:calendar:dtend""
      FROM
          Scope('SHALLOW TRAVERSAL OF ""https://server/public/SomeFolder/SomeCalendar/""')
  </g:sql>
</g:searchrequest>

现在,相同的查询适用于此商店 URL: https://server/exchange/username/calendar/

所以我知道这是错误的网址在查询中。 如果我将有问题的 URL 粘贴到网络浏览器中,它将显示日历,因此该 URL 看起来确实不错。

任何帮助表示赞赏。

谢谢 泽维尔

I am trying to read a public calendar (in public folders) in my Exchange server.
I am sending the following query to my Exchange server, and the server replies with 400 - Bad Request.

<?xml version=""1.0""?>
<g:searchrequest xmlns:g=""DAV:"">
  <g:sql>
      SELECT
          ""urn:schemas:httpmail:subject"",
          ""urn:schemas:calendar:location"",
          ""urn:schemas:calendar:dtstart"",
          ""urn:schemas:calendar:dtend""
      FROM
          Scope('SHALLOW TRAVERSAL OF ""https://server/public/SomeFolder/SomeCalendar/""')
  </g:sql>
</g:searchrequest>

Now that same query works with this store URL:
https://server/exchange/username/calendar/

So I know that's the URL that is wrong in the query.
If I paste the problematic URL in my web browser, it will come up with the calendar, so the URL does seem fine though.

Any help appreciated.

Thanks
Xavier

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

棒棒糖 2024-07-29 21:17:10

感谢 SillyMonkey 的投入。

您的 URL 返回了相同的错误,但我发现问题出在我连接到提交查询的端点上。

我将查询发布到此 URI:

string uri = string.Format("{0}/exchange/{1}", server, credentials.UserName); 

现在将其更改为:

string uri = string.Format("{0}/public", server);

我有点惊讶的是,我必须使用不同的端点,具体取决于我是查询用户的邮箱还是公共文件夹,但它似乎就是这样。

Thanks SillyMonkey for your input.

Your URL returned the same error but I have found out the problem was with the endpoint I was connecting to to submit the query.

I was posting the query to this URI:

string uri = string.Format("{0}/exchange/{1}", server, credentials.UserName); 

and now changed it to:

string uri = string.Format("{0}/public", server);

I am a bit surprised that I have to use different endpoints depending whether I am querying the user's mailbox or the public folders, but it seems to be the way it is.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文