on 07-25-2016 12:53 PM
Hey,
I want to integrate an Offline Store in my Kapsel App. But when I start my App and call the method
store.open(openStoreSuccessCallback, openStoreErrorCallback);
I get the following error (console):
An error occurred: "Unknown network error occured[-10210] The operation failed due to an error on the server: ata/offline/resource/LocalizedMessage : cannot initialize class becau"
When I look into my server logfile I can see the following error message:
Hi David,
Can you share the code that you use to initialize the offline store and can you increase the log level on sap management cockpit and keeping the offline component to debug and then replicating the issue.
This will help in trouble shooting.
Thanks,
Rakshit Doshi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
function initOfflineStore() {
var properties = {
"name": "...",
"host": applicationContext.registrationContext.serverHost,
"port": applicationContext.registrationContext.serverPort,
"https": applicationContext.registrationContext.https,
"serviceRoot": appId
};
store = sap.OData.createOfflineStore(properties);
store.open(openStoreSuccessCallback, openStoreErrorCallback);
}
I use just this simple method.
Best regards,
David
Hi David,
Does your application connection use any authentication mechanism when u register the user on SMP
Try this set of code,
var authStr = "Basic " + btoa(username + ":" + password); //This is the username and password if you use any for authentication during registration
var properties = {
"name": "OfflineStore",
"host": "SMP HOST",
"port": SMP PORT, Do not add port in inverted commas
"https": false,
"serviceRoot": APPID, //This is the application id that you create on management cockpit
"streamParams": "custom_header=Authorization:" + authStr + ";custom_header=X-SMP-APPCID:" + appCID + ";",
"definingRequests": {
"Set1": "/EntitySet"
}
};
store = sap.OData.createOfflineStore(properties);
store.open(this.openStoreSuccessCallback, this.openStoreErrorCallback);
Test if this piece of code works.
Hope this helps
Thanks,
Rakshit Doshi.
Hey Rakshit,
I've tested your code in my app, but still getting the same error.
I also tested the demo app from the tutorial . When I try it with the example "OData Based App with the Kapsel Offline OData Plugin" I am still getting the same error.
Can you give my any further hints how to fix this issue?
Thank you very much and best regards,
David
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.