4 Protocol Examples

The following example demonstrates a client request to synchronize contact data with the server, and the server response. In this example, the server returns a single new contact, represented by elements of the Contact class that are child elements of the airsync:ApplicationData element ([MS-ASCMD] section 2.2.3.11) under an airsync:Add element ([MS-ASCMD] section 2.2.3.7.2) in the server response.

Note   For the sake of brevity, the value of the Picture element in the server response, which is a representation of the image encoded with base64 encoding, has been truncated.

Request:

 <?xml version="1.0" encoding="utf-8"?>
 <Sync xmlns="AirSync">
   <Collections>
     <Collection>
       <SyncKey>2006814013</SyncKey>
       <CollectionId>2</CollectionId>
       <DeletesAsMoves/>
       <GetChanges/>
     </Collection>
   </Collections>
 </Sync>

Response:

 <?xml version="1.0" encoding="utf-8"?>
 <Sync xmlns="AirSync" xmlns:A="AirSyncBase" xmlns:B="POOMCONTACTS">
   <Collections>
     <Collection>
       <SyncKey>243360144</SyncKey>
       <CollectionId>2</CollectionId>
       <Status>1</Status>
       <Commands>
         <Add>
           <ServerId>2:1</ServerId>
           <ApplicationData>
             <A:Body>
               <A:Type>3</A:Type>
               <A:EstimatedDataSize>5500</A:EstimatedDataSize>
               <A:Truncated>1</A:Truncated>
             </A:Body>
             <B:WebPage>http://www.contoso.com/</B:WebPage>
             <B:BusinessAddressCountry>United States of America</B:BusinessAddressCountry>
             <B:Email1Address>"Anat Kerry (anat@contoso.com)" &lt;anat@contoso.com&gt;</B:Email1Address>
             <B:BusinessFaxNumber>(206) 555-0100</B:BusinessFaxNumber>
             <B:FileAs>Kerry, Anat</B:FileAs>
             <B:FirstName>Anat</B:FirstName>
             <B:HomePhoneNumber>(206) 555-0101</B:HomePhoneNumber>
             <B:BusinessAddressCity>Redmond</B:BusinessAddressCity>
             <B:MiddleName>M.</B:MiddleName>
             <B:MobilePhoneNumber>(206) 555-0102</B:MobilePhoneNumber>
             <B:CompanyName>Contoso, Ltd.</B:CompanyName>
             <B:BusinessAddressPostalCode>10021</B:BusinessAddressPostalCode>
             <B:LastName>Kerry</B:LastName>
             <B:BusinessAddressState>WA</B:BusinessAddressState>
             <B:BusinessAddressStreet>234 Main St.</B:BusinessAddressStreet>
             <B:BusinessPhoneNumber>(206) 555-0103</B:BusinessPhoneNumber>
             <B:JobTitle>Development Manager</B:JobTitle>
             <B:Picture>/9j/4AAQSkZJRgABAQEAYABgAAD/...</B:Picture>
             <A:NativeBodyType>3</A:NativeBodyType>
           </ApplicationData>
         </Add>
       </Commands>
     </Collection>
   </Collections>
 </Sync>
Show: