Hi all,
I succesfully managed update and get operation with OData but i'm facing an error when i try to create a new item in my entity set
First of all, my server side setup.
Obviously I've implemented the CREATE_ENTITY method with dummy code just to check if it's triggered
METHOD materialsset_create_entity. er_entity-matnr = 'TResult'. ENDMETHOD.
In my page I call the Odata in this way
var itemString = "/MaterialsSet/";
var serviceURI = "/sap/opu/odata/sap/ZMATERIALS_SRV";
var username = "User";
var password = "Password";
var oModel = new sap.ui.model.odata.v2.ODataModel(serviceURI, {
user: username,
password: password});
var oEntity = {
"Code": "CodeTest",
"MaterialType": "ROH",
"Description": "Test",
"StandardPrice": 0,
"Currency": "EUR"
};oModel.create(itemString, oEntity, null, function () {
sap.ui.commons.MessageBox.alert("Success!") ;
}, function () {
sap.ui.commons.MessageBox.alert("Error!");
});
When the page hit my code, the metadata is retrieved succesfully but when i try to create the new entry (this is obviously a test code) i got a 202 as response for the batch
- Request URL:https://zzzzz:vvvvv@10.1.1.1/sap/opu/odata/sap/ZMATERIALS_SRV/$batch
- Request Method:POST
- Status Code:202 Accepted
Content-Type: application/http
Content-Length: 341
content-transfer-encoding: binary
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Content-Length: 225
dataserviceversion: 1.0
{"error":{"code":"CX_SXML_PARSE_ERROR/001560AA0E081DEB8CA398CC1690D406","message":{"lang":"it","value":"Error while parsing an XML stream"},"innererror":{"transactionid":"578CF552A51F7AADE10000000A63040C","errordetails":[]}}}
any idea on how to solve?