Exchange WebDAV 400 错误请求:为什么?

发布于 2024-09-08 08:31:36 字数 1419 浏览 0 评论 0原文

我一直在 PHP 中直接使用 XML 使用 WebDAV。我已成功创建带有附件等的电子邮件,但当我尝试创建联系人时,我不断收到“400 错误请求”。这是 webdav 查询以及我如何执行它:

 <?xml version="1.0"?>
    <g:propertyupdate 
    xmlns:g="DAV:" 
    xmlns:c="urn:schemas:contacts:" 
    xmlns:e="http://schemas.microsoft.com/exchange/" 
    xmlns:mapi="http://schemas.microsoft.com/mapi/" 
    xmlns:x="xml:" 
    xmlns:cal="urn:schemas:calendar:" 
    xmlns:mail="urn:schemas:httpmail:">
    <g:set>
    <g:prop>
    <g:contentclass>urn:content-classes:person</g:contentclass>
    <e:outlookmessageclass>IPM.Contact</e:outlookmessageclass>
    <c:givenName>JoLynn</c:givenName>
    <c:middlename>Julie</c:middlename>
    </g:prop>
    </g:set>
    </g:propertyupdate>

和响应:

HTTP/1.1 400 Bad Request
Connection: close
Date: Mon, 05 Jul 2010 08:41:43 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
Content-Type: text/html
Content-Length: 1709
MS-WebStorage: 6.5.7638

并发送数据: $h->fetch($url, 0, null, $exchange_username, $exchange_password, "PROPPATCH")

非常感谢任何帮助! -

我从 Troy Wolf 的示例代码开始,位于 http:// www.troywolf.com/articles/php/exchange_webdav_examples.php

I have been using WebDAV in PHP directly using XML. I have managed to create emails with attachments and so forth, but when i try to create a contact, I keep getting "400 Bad Request". Here is the webdav query and how i'm executing it:

 <?xml version="1.0"?>
    <g:propertyupdate 
    xmlns:g="DAV:" 
    xmlns:c="urn:schemas:contacts:" 
    xmlns:e="http://schemas.microsoft.com/exchange/" 
    xmlns:mapi="http://schemas.microsoft.com/mapi/" 
    xmlns:x="xml:" 
    xmlns:cal="urn:schemas:calendar:" 
    xmlns:mail="urn:schemas:httpmail:">
    <g:set>
    <g:prop>
    <g:contentclass>urn:content-classes:person</g:contentclass>
    <e:outlookmessageclass>IPM.Contact</e:outlookmessageclass>
    <c:givenName>JoLynn</c:givenName>
    <c:middlename>Julie</c:middlename>
    </g:prop>
    </g:set>
    </g:propertyupdate>

And response:

HTTP/1.1 400 Bad Request
Connection: close
Date: Mon, 05 Jul 2010 08:41:43 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
Content-Type: text/html
Content-Length: 1709
MS-WebStorage: 6.5.7638

And sending the data: $h->fetch($url, 0, null, $exchange_username, $exchange_password, "PROPPATCH")

Any help greatly appreciated!¬

I started with Troy Wolf's example code at http://www.troywolf.com/articles/php/exchange_webdav_examples.php

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

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

发布评论

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

评论(1

分开我的手 2024-09-15 08:31:36

啊,我修复了它,忘记随请求发送一些标头(准确地说是内容类型、深度和翻译标头!)

Ah i fixed it, forgot to send some headers with the request (content-type, depth and translate headers to be precise!)

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