Hello Experts,
We are trying to post data for a device ID in MMS - configured as Bi-Directional. When we are try posting the data using the following format in Postman data gets posted and we can see the same in MMS cockpit table created for the Device.
------------------------------------------------------------------------------------------------
HTTP Code in Postman
--------------------------------
POST /com.sap.iotservices.mms/v1/api/http/data/33aa9e3c-271a-4144-ad3a-df6cf4d11f69 HTTP/1.1
Host: iotmmsi317978trial.hanatrial.ondemand.com
Content-Type: application/json
Authorization: Bearer 3ab50808a7c5854447877816cb357e5
Cache-Control: no-cache
Postman-Token: 0d522171-3284-b86d-f65a-fda2a9d2ece8
{"mode":"sync","messageType":"15a73afa660004ed2319","messages":[{"timestamp":1413191650,"message":"newapp21"}]}
----------------------------------------------------------------------------------------------------------
But the same doesn't happen when we try to do the posting from our UI5 Application. Following the spinet from UI5,
var odat = {"mode":"sync",
"messageType":"15a73afa660004ed2319",
"messages":[{"timestamp":1413191650,"message":"new_app11"}]};
var oModel = new sap.ui.model.odata.v2.ODataModel("/destinations/iotmms/com.sap.iotservices.mms/v1/api/http/app.svc");
oModel.setHeaders({"Authorization" : "Bearer 3ab50808a7c5854447877816cb357e5","Content-Type" : "application/json"});
oModel.create("/data/33aa9e3c-271a-4144-ad3a-df6cf4d11f69",odat);
Can you help us with the issue in the UI5 Code ?
Thanks & Regards,
Naresh