Previous Page Arrow Next Page Arrow

5.3 Updating Synchronization Target

The synchronization engine will then POST the synchronization feed to the target endpoint:

POST /sdata/myApp2/myContract/-/accounts/$syncTarget?trackingId=B2419115-DD2E-4d5a-9E8E-90E012AFE89C&runName=Full%20CRM%20to%20ERP&runStamp=2009-10-14T08:51:02 HTTP/1.1
Content-Type: application/atom+xml; type=feed

<!-- Synchronization feed obtained from the source -->

The target application will process this request like an asynchronous batch request (<httpMethod> elements give the method to apply to each entry). The <digest> and <syncState> elements will allow the target application to detect and handle conflicts (see Conflict Resolution section later).

Like any asynchronous SData operation, the POST request will return a 202 Accepted response until the batch has been processed:

202 Accepted
<?xml version="1.0" encoding="utf-8"?>
<tracking xmlns="">
  <phaseDetail>Starting batch</phaseDetail>

The engine will perform a GET on the Location URL ($syncTarget(‘B2419115-DD2E-4d5a-9E8E-90E012AFE89C’)) until it gets a 200 HTTP status. At this time the target has finished processing the entries of the feed and the engine will get a response like:

200 OK
Content-type: application/atom+xml; type=feed

<feed xmlns:sdata="" 
  <title>Synchronization Feed</title>
    <title>Account Natural Goods</title>
    <link rel="self" type="application/atom+xml; type=entry" title="Refresh" 
          href="'28004')" />
    <content>Natural Goods Ltd.</content>


    <!-- payload for created account -->

    <title>Account Chemical Bros</title>
    <link rel="self" type="application/atom+xml; type=entry" title="Refresh"
          href="'27483')" />
    <content>Chemical Bros</content>


    <!-- payload for updated account -->
  <!-- more entries -->

The engine will then delete the batch context:

DELETE /sdata/myApp2/myContract/-/accounts/$syncTarget('B2419115-DD2E-4d5a-9E8E-90E012AFE89C') HTTP/1.1

The target service will respond to this DELETE request with:

200 OK

A provider exposing a $syncTarget URL for resource kind MUST support asynchronous calls as well as the sequential paging mechanism for retrieving the operation results.

The invoker of a POST operation on the $syncTarget URL of a result SHOULD invoke a DELETE operation for every POST operation performed.

Previous Page Arrow Next Page Arrow