EWS 2010 Assign task via SOAP

Hi all!

Need support with one little question I can't solve myself.

In our company we use Exchange 2010 Server, but, at first I want to say that I'm not Exchange specialist.

I want to create task in Exchange via EWS and SOAP and this simple part I have successfully done with next XML code:

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Header>
    <t:ExchangeImpersonation>
      <t:ConnectingSID>
        <t:PrimarySmtpAddress>user@mail.com</t:PrimarySmtpAddress>
      </t:ConnectingSID>
    </t:ExchangeImpersonation>
  </soap:Header>
  <soap:Body>
    <CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
      <Items>
        <Task xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
          <Subject>Test task with reminder before and after</Subject>
          <Body BodyType="Text">Please, check your task.</Body>
          <ReminderDueBy>2013-07-04T14:45:00.000</ReminderDueBy>
          <ReminderIsSet>true</ReminderIsSet>
          <ReminderMinutesBeforeStart>15</ReminderMinutesBeforeStart>
          <DueDate>2013-08-04T15:00:00</DueDate>
          <StartDate>2013-07-04T15:00:00</StartDate>
          <Status>NotStarted</Status>
        </Task>
      </Items>
    </CreateItem>
  </soap:Body>
</soap:Envelope>


But when I want to assign this task to other users, I try to use <DisplayTo> XML element:

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Header>
    <t:ExchangeImpersonation>
      <t:ConnectingSID>
        <t:PrimarySmtpAddress>user@mail.com</t:PrimarySmtpAddress>
      </t:ConnectingSID>
    </t:ExchangeImpersonation>
  </soap:Header>
  <soap:Body>
    <CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
      <Items>
        <Task xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
          <Subject>Test task with reminder before and after</Subject>
          <Body BodyType="Text">Please, check your task.</Body>
          <ReminderDueBy>2013-07-04T14:45:00.000</ReminderDueBy>
          <ReminderIsSet>true</ReminderIsSet>
          <ReminderMinutesBeforeStart>15</ReminderMinutesBeforeStart>
		<DisplayTo>user1@mail.com</DisplayTo>
          <DueDate>2013-08-04T15:00:00</DueDate>
          <StartDate>2013-07-04T15:00:00</StartDate>
          <Status>NotStarted</Status>
        </Task>
      </Items>
    </CreateItem>
  </soap:Body>
</soap:Envelope>


But, unfortunately, something goes wrong and I obtain next server response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <h:ServerVersionInfo MajorVersion="14" MinorVersion="3" MajorBuildNumber="123" MinorBuildNumber="3" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <m:CreateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
         <m:ResponseMessages>
            <m:CreateItemResponseMessage ResponseClass="Error">
               <m:MessageText>Set action is invalid for property.</m:MessageText>
               <m:ResponseCode>ErrorInvalidPropertySet</m:ResponseCode>
               <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
               <m:MessageXml>
                  <t:FieldURI FieldURI="item:DisplayTo"/>
               </m:MessageXml>
               <m:Items/>
            </m:CreateItemResponseMessage>
         </m:ResponseMessages>
      </m:CreateItemResponse>
   </s:Body>
</s:Envelope>

I will be very grateful if someone can help me with it, because I can use only SOAP requests for integrations with Exchange server and assign tasks to different users is the main goal :)

Thank you in advance.

July 8th, 2013 4:25am

Assigning Tasks isn't supported in EWS on any version of Exchange including 2013 (its also not supported in OWA). The only way or programmatically assigning a Task is to use MAPI via the OOM or a third party library like redemption.

You can still create the Task in the another users mailbox using EWS but you can't assign it.

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
July 9th, 2013 3:24am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics