SMP offline ini file for more than one connection names
Hello SMP Developers, Administrators
I would like to share my experience on current requirement for my project. There was already one OData native application available on SMP (with offline functionality).
Previous requirement: one offline application (with its ini file imported in Admin cockpit) connecting to one back-end URL. Things were fine.
New requirement: For next release of this mobile app, there should be a new backend URL but old one should also be there in the same app configration. It sounded like accessing more than one OData services in one application
So where was the problem?
You might have noticed that to make your app to work in offline mode, you have to import its .ini file that has information like how OData producer should be processed by mobile platform and store the offline data, offline DB pre-population, client index, defining requests and so on.
Our first impression was, if there are 2 back-end URLs, there would be 2 .ini files to be imported. But when we try to import second file (one ini file was already there containing info regarding first back-end url) , status of first ini file changes to ‘No Custom Settings‘
Then, we realized and concluded that information from both files should be combined into a single one and that the one should be imported. Now for both connection names’ status is showing ‘Configured‘
Tips:
1. Sequence in.ini file should be:
[endpoint] <<could be either backend connection name>>
[defining request]
[defining request]
.
.
.
.
[endpoint]
[defining request]
[defining request]
.
.
.
2. name=com.test.test
name=com.secondary.endpoint
should be the same names as connection names for backend URLs (already explained here)
3. Before importing the new .ini file, make sure you have back-up file for old ini.
4. To retrieving data from 1st back-end URL,
- On-board user on SMP
- GET call: http(s)://smp:port/com.test.test
5. To retrieving data from 2nd back-end URL,
- On-board user on SMP
- GET call: http(s)://smp:port/com.secondary.endpoint
Regards,
Jitendra
Really helpful.
Great blog JK.
I am using three application endpoints, so I've three sections in my INI file. One thing I've noticed is that explicitly specifying the [track_deltas] setting for each [defining_request] is better as SMP automatically tracks delta changes for all the defining requests if not specified, leading to increased load on the server. Also, new parameters are being added with every server release which allows for greater control over the offline components on the SMP 3.0 server, such as delta_request_format=json if your backend OData producer supports this feature which was added in SP10.
Regards
Aditya