Microsoft 开发人员网络 > 论坛主页 > Using the Exchange Server Protocols > Creating exception to recurring appointment [WebDAV]
提出问题提出问题
 

已答复Creating exception to recurring appointment [WebDAV]

  • 2009年6月11日 9:23bravedreamer 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Hi there

    I'm not sure if this is the best place to ask such questions but I try. I have somehow a strange problem with WebDAV and Exchange server 2007. I try to create an exception to a recurring appointment (the start date of an instance of a recurring appointment was shifted) but it isn't displayed correctly. I read some thread on the net and some people say that my problem is not doable with WebDAV and other say that IS doable. Now I'm asking the specialists. :)

    Detailed explanation:
    I'm writing a small application in Java that should create all kind of appointments on an Exchange 2007 server and on an Exchange 2003 server. I have no problem to create 'normal' appointments. And also recurring appointments without exception I can create easily. The problem rises when I have to create an exception (for example the room changed for one single instance) to the recurring appointment. I can't manage that the exception is recognized as an instance of the recurring appointment.
    For example, the following request is send to the server in order to create the exception:

    PROPPATCH /Exchange/USERALIAS/calendar/1244708752847-4.eml HTTP/1.0
    Repl-UID: e80f0e4183b1fa478c43b44d7765418b000000692a71
    Host: MYHOST
    Content-Type: text/xml; charset="UTF-8"
    Content-Length: 1286
    Authorization: Basic d2JlaWtpcmNoZXI6bGFzaXJpMTY=
    
    <?xml version="1.0" encoding="UTF-8" ?>
    <D:propertyupdate xmlns:D="DAV:"
     xmlns:EX="http://schemas.microsoft.com/exchange/" xmlns:HM="urn:schemas:calendar:"
     xmlns:MAPI="http://schemas.microsoft.com/mapi/" xmlns:X="xml:"
     xmlns:HN="urn:schemas:httpmail:" xmlns:dt="urn:uuid:c2f41010-65b3-11d1a29f-00aa00c14882/">
     <D:set>
      <D:prop>
       <D:contentclass>urn:content-classes:appointment
       </D:contentclass>
       <EX:outlookmessageclass>IPM.Appointment
       </EX:outlookmessageclass>
       <MAPI:apptstateflags dt:dt="int">0
       </MAPI:apptstateflags>
       <HN:subject>blabla</HN:subject>
       <HM:location>ablabla</HM:location>
       <HM:dtstart>2009-06-23T10:00:00.000Z
       </HM:dtstart>
       <HM:dtend>2009-06-23T11:00:00.000Z</HM:dtend>
       <HM:alldayevent>0</HM:alldayevent>
       <HM:busystatus>Busy</HM:busystatus>
       <HN:importance>1</HN:importance>
       <HM:reminderoffset>0</HM:reminderoffset>
       <MAPI:reminderset>0</MAPI:reminderset>
       <MAPI:sensitivity>0</MAPI:sensitivity>
       <HM:sequence>1</HM:sequence>
       <HM:instancetype dt:dt="int">3</HM:instancetype>
       <HM:recurrenceid>2009-06-23T07:00:00.000Z</HM:recurrenceid>
       <HM:method>REQUEST</HM:method>
       <HM:uid>
        CD0000008B9511D182D800C04FB1625D7047012ABF1DD64B8742267AFDF8241F
       </HM:uid>
       <HM:timezoneid>0</HM:timezoneid>
      </D:prop>
     </D:set>
    </D:propertyupdate>
    

    As you can see, I set the following properties:
    - repl-uid
    - uid
    - recurrenceid
    - instance type
    - the number at the end of the href to signal that this instance should be attached

    So what is wrong with this request? Do I forgot some property to set?


