400 Bad Request Error when updating an EFF using the ERP Adapter
(Doc ID 2871157.1)
Last updated on SEPTEMBER 28, 2022
Applies to:
Oracle Integration-OIC - Version 21.2.2.0.0 and laterInformation in this document applies to any platform.
Symptoms
There is a 400 Bad Request error when updating an EFF (Extensible Flex Field) using the ERP Adapter to invoke an ERP REST service (eg the ItemService)
The issue is that the ERP Adapter is not creating a well formed JSON payload from the mapped XML.
The wire message in the Activity Stream shows there are a pair of square brackets is missing in the JSON, resulting in the ERP REST Service rejecting the request with a HTTP 400 Bad request response :-
<nsmpr6:Detail>>&lt;![CDATA[Unable to parse the provided payload.A 400 Bad Request Error indicates that the target service is unable (or refuses) to process the request sent by the client (Oracle Integration Cloud), due to an issue that is perceived by the server to be a client problem.
You can trace the cURL representation of the request sent to the target service from the Oracle Integration Cloud server logs. Try invoking the target service using cURL.
It may also be that one of the intermediaries (proxy, LBR) could be returning this code. ]]&gt;<
Example XML being sent to the invoke of the ERP Adapter. In this example, an EFF called myEFF is being updated :-
[Location:Message sent to ProcessItem][Operation:upsert][ActionID:i0][ActionName:ProcessItem][ActionType:Invoke][PayloadSizeInBytes:7,466]: <upsert xmlns:ns0=...>[[
<nstrgmpr:ItemsV2>
<ns35:ItemId>22222222</ns35:ItemId>
<ns35:OrganizationId>000000</ns35:OrganizationId>
<ns33:ItemEffCategory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns31:SW_Item_Class">
<myEFF xmlns="http://xmlns.oracle.com/cloud/adapters/fscmRestApp/ItemsV2/ItemEffCategory">
<ns31:EffLineId>111111</ns31:EffLineId>
<ns31:EffValue>22222222</ns31:EffValue>
</myEFF>
</ns33:ItemEffCategory>
</nstrgmpr:ItemsV2>
</upsert>
]]
This is example JSON being sent to ERP :-
{
"ItemId" : 22222222,
"OrganizationId" :000000,
"ItemEffCategory" : [ {
"myEFF" : {
"EffLineId" : "111111",
"EffValue" : "22222222"
}
} ]
}
Whereas the correct JSON should be :-
{
"ItemId" : 22222222,
"OrganizationId" :000000,
"ItemEffCategory" : [ {
"myEFF" : [ {
"EffLineId" : "111111",
"EffValue" : "22222222"
} ]
} ]
}
The incorrect JSON is missing the square bracket characters for [ ] that indicate that myEFF is an array / list.
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Cause |
Solution |