Loading

SAP ODATA request fails with HTTP Response code 400 Bad Request

Date de publication: Jun 17, 2025
Description

You may receive HTTP Response 400 Bad request while making SAP OData request.

Sample Log)

2025-06-13T01:57:06.429Z DEBUG [q6cb9] SAP_Request event:f5151860-47f7-11f0-a156-567dfb88e816 [MuleRuntime].uber.07: [test-ei-test-app].test-Flow.CPU_LITE @3ca38e3d - REQUESTER
POST /sap/opu/odata/sap/TEST_SAP_TEST/Example
accept: application/json
x-csrf-token: g9n...
x-requested-with: X
x-anypnt-app-worker: 449CD...
x-correlation-id: f5151860-47f7-11f0-a156-567dfb88e816
Cookie: MYSAPSSO2=AjQxMDIBABgAQw... sap-usercontext=sap-client=700; SAP_SESSIONID_GWQ_700=pUK...
Host: sapxxx.xxx.com:8443
User-Agent: AHC/1.0
Connection: keep-alive
Authorization: Basic Q09S...
Content-Type: application/json
Content-Length: 130516439 <===
{
"d": {
"ProblemCategory": "OCW",
"ADHOC_UPD_INP": {
...
"Filename": "Photo 1.jpg",
"Zzesribase64pdf": "/9j/4AAQSkZJRgABAQAASABIAAD/4QrURXhpZgAATU0AKgA..................... <===
...
...
2025-06-13T01:57:06.544Z ERROR [q6cb9] DefaultExceptionListener event:f5151860-47f7-11f0-a156-567dfb88e816 [MuleRuntime].uber.07: [test-ei-test-app].test-Flow.CPU_LITE @3ca38e3d -
********************************************************************************
Message : HTTP POST on resource 'https://sapxxx.xxx.com:8443/sap/opu/odata/sap/TEST_SAP_TEST/Example' failed: bad request (400).
Element : test-Flow/processors/5/processors/0/processors/2 @ test-ei-test-app:test-sapi.xml:785 (Request)
Element DSL : <http:request method="POST" doc:name="Request" doc:id="3fe8ffca-4907-4056-ab21-821a4e905133" config-ref="SAP_Request" path="${SAP.completeNotifPath}" responseTimeout="${SAP.timeout}">
...
Résolution
  • As above, SAP OData request is handled as HTTP Request(<http:request>).
  • Therefore, by enabling HTTP WireLogging(*1), it will show the detailed information for the failed SAP OData. See above.
  • In this example, we notice "Content-Length: 130516439" which is 130,516,439 bytes, approximately 130 MB.
  • As per SAP document, "The maximum supported OData request size is 100 megabyte"

So this should be caused by the size limitation(request size shoud be less than 100 MB).

Please make sure to check the latest SAP Documentation, the limitation can be changed depending on situation, version, etc.

Also, 400 Bad Request can be caused by other reason. Remember to enable HTTP WireLoggingh(*1) and possible compare a successful(and similar) request and failing request to try to find the reason.

 

*1 KB: How to Enable HTTP Wire Logging for HTTP Connector or Other Connectors Using HTTP Service

 

Numéro d’article de la base de connaissances

005036932

 
Chargement
Salesforce Help | Article