Hi Experts,
I am calling the store.flush to send to offline created data to the server. Creation is working in online mode.
Below is the code:
Open Store:
var properties = { "name": "OfflineStore", "host": applicationContext.registrationContext.serverHost, "port": applicationContext.registrationContext.serverPort, "https": applicationContext.registrationContext.https, "serviceRoot" : applicationContext.applicationEndpointURL+"/ZSERV_SRV", "streamParams" : "custom_header=Authorization:" + authStr + ";", "definingRequests" : { "CreateDR":"/CreateSet" // In the gateway service I have implemented Create_Entity, Get_Entity and Get_EntitySet methods }Create Record:
function createRecord(dataRec) { var oHeaders = {}; oHeaders['Authorization'] = authStr; oHeaders['x-csrf-token'] = csrftoken; oHeaders['Content-Type'] = "application/json; charset=utf-8"; var sUrl = applicationContext.applicationEndpointURL + "/ZSERV_SRV/Createset" console.log("create URL="+sUrl); var request = { headers: oHeaders, requestUri: sUrl, method: "POST", data: params }; OData.request(request, creationSuccess, createError);
}Flush Store:
function flushStore() { if (!store) { alert("The store must be open before it can be flushed"); return; } startTime = new Date(); store.flush(flushStoreSuccessCallback, errorCallback);
}flush call was successful, but when called /ErrorArchive I see below errors
[{"RequestID":"1","Message":"{\"error\":{\"code\":\"005056A509B11ED1B9BF9F46AA8E82ED\",\"message\":{\"lang\":\"en\",\"value\":\"In the context of Data Services an unknown internal server error occured\"},\"innererror\":{\"transactionid\":\"44BD65E52E90F15C80DB005056B104DC\",\"timestamp\":\"20150928084529.1490000\",\"Error_Resolution\":{\"SAP_Transaction\":\"Run transaction /IWFND/ERROR_LOG on SAP NW Gateway hub system and search for entries with the timestamp above for more details\",\"SAP_Note\":\"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)\"}}}}","Domain":"ODataDomain","CustomTag":null,"HTTPStatusCode":500,"InnerError":null,"RequestBody":"{}","__metadata":{"uri":"http://smp:port/com.company/ZSERV_SRV/ErrorArchive(RequestID=1L)","type":"OfflineOData.Error"},"RequestURL":"CreateSet","Code":null,"RequestMethod":"POST"}]
[Log] CreateSet (console-via-logger.js, line 173)
[Log] {"error":{"code":"005056A509B11ED1B9BF9F46AA8E82ED","message":{"lang":"en","value":"In the context of Data Services an unknown internal server error occured"},"innererror":{"transactionid":"44BD65E52E90F15C80DB005056B104DC","timestamp":"20150928084529.1490000","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP NW Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"}}}} (console-via-logger.js, line 173)acti
Error in Gateway Server:
Method 'IF_SXML_READER~GET_ATTRIBUTE_VALUE' cannot be called at this position in the XML stream.
Can anyone advise where could be wrong.
Regards,
Murthy