2011-04-01 83 views
0

我正在將一個CardDAV後端應用於crm包。使用osX/iPhone客戶端的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上有類似的問題,似乎以分辨率結束,但鏈接被破壞。

回答

0

事實證明,這是一個命名空間問題。

在適當情況下使用urn:ietf:params:xml:ns:carddav命名空間將其清除。