答案

  • 2009年8月4日 20:27Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复

    bravedreamer,

     

    I have completed the investigation into your question and have some information that you may find valuable. In regards to exceptions, they are stored as attachments to the original recurring meeting. You can also create an exception by modifying some non-date/time properties, for example:

     

     

    PROPPATCH /exchange/baracko/Calendar/{75C6CD24-6F6E-4F99-8189-EF0C086E6CDE}-3.EML HTTP/1.1

    Content-type: text/xml

     

    <?xml version="1.0"?>

    <a:propertyupdate xmlns:a="DAV:"

                      xmlns:e="urn:schemas:mailheader:"

                      xmlns:d="urn:schemas:calendar:">

       <a:set>

          <a:prop>

             <e:subject>Longer, Later Daily test at noon</e:subject>

           </>

       </>

    </>

     

    Also, removing a recurring instance also works:

     

    DELETE /exchange/baracko/Calendar/{75C6CD24-6F6E-4F99-8189-EF0C086E6CDE}-4.EML HTTP/1.1

     

    Date and Time Properties can also be changed as well:

     

    PROPPATCH /exchange/baracko/Calendar/{75C6CD24-6F6E-4F99-8189-EF0C086E6CDE}-3.EML HTTP/1.1

    Content-type: text/xml

     

    <?xml version="1.0"?>

    <a:propertyupdate xmlns:a="DAV:"

                      xmlns:e="urn:schemas:mailheader:"

                      xmlns:d="urn:schemas:calendar:"

                      xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/">

       <a:set>

          <a:prop>

             <d:dtstart b:dt="dateTime.tz">2009-07-28T20:00:00.000Z</d:dtstart>

             <d:dtend b:dt="dateTime.tz">2009-07-28T21:00:00.000Z</d:dtend>

             <d:duration b:dt="int">3600</d:duration>

             <e:subject>Longer, Later Daily test at noon</e:subject>

           </>

       </>

    </>

     

    * I also noticed that one of your issues is that you are not placing the types in for many of the properties. *

     

    For example:

     

    <HM:dtstart>2009-06-23T10:00:00.000Z</HM:dtstart>

     

    Should be:

                                                      

    <d:dtstart b:dt="dateTime.tz">2009-07-28T20:00:00.000Z</d:dtstart>

     

    If you do not see the types correctly set, the call will fail as what you are experiencing.

     

    Dominic Salemno

    Senior Support Escalation Engineer

  • 2009年8月25日 23:44Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复
    bravedreamer,

    The following is an example of creating an appointment via WebDAV:

    PROPPATCH /exchange/administrator/calendar/meeting.eml HTTP/1.1

    Content-type: text/xml

    Translate: f

    <?xml version="1.0"?>

    <a:propertyupdate

    xmlns:a="DAV:"

    xmlns:c="urn:schemas:calendar:"

    xmlns:dt="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"

    xmlns:e="urn:schemas:httpmail:"

    xmlns:f="http://schemas.microsoft.com/exchange/"

    xmlns:j="urn:schemas:mailheader:" >

    <a:set>

    <a:prop>

    <e:textdescription>The body text</e:textdescription>

    <a:contentclass>urn:content-classes:appointment</a:contentclass>

    <f:outlookmessageclass>IPM.Appointment</f:outlookmessageclass>

    <c:busystatus>BUSY</c:busystatus>

    <c:dtstart dt:dt="dateTime.tz">2009-08-24T15:00:00.000Z</c:dtstart>

    <c:location>here</c:location>

    <j:subject>Simple meeting</j:subject>

    <c:duration dt:dt="int">1800</c:duration>

    <c:dtend dt:dt="dateTime.tz">2009-08-24T15:30:00.000Z</c:dtend>

    </>

    </>

    </>

    Dominic Salemno
    Senior Support Escalation Engineer

