我正在构建一个caldav服务器。它已经与许多其他客户端合作,但不与IOS caldav客户端合作。服务器是用python实现的,它运行在Apache 2的顶层。
在阅读我的服务器日志文件时,我可以看到IOS客户端正在进行多个PROPFIND,OPTIONS,PROPPATCH和REPORT请求。 (我的服务器不支持PROPPATCH)。 IOS可以发现日历和日历在iPad日历应用程序中显示为日历列表。
问题是iPad日历没有显示任何事件或vtodos,我可以在日志中看到客户报告请求不包含任何" calendar-data"丙'第我不知道为什么客户不会在任何REPORT请求中询问日历数据?
(对不起格式错误。我做了大量工作来正确格式化内容,但格式化XML并且结果很不好)
这里有一些访问日志行:
62.44.192.148 - - [15 / Jan / 2018:10:56:09 +0200]" PROPFIND / juha / neo / HTTP / 1.1" 401 12" - " " iOS / 9.3.5(13G36)accountsd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:09 +0200]" PROPFIND / juha / neo / HTTP / 1.1" 207 486" - " " iOS / 9.3.5(13G36)accountsd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:09 +0200]" OPTIONS / juha / neo / HTTP / 1.1" 200 - " - " " iOS / 9.3.5(13G36)accountsd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:14 +0200]" PROPFIND / juha / neo / HTTP / 1.1" 401 12" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:14 +0200]" PROPFIND / juha / neo / HTTP / 1.1" 207 1570" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:14 +0200]" OPTIONS / juha / neo / HTTP / 1.1" 200 - " - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:14 +0200]" PROPFIND / juha / neo / HTTP / 1.1" 207 1996" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:15 +0200]" PROPPATCH / juha / neo / HTTP / 1.1" 405 244" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:15 +0200]" PROPFIND / juha / neo / HTTP / 1.1" 207 418" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:15 +0200]" REPORT / juha / neo / HTTP / 1.1" 207 5640" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:15 +0200]" REPORT / juha / neo / HTTP / 1.1" 207 2146" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:17 +0200]" PROPFIND / HTTP / 1.1" 401 12" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:17 +0200]" PROPFIND / HTTP / 1.1" 207 1570" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:17 +0200]" OPTIONS / HTTP / 1.1" 200 - " - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:17 +0200]" PROPFIND / juha / neo / HTTP / 1.1" 207 1996" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:17 +0200]" PROPPATCH / juha / neo / HTTP / 1.1" 405 244" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:17 +0200]" PROPFIND / juha / neo / HTTP / 1.1" 207 418" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:18 +0200]" REPORT / juha / neo / HTTP / 1.1" 207 5640" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:18 +0200]" REPORT / juha / neo / HTTP / 1.1" 207 2146" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:25 +0200]" PROPFIND /.well-known/caldav HTTP / 1.1" 401 12" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
62.44.192.148 - - [15 / Jan / 2018:10:56:25 +0200]" PROPFIND /.well-known/caldav HTTP / 1.1" 207 506" - " " iOS / 9.3.5(13G36)dataaccessd / 1.0"
以下是一些示例请求和响应:
PROPFIND
{'接受编码':' gzip,deflate','接受语言':' en-gb',&# 39;简要':''深度':' 0','首选':' return = minimal& #39;,'主持':' 192.168.1.202','内容长度':' 181','内容-Type':' text / xml',' Connection':' keep-alive',' User-Agent':&# 39; iOS / 9.3.5(13G36)accountd / 1.0','接受' / ','授权&#39 39;:'基本的anVoYTpqdWhh'}
<?xml version="1.0" encoding="UTF-8"?>
<A:propfind xmlns:A="DAV:">
<A:prop><A:current-user-principal/><A:principal-URL/>
<A:resourcetype/></A:prop></A:propfind>
回复标题:
{&#39; DAV&#39;:&#39; 1,日历访问,日程安排,日历查询&#39;,&#39;内容类型&#39;:&#39;应用程序/ XML;字符集= UTF-8&#39;}
<?xml version="1.0"?>\n<D:multistatus xmlns:D="DAV:">
<D:response><D:href>/juha/neo/</D:href><D:propstat>
<D:status>HTTP/1.1 200 OK</D:status><D:prop><D:resourcetype><D:collection />
<D:calendar xmlns:D="urn:ietf:params:xml:ns:caldav"/></D:resourcetype>
<D:current-user-principal><D:href>/juha/neo/</D:href>
</D:current-user-principal>
</D:prop></D:propstat>
</D:response></D:multistatus>
选项
{&#39;内容长度&#39;:&#39; 0&#39;,&#39;接受编码&#39;:&#39; gzip,deflate&#39;,&#39;接受语言&#39;:&#39; en-gb&#39;,&#39;连接&#39;:&#39;保持活力&#39;,&#39;主机&#39;:&#39; ; 192.168.1.202&#39;,&#39;接受&#39; / &#39;,&#39;用户代理&#39;:&#39; iOS / 9.3.5(13G36)accountd / 1.0&#39;,&#39;授权&#39;:&#39;基本anVoYTpqdWhh&#39;}
回复标题:
{&#39;内容长度&#39;:&#39; 0&#39;,&#39; DAV&#39;:&#39; DAV:1,日历访问,日程安排,日历-query&#39;,&#39; Content-Type&#39;:&#39; application / xml; charset = UTF-8&#39;,&#39;允许&#39;:&#39; OPTIONS,PROPFIND,REPORT,PUT,GET,DELETE&#39;}
PROPFIND {&#39;接受编码&#39;:&#39; gzip,deflate&#39;,&#39;接受语言&#39;:&#39; en-gb&#39;,&#39;简要& #39;:&#39;&#39;,&#39;深度&#39;&#39; 0&#39;,&#39;首选&#39;:&#39; return = minimal&#39; ,&#39;主持&#39;:&#39; 192.168.1.202&#39;,&#39;内容长度&#39;:&#39; 743&#39;,&#39;内容类型&# 39;:&#39; text / xml&#39;,&#39; Connection&#39;:&#39; keep-alive&#39;,&#39; User-Agent&#39;:&#39; iOS /9.3.5(13G36)dataaccessd / 1.0&#39;,&#39;接受&#39; / &#39;,&#39;授权&#39;: &#39;基本的anVoYTpqdWhh&#39;}
request body:<?xml version="1.0" encoding="UTF-8"?>
<A:propfind xmlns:A="DAV:">\n <A:prop>
<B:calendar-home-set xmlns:B="urn:ietf:params:xml:ns:caldav"/>
<B:calendar-user-address-set xmlns:B="urn:ietf:params:xml:ns:caldav"/>
<A:current-user-principal/><A:displayname/>
<C:dropbox-home-URL xmlns:C="http://calendarserver.org/ns/"/>
<C:email-address-set xmlns:C="http://calendarserver.org/ns/"/>
<C:notification-URL xmlns:C="http://calendarserver.org/ns/"/>
<A:principal-collection-set/><A:principal-URL/><A:resource-id/>
<B:schedule-inbox-URL xmlns:B="urn:ietf:params:xml:ns:caldav"/>
<B:schedule-outbox-URL xmlns:B="urn:ietf:params:xml:ns:caldav"/>
<A:supported-report-set/></A:prop></A:propfind>
回复标题:{&#39; DAV&#39;:&#39; 1,日历访问,日历安排,日历查询&#39;,&#39;内容类型&#39;:&# 39;应用/ XML;字符集= UTF-8&#39;}
<?xml version="1.0"?>
<D:multistatus xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV:" xmlns:ID="urn:inverse:params:xml:ns:inverse-dav">
<D:response><D:href>/juha/neo/</D:href>
<D:propstat><D:status>HTTP/1.1 200 OK</D:status><D:prop>
<D:supported-report-set xmlns:ID="urn:inverse:params:xml:ns:inverse-dav">
<D:supported-report><D:report><C:calendar-multiget/></D:report>
</D:supported-report><D:supported-report><D:report>
<C:calendar-query/></D:report></D:supported-report>
<D:supported-report><D:report><ID:acl-query/>
</D:report></D:supported-report>
<D:supported-report><D:report>
<D:sync-collection/></D:report>
</D:supported-report><D:supported-report>
<D:report>
<C:expand-property/>
</D:report>
</D:supported-report>
</D:supported-report-set>
<D:displayname>Juha Martikainen Neo</D:displayname>
<D:current-user-principal>
<D:href>/juha/neo/</D:href>
</D:current-user-principal>
<C:calendar-home-set>
<D:href>http://192.168.1.202/juha/neo/</D:href>
</C:calendar-home-set>
<C:calendar-user-address-set>
<D:href>mailto:juham@anygraaf.fi</D:href>
</C:calendar-user-address-set>
</D:prop></D:propstat>
</D:response>\n</D:multistatus>
报告
{&#39;接受编码&#39;:&#39; gzip,deflate&#39;,&#39;接受语言&#39;:&#39; en-gb&#39;,&# 39;简要&#39;:&#39;&#39;深度&#39;:&#39; 1&#39;,&#39;首选&#39;:&#39; return = minimal& #39;,&#39;主持人&#39;:&#39; 192.168.1.202&#39;, &#39;内容长度&#39;:&#39; 390&#39;,&#39;内容类型&#39;:&#39; text / xml&#39;,&#39;连接&#39; :&#39; keep-alive&#39;,&#39; User-Agent&#39; iOS / 9.3.5(13G36)dataaccessd / 1.0&#39;,&#39;接受&#39;接受#39 ;:&#39; / &#39;,&#39;授权&#39;:&#39;基本anVoYTpqdWhh&#39;}
请求正文:
<?xml version="1.0" encoding="UTF-8"?>
<B:calendar-query xmlns:B="urn:ietf:params:xml:ns:caldav">
<A:prop xmlns:A="DAV:"><A:getcontenttype/><A:getetag/>
</A:prop><B:filter>
<B:comp-filter name="VCALENDAR"><B:comp-filter name="VEVENT">
<B:time-range start="20171015T000000Z"/></B:comp-filter></B:comp-filter>
</B:filter></B:calendar-query>
响应:
<?xml version="1.0"?><D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>/juha/neo/c3c15486-03c9-4bf4-a91c-fc406ba605a5.ics</D:href>
<D:propstat><D:prop>
<D:getetag>"d41d8cd98f00b204e9800998ecf8427e"</D:getetag>
<D:getcontenttype>text/calendar;component=vevent
</D:getcontenttype>
<D:status>HTTP/1.1 207 OK</D:status></D:prop></D:propstat>
</D:response><D:response>
<D:href>/juha/neo/16d76c9e-e783-476b-83a3-b3de4c4d4cf9.ics</D:href>
<D:propstat><D:prop>
<D:getetag>"d41d8cd98f00b204e9800998ecf8427e"</D:getetag>
<D:getcontenttype>text/calendar;component=vevent
</D:getcontenttype>
<D:status>HTTP/1.1 207 OK</D:status>
</D:prop></D:propstat></D:response>
<D:response>
<D:href>/juha/neo/64a9fed6-72ae-417d-98f7-b981ae501bbd.ics</D:href>
<D:propstat><D:prop><D:getetag>"d41d8cd98f00b204e9800998ecf8427e"
</D:getetag>
<D:getcontenttype>text/calendar;component=vevent</D:getcontenttype>
<D:status>HTTP/1.1 207 OK</D:status></D:prop>
</D:propstat></D:response><D:response>
<D:href>/juha/neo/7177d736-230e-4639-9df8-d18333bf0428.ics</D:href>
<D:propstat><D:prop><D:getetag>"d41d8cd98f00b204e9800998ecf8427e"
</D:getetag>
<D:getcontenttype>text/calendar;component=vevent</D:getcontenttype>
<D:status>HTTP/1.1 207 OK</D:status></D:prop></D:propstat></D:response>
<D:response><D:href>/juha/neo/1c010891-3822-4c6a...
报告
{&#39;接受编码&#39;:&#39; gzip,deflate&#39;,&#39;接受语言&#39;:&#39; en-gb&#39;,&# 39;简要&#39;:&#39;&#39;深度&#39;:&#39; 1&#39;,&#39;首选&#39;:&#39; return = minimal& #39;,&#39;主持&#39;:&#39; 192.168.1.202&#39;,&#39;内容长度&#39;:&#39; 318&#39;,&#39;内容-Type&#39;:&#39; text / xml&#39;,&#39; Connection&#39;:&#39; keep-alive&#39;,&#39; User-Agent&#39;:&# 39; iOS / 9.3.5(13G36)dataaccessd / 1.0&#39;,&#39;接受&#39; <#39; / &#39;,&#39;授权&# 39;:&#39;基本的anVoYTpqdWhh&#39;}
请求正文:
<?xml version="1.0" encoding="UTF-8"?>
<B:calendar-query xmlns:B="urn:ietf:params:xml:ns:caldav">
<A:prop xmlns:A="DAV:">
<A:getetag/><A:getcontenttype/>
</A:prop>
<B:filter>
<B:comp-filter name="VCALENDAR">
<B:comp-filter name="VTODO"/>
</B:comp-filter>
</B:filter>
</B:calendar-query>
响应:
<?xml version="1.0"?><D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>/juha/neo/juha.martikainen@anygraaf.fi/neo/4n57t1gead4d.ics</D:href>
<D:propstat><D:prop>
<D:getetag>"d41d8cd98f00b204e9800998ecf8427e"</D:getetag>
<D:getcontenttype>text/calendar;component=vtodo</D:getcontenttype>
<D:status>HTTP/1.1 207 OK</D:status></D:prop></D:propstat></D:response>
<D:response><D:href>/juha/neo/jma-8crr2yyya203728.ics</D:href><D:propstat>
<D:prop><D:getetag>"d41d8cd98f00b204e9800998ecf8427e"</D:getetag>
<D:getcontenttype>text/calendar;component=vtodo</D:getcontenttype>
<D:status>HTTP/1.1 207 OK</D:status></D:prop></D:propstat>
</D:response>
<D:response>
<D:href>/juha/neo/155ca994-856f-430d-9e1f-f3861b33b533.ics</D:href>
<D:propstat><D:prop>
<D:getetag>"d41d8cd98f00b204e9800998ecf8427e"</D:getetag>
<D:getcontenttype>text/calendar;component=vtodo</D:getcontenttype>
<D:status>HTTP/1.1 207 OK</D:status></D:prop></D:propstat>
</D:response><D:response>
<D:href>/juha/neo/cab0d5b4-1d24-4a3f-a796-098387c4f82d.ics</D:href>
<D:propstat><D:prop>
<D:getetag>"d41d8cd98f00b204e9800998ecf8427e"</D:getetag>
<D:getcontenttype>text/calendar;component=vtodo</D:getcontenttype>
<D:status>HTTP/1.1 207 OK</D:status></D:prop></D:propstat>\n
</D:response>\n<D:response>
<D:href>/juha/neo/e37d9662-231c-46c9-add5-beac50...
答案 0 :(得分:1)
首先,您尚未发布报告请求的响应标头,以了解完整的响应。 其次,在报告响应正文中,您必须将状态指定为“Http / 1.1 200 OK”,而不是207. 207必须在响应标头中指定。