none
Active Sync delete/change command for contacts RRS feed

  • Question

  • Hi,

    I am trying to write Active Sync client for exchange server. I am able to add contacts to server with help of sync command but facing issue in change/delete. I am sending delete command for 2:3 but i am getting same item in add command from server. Also item is not deleted from server. For change I am getting similarly status as 8. Below is request and response  xml for delete command:

    Request:

      <?xml version="1.0" encoding="utf-8" ?>
    - <Sync xmlns:contacts="Contacts" xmlns="AirSync">
    - <Collections>
    - <Collection>
      <SyncKey>1895711361</SyncKey>
      <CollectionId>2</CollectionId>
      <DeletesAsMoves>0</DeletesAsMoves>
      <GetChanges>1</GetChanges>
      <WindowSize>512</WindowSize>
    - <Commands>
    - <Delete>
      <ServerId>2:3</ServerId>
      </Delete>
      </Commands>
      </Collection>
      </Collections>
      </Sync>

    Response:

     
    - <Sync xmlns:airsyncbase="AirSyncBase" xmlns:contacts="Contacts" xmlns:contacts2="Contacts2" xmlns="AirSync">
    - <Collections>
    - <Collection>
      <SyncKey>1823493022</SyncKey>
      <CollectionId>2</CollectionId>
      <Status>1</Status>
    - <Commands>
    - <Add>
      <ServerId>2:1</ServerId>
    - <ApplicationData>
    - <airsyncbase:Body>
      <airsyncbase:Type>1</airsyncbase:Type>
      <airsyncbase:EstimatedDataSize>0</airsyncbase:EstimatedDataSize>
      <airsyncbase:Truncated>1</airsyncbase:Truncated>
      </airsyncbase:Body>
      <contacts:FileAs>Jaiswal, Dhruv</contacts:FileAs>
      <contacts:FirstName>Dhruv</contacts:FirstName>
      <contacts:LastName>Jaiswal</contacts:LastName>
      <airsyncbase:NativeBodyType>1</airsyncbase:NativeBodyType>
      </ApplicationData>
      </Add>
    - <Add>
      <ServerId>2:2</ServerId>
    - <ApplicationData>
    - <airsyncbase:Body>
      <airsyncbase:Type>1</airsyncbase:Type>
      <airsyncbase:EstimatedDataSize>0</airsyncbase:EstimatedDataSize>
      <airsyncbase:Truncated>1</airsyncbase:Truncated>
      </airsyncbase:Body>
      <contacts:Department>Mobility</contacts:Department>
      <contacts:FileAs>Yadav, Pankaj Kumar</contacts:FileAs>
      <contacts:FirstName>Pankaj</contacts:FirstName>
      <contacts:MiddleName>Kumar</contacts:MiddleName>
      <contacts:CompanyName>Dell</contacts:CompanyName>
      <contacts:AssistantName>n/a</contacts:AssistantName>
      <contacts:LastName>Yadav</contacts:LastName>
      <contacts:JobTitle>S/W Dev Advisor</contacts:JobTitle>
      <contacts:OfficeLocation>Dell sec 125</contacts:OfficeLocation>
      <contacts2:ManagerName>Kamal</contacts2:ManagerName>
      <airsyncbase:NativeBodyType>1</airsyncbase:NativeBodyType>
      </ApplicationData>
      </Add>
    - <Add>
      <ServerId>2:3</ServerId>
    - <ApplicationData>
    - <airsyncbase:Body>
      <airsyncbase:Type>1</airsyncbase:Type>
      <airsyncbase:EstimatedDataSize>0</airsyncbase:EstimatedDataSize>
      <airsyncbase:Truncated>1</airsyncbase:Truncated>
      </airsyncbase:Body>
      <contacts:FileAs>lastname, pankajtest1</contacts:FileAs>
      <contacts:FirstName>pankajtest1</contacts:FirstName>
      <contacts:HomeAddressCountry>India</contacts:HomeAddressCountry>
      <contacts:HomeAddressStreet>dell</contacts:HomeAddressStreet>
      <contacts:CompanyName>dell</contacts:CompanyName>
      <contacts:OtherAddressCity>noida</contacts:OtherAddressCity>
      <contacts:OtherAddressCountry>India</contacts:OtherAddressCountry>
      <contacts:OtherAddressStreet>123</contacts:OtherAddressStreet>
      <contacts:LastName>lastname</contacts:LastName>
      <contacts:BusinessPhoneNumber>98615272327</contacts:BusinessPhoneNumber>
      <contacts:JobTitle>s/w</contacts:JobTitle>
      <contacts:OfficeLocation>dell</contacts:OfficeLocation>
      <airsyncbase:NativeBodyType>1</airsyncbase:NativeBodyType>
      </ApplicationData>
      </Add>
      </Commands>
      </Collection>
      </Collections>
      </Sync>

    Please tell me what I am doing wrong here.

    regards,

    pankaj

    Monday, June 9, 2014 8:49 AM

All replies