Export (0) Print
Expand All

4 Protocol Examples

This section provides a simplified example of a request-response sequence for the CreateItem operation, as specified in section 3.1.4.2.

The following example shows a CreateItem request to create a message, send it, and save a copy in the SentItems folder.

<?xml version="1.0" encoding="utf-8" ?>
<CreateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                  MessageDisposition="SendAndSaveCopy">
  <SavedItemFolderId xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
    <DistinguishedFolderId Id="sentitems" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" />
  </SavedItemFolderId>
  <Items xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
    <Message xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
      <ItemClass>IPM.Note</ItemClass>
      <Subject>Daily Report</Subject>
      <Body BodyType="Text">(1) Handled customer issues, (2) Saved the world.</Body>
      <Sender>
        <Mailbox>
          <EmailAddress>user1@example.com</EmailAddress>
        </Mailbox>
      </Sender>
      <ToRecipients>
        <Mailbox>
          <EmailAddress>user2@example.com</EmailAddress>
        </Mailbox>
      </ToRecipients>
    </Message>
  </Items>
</CreateItem>

The following example shows a CreateItem response to the request to create a message, send it, and save a copy in the SentItems folder.

<?xml version="1.0" encoding="utf-8" ?>
<CreateItemResponseType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ResponseMessages xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
    <CreateItemResponseMessage ResponseClass="Success">
      <ResponseCode>NoError</ResponseCode>
      <Items />
    </CreateItemResponseMessage>
  </ResponseMessages>
</CreateItemResponseType>
Show:
© 2014 Microsoft