Hi everyone,
Invoking a REST endpoint in OIC with a JSON array in the request returns a 400 Bad Request Error. However, it does work in Postman. It only works in OIC with one value. What am I doing wrong?
Request with multiple values - works in Postman, not in Oracle Integration Cloud:
{
"Ids": [
"62cee4816d5eed67ea9eea86",
"62cee4816d5eed67ea9eeaa4"
]
}
This works when I use Postman, but does not work in Oracle Integration Cloud. It returns the following error:
Error message
[CDATA[{"Message":"The request is invalid.","ModelState":{"request.Ids":["The field Ids is invalid."]}}.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. ]]
Request with one value - Works in Postman and in Oracle Integration Cloud
{
"Ids": [
“62cee4816d5eed67ea9eea86”
]
}
The problem seems to occur with multiple values in the array in OIC.
The activity stream shows this when I use multiple values.
Request with multiple values in the activity Stream:
<ns43:request-wrapper>
<ns43:Ids>62cee4816d5eed67ea9eea86</ns43:Ids>
<ns43:Ids>62cee4816d5eed67ea9eeaa4</ns43:Ids>
</ns43:request-wrapper>
The activity stream shows this when I use one value.
Request with one value in the activity Stream:
<ns43:request-wrapper>
<ns43:Ids>62cee4816d5eed67ea9eea86</ns43:Ids>
</ns43:request-wrapper>
When I put the XML code from the Activity Stream in a XML to JSON converter I get the exact JSON request I use in Postman/the request example for the endpoint. The same goes for the other way round; putting the JSON request in a JSON to XML converter gives me the exact XML code from the Activity Stream. What am I overlooking here?