全部回复

  • 2009年6月11日 15:13Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    bravedreamer,

    I am the engineer who has taken ownership of this issue. I am investigating this and will update you as things progress.

    Dominic Salemno
    Senior Support Escalation Engineer
  • 2009年6月11日 15:15bravedreamer 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Thanks a lot.
  • 2009年6月16日 7:08bravedreamer 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Any new information?

    Maybe you could provide me with some running code. Preferable in Java.
  • 2009年6月16日 14:46Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    bravedreamer,

    I am still investigating this issue. Unfortunately, we do not support Java as it is a non-Microsoft product.
    I will keep you up-to-date as things progress.

    Dominic Salemno
    Senior Support Escalation Engineer
  • 2009年6月16日 15:10bravedreamer 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Theoretically there should be no difference between Java and for example C#. As far as I get the WebDAV request string. ;)
  • 2009年6月16日 15:50Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    bravedreamer,

    Which publically published document underneath Open Specifications are you referencing?

    Open Specifications: http://msdn.microsoft.com/en-us/library/cc203350.aspx

    Dominic Salemno
    Senior Support Escalation Engineer


  • 2009年6月17日 6:06bravedreamer 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    I'm not sure what do you mean.

    For working with calendar items (all sort of) I'm using the specification in document MS-XWDCAL (http://msdn.microsoft.com/en-us/library/dd299448.aspx). Unfortunately, I didn't find any information about how to create exceptions in a recurring appointment. Therefore I tried it by myself (just setting some properties, you know). The thing I observed is that the first time, the creation of an exception to a recurring appointment works. But if I try the same code a second time, it doesn't work anymore.

    That brings me to the conclusion that I'm doing a little thing wrong. Maybe I forgot just to set some property. I don't know.
  • 2009年6月22日 14:02Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    bravedreamer,

    I am still investigating this issue and will provide you with more information as things progress.

    Dominic Salemno
    Senior Support Escalation Engineer
  • 2009年6月22日 14:37bravedreamer 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Okay, thanks. I'm sorry, but I didn't know that it takes that long. Unfortunately, this is a crucial part of my application and I would need it.

    I'm wondering a little that nobody asked you about this issue so far.
  • 2009年7月9日 16:15Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     

    bravedreamer,

    I am still investigating this issue and should have an answer for you shortly.

    Dominic Salemno
    Senior Support Escalation Engineer

  • 2009年8月4日 20:27Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复

    bravedreamer,

     

    I have completed the investigation into your question and have some information that you may find valuable. In regards to exceptions, they are stored as attachments to the original recurring meeting. You can also create an exception by modifying some non-date/time properties, for example:

     

     

    PROPPATCH /exchange/baracko/Calendar/{75C6CD24-6F6E-4F99-8189-EF0C086E6CDE}-3.EML HTTP/1.1

    Content-type: text/xml

     

    <?xml version="1.0"?>

    <a:propertyupdate xmlns:a="DAV:"

                      xmlns:e="urn:schemas:mailheader:"

                      xmlns:d="urn:schemas:calendar:">

       <a:set>

          <a:prop>

             <e:subject>Longer, Later Daily test at noon</e:subject>

           </>

       </>

    </>

     

    Also, removing a recurring instance also works:

     

    DELETE /exchange/baracko/Calendar/{75C6CD24-6F6E-4F99-8189-EF0C086E6CDE}-4.EML HTTP/1.1

     

    Date and Time Properties can also be changed as well:

     

    PROPPATCH /exchange/baracko/Calendar/{75C6CD24-6F6E-4F99-8189-EF0C086E6CDE}-3.EML HTTP/1.1

    Content-type: text/xml

     

    <?xml version="1.0"?>

    <a:propertyupdate xmlns:a="DAV:"

                      xmlns:e="urn:schemas:mailheader:"

                      xmlns:d="urn:schemas:calendar:"

                      xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/">

       <a:set>

          <a:prop>

             <d:dtstart b:dt="dateTime.tz">2009-07-28T20:00:00.000Z</d:dtstart>

             <d:dtend b:dt="dateTime.tz">2009-07-28T21:00:00.000Z</d:dtend>

             <d:duration b:dt="int">3600</d:duration>

             <e:subject>Longer, Later Daily test at noon</e:subject>

           </>

       </>

    </>

     

    * I also noticed that one of your issues is that you are not placing the types in for many of the properties. *

     

    For example:

     

    <HM:dtstart>2009-06-23T10:00:00.000Z</HM:dtstart>

     

    Should be:

                                                      

    <d:dtstart b:dt="dateTime.tz">2009-07-28T20:00:00.000Z</d:dtstart>

     

    If you do not see the types correctly set, the call will fail as what you are experiencing.

     

    Dominic Salemno

    Senior Support Escalation Engineer

  • 2009年8月5日 8:04bravedreamer 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Okay. Thanks Mr. Salemno for your effort.

    Let me just summarize what you have said. Only to see if I've understood it well. ;)

    You say that in order to create an exception to a recurring appointment, I have to change only some non-date/time properties on the MASTER appointment? Is that correct?

    All that stuff of changing/deleting an exception afterwards (after having created it) is correct. This is very easy and could already do it. My problem is only the creation. I will try that (changing something in the master appointment) but sincerely, I'm not convinced that it would create an exception.


    As I have seen in your examples above, you are patching already an instance (PROPPATCH /exchange/baracko/Calendar/{75C6CD24-6F6E-4F99-8189-EF0C086E6CDE}-3.EML HTTP/1.1 ) of the appointment. I tried it by myself (adding the next free number to the end of resource description (in your case the "3")) but it does not work in all cases. For example if you have already some exceptions created with some other application (e.g. the web interface for Exchange) and try to add afterwards another excpetion through WebDAV, the thing with the number wouldn't work. Anyway, I will try to test it on my machine.

    For the thing with the data types you are absolutely right. I will change that too and hopefully see some positiv outcomings. :)
  • 2009年8月5日 18:28Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    bravedreamer,

    I am investigating the creation of exceptions, I shall follow-up with you as things progress.

    Dominic Salemno
    Senior Support Escalation Engineer
  • 2009年8月6日 17:13Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    bravedreamer,

    If you review [MS-OXOCAL] ("Appointment and Meeting Object Protocol Specification" : http://msdn.microsoft.com/en-us/library/cc425490.aspx) Section 1.3.1.1.1, you will notice what is defined by term Exception.

    From the documentation:

    An exception represents a modified instance of a recurring event. This could be as simple as extra
    data in the body, or it could be more complicated, such as a change in date/time or location. An
    exception is defined by an Exception Attachment object and an
    Exception Embedded Message
    object.


    You must modify an existing instance of a recurring event to create an exception.

    Does this information assist you?

    Dominic Salemno
    Senior Support Escalation Engineer
  • 2009年8月7日 13:04bravedreamer 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     包含代码
    Hi Dominic

    I didn't know about this special document. I got the definition of an exception from some posts in divers forums. But as far as I see, this definition is the same as the one in your document. We are speaking about the same. ;)

    Sorry, but unfortunately I'm not getting your point. How do I get an existing instance of a recurring event? Suppose you have a recurring appointment that recurrs every 2 week with no end date. And suppose we have no exception in this recursion. When I perform now a request to the server and try to get the appointment, the server will return me the master appointment. So, I get no information about a specific instance.

    Let me clarify again my point (maybe we didn't understood well): I have no problem to delete or modify an instance of a recurring appointment. As long as I have a valid URL or UID, I can get any instance I want. The problem for me is now the creation of such an instance because there I don't have any URL or UID. If I would program for example through the .NET framework then this would be no problem because I have already the infrastruction (all the data structures) to handle the attachments (you said already that exceptions are stored as attachments to the master appointment). Therefore, I would simply add a new attachment. But in Java, I have to handle such requests through the WebDAV protocol and I have seen that attachments to recurring appointments are simply marked through an additional number at the end of the URL. Please correct me, if that is not correct. Following example:

    If I would use the URL given in this request the server would return me the basic appointment (master appointment)
    PROPPATCH /exchange/baracko/Calendar/{75C6CD24-6F6E-4F99-8189-EF0C086E6CDE}.EML HTTP/1.1
    But if I would use this URL in the request, the server would return a specific instance (if it exists):
    PROPPATCH /exchange/baracko/Calendar/{75C6CD24-6F6E-4F99-8189-EF0C086E6CDE}-3.EML HTTP/1.1

    My specific problem is now to create such a number at the end of the URL. If you have a hint for me, please let me know it.

    If I missed your point, please could you provide me with an example where you create first a recurring appointment, afterward create an exception to it and last but not least change, for example the room number the master appointment created in the first step.

    Thank you very much.



  • 2009年8月17日 13:56Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    bravedreamer,

    I am still investigating this issue and will update you as things progress.

    Dominic Salemno
    Senior Support Escalation Engineer
  • 2009年8月21日 15:21Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    bravedreamer,

    I am still investigating this matter.

    Dominic Salemno
    Senior Support Escalation Engineer
  • 2009年8月21日 18:03bravedreamer 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Okay, fine. I hope not to bother you too much. ;)

    If you have any question or if you need a more detailed example/explanation, feel free to contact me.

    Thanks very much for your assist.
  • 2009年8月25日 23:44Dominic Salemno MSFTMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复
    bravedreamer,

    The following is an example of creating an appointment via WebDAV:

    PROPPATCH /exchange/administrator/calendar/meeting.eml HTTP/1.1

    Content-type: text/xml

    Translate: f

    <?xml version="1.0"?>

    <a:propertyupdate

    xmlns:a="DAV:"

    xmlns:c="urn:schemas:calendar:"

    xmlns:dt="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"

    xmlns:e="urn:schemas:httpmail:"

    xmlns:f="http://schemas.microsoft.com/exchange/"

    xmlns:j="urn:schemas:mailheader:" >

    <a:set>

    <a:prop>

    <e:textdescription>The body text</e:textdescription>

    <a:contentclass>urn:content-classes:appointment</a:contentclass>

    <f:outlookmessageclass>IPM.Appointment</f:outlookmessageclass>

    <c:busystatus>BUSY</c:busystatus>

    <c:dtstart dt:dt="dateTime.tz">2009-08-24T15:00:00.000Z</c:dtstart>

    <c:location>here</c:location>

    <j:subject>Simple meeting</j:subject>

    <c:duration dt:dt="int">1800</c:duration>

    <c:dtend dt:dt="dateTime.tz">2009-08-24T15:30:00.000Z</c:dtend>

    </>

    </>

    </>

    Dominic Salemno
    Senior Support Escalation Engineer