示例/如何使用 Exchange 03 Webdav 和 PHP 创建日历约会?

发布于 2024-07-05 06:48:18 字数 138 浏览 10 评论 0原文

我已经尝试解决这个问题大约两周了。 我能够在人们的文件夹中创建电子邮件项目,阅读文件夹,所有这些东西,但在我的一生中,我无法让任何东西与日历一起使用。

我可以提供发送到 WebDav 的 XML 示例,但希望有人已经完成此操作并提供示例?

I've been trying to figure this out for about two weeks. I'm able to create email items in people's folders, read the folders, all that stuff but for the life of me I can not get anything to work with the calendars.

I can provide examples of the XML I'm sending to WebDav but hoping someone out there has done this and has an example?

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

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

发布评论

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

评论(2

海的爱人是光 2024-07-12 06:48:18

几年前,我在 Java 程序中做到了这一点,我的做法是将 VCALENDAR 文档放入该文件夹中。 一个怪癖是 VCALENDAR 必须包含在 RFC822 消息中。 它是 WebDAV、电子邮件和 iCAL/VCAL 的奇怪组合,但当时它可以在 Link2Exchange 托管的 Exchange 2003 上运行。

我确信有一种更简单的方法,但这对我有用。 下面我展示了所发生事件的 tcpdump 数据包跟踪。 您可能应该在自己的 Outlook/Entourage 客户端上使用 ngrep/tcpdump 来看看它的作用。

请注意,“Cal2”是我的测试日历文件夹的名称。 您可以使用“日历”作为主日历文件夹。

T 10.0.1.95:59741 -> 66.211.136.9:80 [AP]
PUT /exchange/yourname.domainname.com/Cal2/CC1.1163646061548.0.eml HTTP/1.1.
translate: f.
Content-Type: message/rfc822.
Pragma: no-cache.
Accept: */*.
Cache-Control: no-cache.
Authorization: Basic NOYOUCANTSEEMYPASSWORDYOUBASTARDS.
User-Agent: Jakarta Commons-HttpClient/2.0final.
Host: e1.exmx.net.
Cookie: sessionid=29486b50-d398-4f76-9604-8421950c7dcd:0x0.
Content-Length: 478.
Expect: 100-continue.
.


T 66.211.136.9:80 -> 10.0.1.95:59741 [AP]
HTTP/1.1 100 Continue.
.


T 10.0.1.95:59741 -> 66.211.136.9:80 [AP]
content-class: urn:content-classes:appointment.
Content-Type: text/calendar;.
.method=REQUEST;.
.charset="utf-8".
Content-Transfer-Encoding: 8bit.
.
BEGIN:VCALENDAR.
BEGIN:VEVENT.
UID:E1+1382+1014+495066799@I1+1382+1014+6+495066799.
SUMMARY:Voice Architecture Leads Meeting.
PRIORITY:5.
LOCATION:x44444 pc:6879.
DTSTART:20061122T193000Z.
DTEND:20061122T203000Z.
DTSTAMP:20061110T074856Z.
DESCRIPTION:this is a description.
SUMMARY:this is a summary.
END:VEVENT.
END:VCALENDAR.



T 66.211.136.9:80 -> 10.0.1.95:59741 [AP]
HTTP/1.1 201 Created.
Date: Thu, 16 Nov 2006 03:00:16 GMT.
Server: Microsoft-IIS/6.0.
X-Powered-By: ASP.NET.
MS-Exchange-Permanent-URL: http://e1.exmx.net/exchange/yourname.yourdomain.com/-FlatUrlSpace-/122cda661de1da48936f9
44bda4dde6e-3af8a8/122cda661de1da48936f944bda4dde6e-3f3383.
Location: http://e1.exmx.net/exchange/yourname.yourdomain.com/Cal2/CC1.1163646061548.0.eml.
Repl-UID: <rid:122cda661de1da48936f944bda4dde6e0000003f3383>.
Content-Type: text/html.
Content-Length: 110.
Allow: OPTIONS, TRACE, GET, HEAD, DELETE, PUT, COPY, MOVE, PROPFIND, PROPPATCH, SEARCH, SUBSCRIBE, UNSUBSCRIBE, PO
LL, BDELETE, BCOPY, BMOVE, BPROPPATCH, BPROPFIND, LOCK, UNLOCK.
ResourceTag: <rt:122cda661de1da48936f944bda4dde6e0000003f3383122cda661de1da48936f944bda4dde6e0000003f4671>.
GetETag: "122cda661de1da48936f944bda4dde6e0000003f4671".
MS-WebStorage: 6.5.7638.
Cache-Control: no-cache.

T 66.211.136.9:80 -> 10.0.1.95:59741 [AP]
<body><h1>/exchange/yourname.yourdomain.com/Cal2/CC1.1163646061548.0.eml was created successfully</h1></body>.

您可以使用 Cadaver 之类的工具通过 WebDAV 查询对象的属性来验证它是否有效,如下所示:

dav:/exchange/[email protected]/Cal2/> propget CC1.1163646061548.0.eml
  Fetching properties for `CC1.1163646061548.0.eml':
  textdescription = this is a description
  contentclass = urn:content-classes:appointment
  supportedlock = <lockentry><locktype><transaction><groupoperation></groupoperation></transaction></locktype><locks
  cope><local></local></lockscope></lockentry>
  permanenturl = http://e1.exmx.net/exchange/[email protected]/-FlatUrlSpace-/122cda661de1da48936f944bda4dde6e-
  3af8a8/122cda661de1da48936f944bda4dde6e-3f3383
  getcontenttype = message/rfc822
  id = AQEAAAAAOvioAQAAAAA/M4MAAAAA
  mid = -8992774761696198655
  uid = E1+1382+1014+495066799@I1+1382+1014+6+495066799
  isfolder = 0
  resourcetype = 
  method = PUBLISH
  getetag = "122cda661de1da48936f944bda4dde6e0000003f4671"
  lockdiscovery = 
  outlookmessageclass = IPM.Appointment
  creationdate = 2006-11-16T03:00:16.549Z
  outlookmessageclass = IPM.Appointment
  creationdate = 2006-11-16T03:00:16.549Z
  ntsecuritydescriptor = CAAEAAAAAAABAC+MMAAAAEwAAAAAAAAAFAAAAAIAHAABAAAAARAUAL8PHwABAQAAAAAABQcAAAABBQAAAAAABRUAAAC
  nkePD6LEa8iIT/+gqDAAAAQUAAAAAAAUVAAAAp5Hjw+ixGvIiE//oAQIAAA==
  dtstamp = 2006-11-10T07:48:56.000Z
  lastmodified = 2006-11-16T03:00:16.565Z
  dtstart = 2006-11-22T19:30:00.000Z
  location = x44444 pc:6879
  duration = 3600
  htmldescription = <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
  <HTML>
  <HEAD>

  <META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
  <TITLE>this is a summary</TITLE>
  </HEAD>
  <BODY>
  <!-- Converted from text/plain format -->

  <P><FONT SIZE=2>this is a description</FONT>
  </P>

  </BODY>
  </HTML>
  ishidden = 0
  parentname = http://e1.exmx.net/exchange/[email protected]/Cal2/
  meetingstatus = TENTATIVE
  subject = this is a summary
  getcontentlength = 631
  normalizedsubject = this is a summary
  isstructureddocument = 0
  repl-uid = rid:122cda661de1da48936f944bda4dde6e0000003f3383
  timezoneid = 0
  displayname = CC1.1163646061548.0.eml
  href = http://e1.exmx.net/exchange/[email protected]/Cal2/CC1.1163646061548.0.eml
  nomodifyexceptions = 1
  patternend = 2006-11-22T20:30:00.000Z
  isreadonly = 0
  instancetype = 0
  uid = AQEAAAAAPzODAAAAAAAAAAAAAAAA
  getlastmodified = 2006-11-16T03:00:16.565Z
  created = 2006-11-16T03:00:16.549Z
  sensitivity = 0
  dtend = 2006-11-22T20:30:00.000Z
  hasattachment = 0
  iscollection = 0
  read = 1
  resourcetag = rt:122cda661de1da48936f944bda4dde6e0000003f3383122cda661de1da48936f944bda4dde6e0000003f4671
  patternstart = 2006-11-22T19:30:00.000Z
  priority = 0
  sequence = 0

I did this in a Java program a few years back, and the way I did it was to PUT a VCALENDAR document into the folder. One quirk is that the VCALENDAR had to be enclosed within an RFC822 message. It's a bizarre combination of WebDAV, email, and iCAL/VCAL, but it worked at the time on Exchange 2003 hosted at Link2Exchange.

I'm sure there is an easier way, but this is what worked for me. Below I show a tcpdump packet trace of what happened. You should probably use ngrep/tcpdump on your own Outlook/Entourage client to see what it does.

Note that "Cal2" is the name of my test calendar folder. You'd use "Calendar" for the main calendar folder.

T 10.0.1.95:59741 -> 66.211.136.9:80 [AP]
PUT /exchange/yourname.domainname.com/Cal2/CC1.1163646061548.0.eml HTTP/1.1.
translate: f.
Content-Type: message/rfc822.
Pragma: no-cache.
Accept: */*.
Cache-Control: no-cache.
Authorization: Basic NOYOUCANTSEEMYPASSWORDYOUBASTARDS.
User-Agent: Jakarta Commons-HttpClient/2.0final.
Host: e1.exmx.net.
Cookie: sessionid=29486b50-d398-4f76-9604-8421950c7dcd:0x0.
Content-Length: 478.
Expect: 100-continue.
.


T 66.211.136.9:80 -> 10.0.1.95:59741 [AP]
HTTP/1.1 100 Continue.
.


T 10.0.1.95:59741 -> 66.211.136.9:80 [AP]
content-class: urn:content-classes:appointment.
Content-Type: text/calendar;.
.method=REQUEST;.
.charset="utf-8".
Content-Transfer-Encoding: 8bit.
.
BEGIN:VCALENDAR.
BEGIN:VEVENT.
UID:E1+1382+1014+495066799@I1+1382+1014+6+495066799.
SUMMARY:Voice Architecture Leads Meeting.
PRIORITY:5.
LOCATION:x44444 pc:6879.
DTSTART:20061122T193000Z.
DTEND:20061122T203000Z.
DTSTAMP:20061110T074856Z.
DESCRIPTION:this is a description.
SUMMARY:this is a summary.
END:VEVENT.
END:VCALENDAR.



T 66.211.136.9:80 -> 10.0.1.95:59741 [AP]
HTTP/1.1 201 Created.
Date: Thu, 16 Nov 2006 03:00:16 GMT.
Server: Microsoft-IIS/6.0.
X-Powered-By: ASP.NET.
MS-Exchange-Permanent-URL: http://e1.exmx.net/exchange/yourname.yourdomain.com/-FlatUrlSpace-/122cda661de1da48936f9
44bda4dde6e-3af8a8/122cda661de1da48936f944bda4dde6e-3f3383.
Location: http://e1.exmx.net/exchange/yourname.yourdomain.com/Cal2/CC1.1163646061548.0.eml.
Repl-UID: <rid:122cda661de1da48936f944bda4dde6e0000003f3383>.
Content-Type: text/html.
Content-Length: 110.
Allow: OPTIONS, TRACE, GET, HEAD, DELETE, PUT, COPY, MOVE, PROPFIND, PROPPATCH, SEARCH, SUBSCRIBE, UNSUBSCRIBE, PO
LL, BDELETE, BCOPY, BMOVE, BPROPPATCH, BPROPFIND, LOCK, UNLOCK.
ResourceTag: <rt:122cda661de1da48936f944bda4dde6e0000003f3383122cda661de1da48936f944bda4dde6e0000003f4671>.
GetETag: "122cda661de1da48936f944bda4dde6e0000003f4671".
MS-WebStorage: 6.5.7638.
Cache-Control: no-cache.

.

T 66.211.136.9:80 -> 10.0.1.95:59741 [AP]
<body><h1>/exchange/yourname.yourdomain.com/Cal2/CC1.1163646061548.0.eml was created successfully</h1></body>.

You can verify that it worked using something like Cadaver to query the object's properties via WebDAV like so:

dav:/exchange/[email protected]/Cal2/> propget CC1.1163646061548.0.eml
  Fetching properties for `CC1.1163646061548.0.eml':
  textdescription = this is a description
  contentclass = urn:content-classes:appointment
  supportedlock = <lockentry><locktype><transaction><groupoperation></groupoperation></transaction></locktype><locks
  cope><local></local></lockscope></lockentry>
  permanenturl = http://e1.exmx.net/exchange/[email protected]/-FlatUrlSpace-/122cda661de1da48936f944bda4dde6e-
  3af8a8/122cda661de1da48936f944bda4dde6e-3f3383
  getcontenttype = message/rfc822
  id = AQEAAAAAOvioAQAAAAA/M4MAAAAA
  mid = -8992774761696198655
  uid = E1+1382+1014+495066799@I1+1382+1014+6+495066799
  isfolder = 0
  resourcetype = 
  method = PUBLISH
  getetag = "122cda661de1da48936f944bda4dde6e0000003f4671"
  lockdiscovery = 
  outlookmessageclass = IPM.Appointment
  creationdate = 2006-11-16T03:00:16.549Z
  outlookmessageclass = IPM.Appointment
  creationdate = 2006-11-16T03:00:16.549Z
  ntsecuritydescriptor = CAAEAAAAAAABAC+MMAAAAEwAAAAAAAAAFAAAAAIAHAABAAAAARAUAL8PHwABAQAAAAAABQcAAAABBQAAAAAABRUAAAC
  nkePD6LEa8iIT/+gqDAAAAQUAAAAAAAUVAAAAp5Hjw+ixGvIiE//oAQIAAA==
  dtstamp = 2006-11-10T07:48:56.000Z
  lastmodified = 2006-11-16T03:00:16.565Z
  dtstart = 2006-11-22T19:30:00.000Z
  location = x44444 pc:6879
  duration = 3600
  htmldescription = <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
  <HTML>
  <HEAD>

  <META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
  <TITLE>this is a summary</TITLE>
  </HEAD>
  <BODY>
  <!-- Converted from text/plain format -->

  <P><FONT SIZE=2>this is a description</FONT>
  </P>

  </BODY>
  </HTML>
  ishidden = 0
  parentname = http://e1.exmx.net/exchange/[email protected]/Cal2/
  meetingstatus = TENTATIVE
  subject = this is a summary
  getcontentlength = 631
  normalizedsubject = this is a summary
  isstructureddocument = 0
  repl-uid = rid:122cda661de1da48936f944bda4dde6e0000003f3383
  timezoneid = 0
  displayname = CC1.1163646061548.0.eml
  href = http://e1.exmx.net/exchange/[email protected]/Cal2/CC1.1163646061548.0.eml
  nomodifyexceptions = 1
  patternend = 2006-11-22T20:30:00.000Z
  isreadonly = 0
  instancetype = 0
  uid = AQEAAAAAPzODAAAAAAAAAAAAAAAA
  getlastmodified = 2006-11-16T03:00:16.565Z
  created = 2006-11-16T03:00:16.549Z
  sensitivity = 0
  dtend = 2006-11-22T20:30:00.000Z
  hasattachment = 0
  iscollection = 0
  read = 1
  resourcetag = rt:122cda661de1da48936f944bda4dde6e0000003f3383122cda661de1da48936f944bda4dde6e0000003f4671
  patternstart = 2006-11-22T19:30:00.000Z
  priority = 0
  sequence = 0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文