Integration Server 10.5 | Developing Data Synchronization Solutions with webMethods Mobile Support | Built-In Services | wm.mobile.datasync:synchronize
 
wm.mobile.datasync:synchronize
Synchronizes data between a mobile device and a backend application.
This service is used for the following purposes:
*On the client side, a mobile application invokes this service by way of the Mobile Support Client library to send data to, and receive data from, the backend application through Mobile Support.
*On the server side, the business integration developer invokes this service within a notification service. The notification service alerts Mobile Support that the backend application has updated the backend data directly, outside of Mobile Support, and the synchronize service synchronizes the sync store with the changes the backend application made.
Mobile Support determines whether a synchronization request comes from a mobile device or from a backend notification service based on the set of parameters provided in the synchronization request message. When the request header contains a mobile application name and a mobile application version, this indicates that the request is from a mobile device. If this information is not present, Mobile Support identifies the request as coming from a notification service.
Input Parameters
inputParams
Document Parameters that specify the metadata that Mobile Support uses to track change requests.
Key
Description
mscAlias
String Alias used to identify the mobile sync component associated with this request. The alias name is specified during creation of the mobile sync component.
This parameter is required when the synchronize service is invoked either from the Mobile Support Client library or from a backend notification service.
lastVersion
String Optional. Last version of the data processed in a synchronization request associated with the specified mobile sync component.
Note:
If a mobile application is submitting a synchronization request on behalf of a mobile device for the first time, lastVersion will be blank. This indicates to Mobile Support to treat the request the same as a download request.
This parameter is not required when the synchronize service is invoked from a backend notification service.
filter
Document Optional. List of key/value parameters, if passed by the mobile application, that specify the subset of records to download to the mobile device.
*If more than one filter key is passed, Mobile Support returns only those records that match all of the specified filter keys.
*If a filter key contains more than one value, Mobile Support returns records that match any of the values.
Mobile Support uses this parameter internally to pass the filter from the Mobile Support Client to the server.
This parameter is not used when the synchronize service is invoked from a backend notification service.
inputPayload
Document List Data to be synchronized.
Key
Description
mDataRow
Object The record to be synchronized, in IData format.
If the mobile sync component associated with this request is configured to not store business data in the sync store, the data in this variable will be passed to Mobile Support but not stored in the sync store.
If you are calling the synchronize service from a notification service that processes delete requests, include, at a minimum, the fields defined as row identifiers. For insert and update requests, include all fields specified in the business document type.
uid
String Optional. A unique identifier for the record. Mobile Support constructs the unique ID using the row identifiers supplied when the corresponding mobile sync component was created.
Mobile Support returns the unique ID as part of the synchronize service’s output signature for each record processed. For subsequent update and delete requests for a particular record, be sure to use the most recent unique ID that the server returned for that record.
This parameter is not required when the synchronize service is invoked from a backend notification service.
actionId
String Action to be taken on a particular record. A value of:
*0 indicates to insert the record.
*1 indicates to delete the record.
*2 indicates to update the record.
Output Parameters
outputParams
Document Status of the request.
Key
Description
currentVersion
String Conditional. Current version of the data associated with the specified mobile sync component.
Mobile Support does not return a value for this parameter when the synchronize service is called from a backend notification service.
statusCode
String Indicator that depicts the status of the request. A value of:
*30 indicates that an error occurred because the association between the mobile application version and the mobile sync component is not valid, or the associated mobile sync component is suspended or disabled, or Mobile Support was unable to derive the unique ID from the record.
*31 indicates that the mobile application either passed filter keys that did not match those defined in the mobile sync component or did not pass the expected number of filter keys.
*40 indicates that Mobile Support processed the synchronization request successfully.
*50 indicates that Mobile Support encountered an internal error while processing the synchronization request.
Mobile Support returns a status code for each request that reaches Mobile Support. Mobile Support may not be able to return a status code if the synchronize service cannot be invoked, for example if Integration Server is down or is being restarted.
outputPayload
Document List Data to be sent back to the application.
Key
Description
mDataRow
Object A single record returned by Mobile Support, in IData format.
For delete requests, this object will be empty.
uid
String A unique identifier for the record. Mobile Support constructs the unique ID using the row identifiers supplied when the corresponding mobile sync component was created.
actionId
String Action taken on a particular record. A value of:
*0 indicates the record was inserted.
*1 indicates the record was deleted. For delete requests, the mDataRow object will be empty.
*2 indicates the record was updated.
rowStatus
String Status of the record transaction. A value of:
*0 indicates that Mobile Support was successful in processing the requested action.
*1 indicates that Mobile Support failed to process the request.
*2 indicates that Mobile Support detected a conflict and resolved the conflict according to the conflict resolution rule in effect. Mobile Support sends the resolved data back to the application.
*3 indicates that no operation was performed because Mobile Support detected a conflict between the sync store and the backend data and did not have enough information to process the request further. The synchronization request must be resubmitted.
Usage Notes
*Mobile Support does not consider the execution of the synchronize service to be unsuccessful if the corresponding adapter service fails. Therefore, handle any adapter service exception situations within the calling flow service.
*Mobile Support uses the IS document type you created in Step 1: Write the Server-Side Business Logic to define the structure and contents of the mDataRow variable.