7. Guidelines for Web Services
Kony MobileFabric Sync Server Design Guidelines
Version 1.3
If the service is invoked and there are errors, MobileFabric Sync Server will handle the error
depending on the web services (SOAP, REST and JSON). MobileFabric Sync Server will also notify
the device. For example, in case of SOAP service, SOAP Fault is considered as an exception. For
REST and JSON services, errors will be handled based on the HTTP status codes.
For handling custom errors from the backend services, map one service output parameter with name
errmsg with XPath expression to the error message in response payload to catch the exact error.
If the web service is the DataSource and errors are reported in SOAP response instead of SOAP
Faults, then add the below param in the Synconfig file under each service output param to catch the
exact error. For example, to use salesforce web service, add as shown:
<Param Name="errmsg" Expression="//errors/message/text()"
Datatype="string"/>
Refer Developing Offline Apps on Kony Documentation Library for more information.
7.3 Batching Approach
You must use the GetUpdated and GetBatch operations to retrieve data in batches. If you do not have
the service already implemented for the batching purpose, then you can implement the service for
each SyncObject by following the algorithm as shown to fetch the batch-size number of rows from the
backend DataSource. After implementing the service, map the service with GetUpdated and
GetBatch operations. Kony MobileFabric Sync Server will invoke this service to get the incremental
changes in batches. Data will be sent to a device in batches to avoid memory and network issues
when there are more rows in initial sync and incremental sync.
Algorithm to fetch the batch-size number of rows from the backend DataSource
Algorithm <entity> GetUpdated(datetime, batchSize)
cursor ← Open a cursor on <entity> where lastUpdateTime > datetime
recordCount ← 0
prevLastUpdateTime ← 0
row ← cursor.firstrow()
while recordCount < batchSize or row.lastUpdateTime ==
© 2013 by Kony, Inc. All rights reserved 25 of 34