Creating a Contact

Before you can do anything of interest to a contact, your Mailbox must have a contact. Certainly you could create your contacts through client applications such as Office Outlook or Outlook Web Access, but it is much more fun to do this using Exchange Web Services.

Because a contact is simply an item with a personality, you can create one using the ever-familiar CreateItem call. The only change is that you pass in a Contact element rather than an item or message. Look at the request in Example 6-1.

Example 6-1. Creating a Contact

<CreateItem xmlns=".../messages"
            xmlns:t=".../types">
  <Items>
    <t:Contact>
      <t:GivenName>Jane</t:GivenName>
      <t:Surname>Dow</t:Surname>
    </t:Contact>
  </Items>
</CreateItem>

One thing to notice in Example 6-1 ...

Get Inside Microsoft® Exchange Server 2007 Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.