ExtendedProperty EWS SOAP

HugoHiasl
HugoHiasl used Ask the Experts™
on
Hi,

I try to create an CalendarItem with a SOAP request. This SOAP request should add a custom Property which is containing an ID from my database and I want to be able to retrieve an propably existing Item by this ID.

Without the <ExtendedProperty> part of the following request, anything works fine. With it the requesyt returns that ExtendedProperty is an invalid child of CalendarItem.

Could please anyone tell me the problem here? I would also appreciate a snippet how to search for the Items by this ID later.

My request is:

<?xml version='1.0'?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Header>
         <t:RequestServerVersion Version="Exchange2007" />
      </soap:Header>
      <soap:Body>
      <m:CreateItem SendMeetingInvitations="SendOnlyToAll" >
      <m:Items>
            <t:CalendarItem>
                  <t:Subject>Testmeeting</t:Subject>
                  <t:Start>2009-12-01T12:00:00-08:00</t:Start>
                  <t:End>2009-12-02T14:00:00-07:00</t:End>
                  <t:Location>Testroom</t:Location>
                  <t:ExtendedProperty>
                          <t:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="TrainingEventId" PropertyType="String"/>
                        <t:Value>123456</t:Value>
                  </t:ExtendedProperty>
                  <t:RequiredAttendees>
                        <t:Attendee>
                              <t:Mailbox>
                                    <t:Name>Test Testheimer</t:Name>
                                    <t:EmailAddress>test.test@test.com</t:EmailAddress>
                              </t:Mailbox>
                        </t:Attendee>
                  </t:RequiredAttendees>
            </t:CalendarItem>
      </m:Items>
</m:CreateItem>
</soap:Body>
</soap:Envelope>

Thanks a lot in advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Try moving the ExtendedProperty between Subject and Start .  EWS likes these things in the order defined in the schema when creating items.

Author

Commented:
That's it...

Thanks a lot... Where can I find the right order for the items? I thought it is xml and order-independent...

Author

Commented:
Perfect.
It's not dependent when you update them, but (strangely) it is when you create them.  The schemas are on MSDN:

http://msdn.microsoft.com/en-us/library/aa564765.aspx

and in your

C:\Program Files\Microsoft\Exchange Server\ClientAccess\exchweb\ews\types.xsd

file.  When you look at the .xsd file, though, you have to remember to check what it's inheriting from its base item type - the version on MSDN is easier to follow.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial