4.1 Synchronizing Tasks Between Client and Server
The following example demonstrates a client’s request to create a new task on the server, and the server’s response. In this example, the client sends a Sync command request ([MS-ASCMD] section 2.2.1.21) to the server that contains information for a task that was created on the client, and the server responds with a Sync command response ([MS-ASCMD] section 2.2.1.21).
Request:
-
<?xml version="1.0" encoding="utf-8"?> <Sync xmlns:tasks="Tasks:" xmlns:airsyncbase="AirSyncBase:" xmlns="AirSync:"> <Collections> <Collection> <SyncKey>301865454</SyncKey> <CollectionId>11</CollectionId> <DeletesAsMoves>1</DeletesAsMoves> <GetChanges>1</GetChanges> <WindowSize>100</WindowSize> <Commands> <Add> <ClientId>4717a10e-492d-45af-9fe3-227f74385b13</ClientId> <ApplicationData> <airsyncbase:Body> <airsyncbase:Type>2</airsyncbase:Type> <airsyncbase:Data><strong>Must</strong> complete TPS reports using the new cover sheet.</airsyncbase:Data> </airsyncbase:Body> <tasks:Subject>TPS Reports for August 2009</tasks:Subject> <tasks:Importance>2</tasks:Importance> <tasks:Categories> <tasks:Category>Business</tasks:Category> <tasks:Category>Reports</tasks:Category> </tasks:Categories> <tasks:Complete>0</tasks:Complete> <tasks:DueDate>2009-09-03T13:00:00.000Z</tasks:DueDate> <tasks:UtcDueDate>2009-09-03T20:00:00.000Z</tasks:UtcDueDate> <tasks:ReminderSet>1</tasks:ReminderSet> <tasks:ReminderTime>2009-09-02T09:00:00.000Z</tasks:ReminderTime> <tasks:Sensitivity>1</tasks:Sensitivity> <tasks:StartDate>2009-09-03T09:00:00.000Z</tasks:StartDate> <tasks:UtcStartDate>2009-09-03T16:00:00.000Z</tasks:UtcStartDate> </ApplicationData> </Add> </Commands> </Collection> </Collections> </Sync>
Response:
-
<?xml version="1.0" encoding="utf-8"?> <Sync xmlns="AirSync:"> <Collections> <Collection> <SyncKey>1010751843</SyncKey> <CollectionId>11</CollectionId> <Status>1</Status> <Responses> <Add> <ClientId>4717a10e-492d-45af-9fe3-227f74385b13</ClientId> <ServerId>11:1</ServerId> <Status>1</Status> </Add> </Responses> </Collection> </Collections> </Sync>