SAP OData connector - Bad Request

2
Hello everyone, I am trying to connect SAP HANA with Mendix. Therefore, I added the SAP OData connector to my project. Reading, deleting and updating works, only adding a new record to my HANA table does not. The HTTPS response from HANA in Mendix using the SAP OData connector is as follows when trying to write a new record: Error Code: 400, Bad Request Message: { "error": { "code": "", "message": { "lang": "en-US", "value": "Property ID: The serialized resource has an invalid value in member 'ID'."}}} ID is of type bigint in my HANA table. I can reproduce this error message with cURL on my terminal when not enclosing fields of a number type with quotation marks. The following command renders the same error message that I get within Mendix: curl --user "$user:$pw" -X POST -H "Content-Type: application/json;odata.metadata=minimal" -H "Accept: application/json" -H "OData-Version: 2.0" -d '{ "ID": 9, "STR_COL": "6", "INT_COL": "6", }' 'https://myhanaserver.test/schema/sample-odata.xsodata/T_TABLE' Whereas the following is successful (value for ID is enclosed in quotation marks): curl --user "$user:$pw" -X POST -H "Content-Type: application/json;odata.metadata=minimal" -H "Accept: application/json" -H "OData-Version: 2.0" -d '{ "ID": "9", "STR_COL": "6", "INT_COL": "6", }' 'https://myhanaserver.test/schema/sample-odata.xsodata/T_TABLE' So it seems that the SAP OData connector builds a wrong HTTPS call? I am also confused that there is no problem when updating a value in Mendix using the SAP OData Connector. Does anyone have an idea of how to solve this? Thanks a lot in advance
asked
3 answers
1

Hi,

this might indeed be a bug in the OData connector module. Thus you should contact mendix support for this (the module has platform support).

As it could also be an issue with the SAP HANA OData service, there’s also the SAP support to contact there.

If you’re sufficiently fit in java you can probably also fix the odata module yourself. But I would only do that if it’s really urgent (and contact support anyway).

regards, Fabian

answered
1

Hello everyone,

the problem is resolved now. After contacting Mendix support they fixed the issue and released a new version of the SAP OData Connector.

answered
0

Hello Fabian,

thank you very much for the reply. I have contacted Mendix support now.

Until then I will probably just create my own POST request for creating new records.

Kind regards

answered