【问题标题】:CardDAV with osX/iPhone clientsCardDAV 与 osX/iPhone 客户端
【发布时间】:2011-04-01 02:57:45
【问题描述】:

我正在为 crm 包实现 CardDAV 后端。

在与我的后端握手期间,会处理以下请求/响应:

PROPFIND /directory/ HTTP/1.1
Host: 10.0.0.202:9292
User-Agent: Address%20Book/883 CFNetwork/454.11.12 Darwin/10.7.0 (i386) (MacBookPro4%2C1)
Content-Type: text/xml; charset=utf-8
Depth: 0
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Content-Length: 147
Connection: keep-alive

<?xml version="1.0" encoding="utf-8"?>
<D:propfind xmlns:D="DAV:" xmlns:C="DAV:">
<D:prop>
<C:current-user-privilege-set/>
</D:prop>
</D:propfind>
HTTP/1.1 207
Content-Type: text/xml; charset="utf-8"
Content-Length: 432
Connection: keep-alive
Server: thin 1.2.11 codename Bat-Shit Crazy

<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>http://10.0.0.202:9292/directory/</D:href>
    <D:propstat>
      <D:prop>
        <D:current-user-privilege-set>
          <D:privilege>
            <D:read/>
          </D:privilege>
        </D:current-user-privilege-set>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>
PROPFIND /contacts/ HTTP/1.1
Host: 10.0.0.202:9292
User-Agent: Address%20Book/883 CFNetwork/454.11.12 Darwin/10.7.0 (i386) (MacBookPro4%2C1)
Content-Type: text/xml; charset=utf-8
Depth: 0
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Content-Length: 167
Connection: keep-alive

<?xml version="1.0" encoding="utf-8"?>
<D:propfind xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav">
<D:prop>
<C:addressbook-home-set/>
</D:prop>
</D:propfind>
HTTP/1.1 207
Content-Type: text/xml; charset="utf-8"
Content-Length: 408
Connection: keep-alive
Server: thin 1.2.11 codename Bat-Shit Crazy

<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>http://10.0.0.202:9292/contacts/</D:href>
    <D:propstat>
      <D:prop>
        <D:addressbook-home-set>
          <D:href>http://10.0.0.202:9292/contacts/</D:href>
        </D:addressbook-home-set>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>

尽管我的 CardDAV 后端从未暗示 /directory/ 是客户需要自己关心的任何事情。

客户端返回错误 The CardDAV server returned an error (207) for the user "richo",但是当我修补服务器以返回不同的状态代码 (200) 时,我得到了相同的错误,但使用了新的状态代码。

我正在努力预测其他事情正在对响应造成不安。我尝试返回绝对而不是相对 URL(反之亦然)无济于事。

任何意见表示赞赏。 mac 论坛here 上有一个类似的问题,似乎以解决方案结束,但链接已损坏。

【问题讨论】:

    标签: iphone macos webdav


    【解决方案1】:

    事实证明,这是一个命名空间问题。

    在适当的地方使用 urn:ietf:params:xml:ns:carddav 命名空间清除它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-10-05
      • 2011-06-29
      • 2010-09-26
      • 2011-03-27
      • 1970-01-01
      • 1970-01-01
      • 2011-05-15
      相关资源
      最近更新 更多