ds3422222222 2010-07-05 08:44
浏览 197
已采纳

交换WebDAV 400错误请求:为什么?

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

  • 写回答

1条回答 默认 最新

  • dongtong0796 2010-07-05 08:54
    关注

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置