Skip to Content

SMP SDK 3.0 SP10 PL01 Offline

Hi Team,

I have a scenario were i have to retrieve data from multiple system.

I am able to create multiple "ONLINE" stores and retrieve data as well. But i am trying to retrieving the data in offline mode i am geting error like below

E/com.sap.smp.client.ios.odata.offline: [-10210] The operation failed due to an error on the server: The conversion from OData metadata to database metadata has failed

due to above error offline store in able to open like error below

com.innovapptive.ticdev.mworklist E/com.sap.smp.client.ios.odata.offline: [-10058] Cannot perform the requested operation because the store is not open.

Above is the error received in Android , below is received in IOS

com.sap.smp.client.ios.odata.offline ERROR [-10028] Error at URL position 1: "Tracks" is not an entity set in entity container "MWORKLIST_2_SRV_Entities

Below is the code i am using for opening offline store. here i am using different error listeners, store listener, encryptionKey and Store Name for different stores.

/**
* Open Offline Store
*
* @param context
* @return
* @throws offline odata Store Exception
*/
public boolean openOfflineStore(Context context) throws OfflineODataStoreException {

//BEGIN
writeLogsOfSMP();

if (offlineStorePTS == null) {

try {

offlineOpenListener = OfflineOpenListenerPTS.getInstance();

//This instantiate the native UDB libraries which are located in the libodataofflinejni.so file
ODataOfflineStore.globalInit();

//Get application endpoint URL
LogonCoreContext lgCtx = LogonCore.getInstance().getLogonContext();

String endPointURL = Utils.DOLPHIN_SERVER;

URL url = new URL(endPointURL);

// Define the offline store options.
// Connection parameter and credentials and
// the application connection id we got at the registration
ODataOfflineStoreOptions options = new ODataOfflineStoreOptions();

options.host = url.getHost();

options.port = String.valueOf(url.getPort());

options.enableHTTPS = lgCtx.isHttps();

options.serviceRoot = endPointURL;//SharedPreferencesHelper.getDefaults(SharedPreferencesHelper.PREFS_KEY_APP_CID, mContext);
options.storeEncryptionKey = "SuperSecretEncryptionkeyPTS";

//The logon configurator uses the information obtained in the registration
// (i.e endpoint URL, login, etc ) to configure the conversation manager
HttpConversationManager manager = new HttpConversationManager(context);

// configurator.configure(manager);
options.conversationManager = manager;

options.enableRepeatableRequests = false;

String appCID = SharedPreferencesHelper.getDefaults(SharedPreferencesHelper.PREFS_KEY_APP_CID, mContext);

options.storeName = "mWorklistStorePTS";//
options.customHeaders.put("X-SMP-APPCID", lgCtx.getConnId());

//This defines the oData collections which will be stored in the offline store
// options.addDefiningRequest("req1", PR_LIST_COLLECTION +"", false);
options.addDefiningRequest("req1", Tracks +"?$skip=0&$filter=MyApprovals eq true&$inlinecount=allpages", false); //
options.addDefiningRequest("req2", StatusSet, false);

// options.addDefiningRequest("req3", Tracks + "?$expand="+ InvoiceItems, false);
// options.addDefiningRequest("req4", Tracks + "?$expand=Attachments", false);
// options.addDefiningRequest("req5", Tracks + "?$expand=Approvers", false);
// options.addDefiningRequest("req6", Tracks + "?$expand="+ Notes, false);

//Open offline store
offlineStorePTS = new ODataOfflineStore(context);

offlineStorePTS.setRequestErrorListener(new MyODataOfflineStoreRequestErrorListener());

offlineStorePTS.setOfflineStoreListener(offlineOpenListener);

offlineStorePTS.openStoreSync(options);

// Log.i("OpenOfflineStore", "openOfflineStore: library version PTS = " + ODataOfflineStore.libraryVersion());
writeLogsOfSMP();

return true;

} catch (Exception e) {

writeLogsOfSMP();

throw new OfflineODataStoreException(e);

}

} else {

return true;

}

//END
}

when i traced out the flow what i got to understand is that when login to one system the base end point url is getting generated for the particular system and for others systems manually generating urls for other systems.

Once login with the one system data retrieved in online store and then at the same time metadata of that system is saved in device for offline store.

For other systems the in offline mode it is using the same base end point url is used for other systems as well.

Can anyone let know were is going wrong or i am doing wrong.

Can anyone help me out for this type of issue or if anyone faced this type of error before.

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Nov 17, 2015 at 09:56 AM

    Is this questions are same:

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2015 at 10:19 AM

    Hi

    @Claudia Pacheco

    @Stan Stadelman

    Please have a look and help us on this issue. We have also raised an OSS ticket on this with no update.

    Thanks

    Sudhakar Pachava

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.