Forum Stats

  • 3,781,640 Users
  • 2,254,533 Discussions
  • 7,879,771 Comments

Discussions

HTTP Protocol to send json payload with DELETE method

Prasanna G
Prasanna G Member Posts: 96 Blue Ribbon
edited Apr 28, 2020 5:58AM in SOA Suite Discusssions

Hi,

One of my clients exposed the following service for us to invoke from OSB 12c.

Uri: http://localhost/TestService

Http Method: DELETE

Body payload :

{

"param1" : "xyz",

"param2" : "test"

}

content-type : application/json

REST adapter's DELETE method expects input as query/template params and not Body.

Hence, I am not able to use it.

But I tried using HTTP protocol adapter in OSB. Chose Service Type as Rest. And set the following params -

Body -

{

"param1" : "xyz",

"param2" : "test"

}

Outbound:

<con:endpoint

name="BusinessService$Process$BusinessServices$DeleteAction xmlns:con="http://www.bea.com/wli/sb/context">

<con:service/>

<con:transport>

<con:mode>request-response</con:mode>

<con:qualityOfService>best-effort</con:qualityOfService>

<con:request

xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<tran:headers

xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">

<http:Accept>application/json</http:Accept>

<http:Content-Type>application/json</http:Content-Type>

</tran:headers>

<http:http-method>DELETE</http:http-method>

</con:request>

</con:transport>

<con:security>

<con:doOutboundWss>true</con:doOutboundWss>

</con:security>

</con:endpoint>

HTTP, Accept and Content-type - all are set correctly. But still I am getting 400 Invalid request error.

Can you please let me know if OSB (http adapter/rest adapter) supports DELETE with payload in body?

Thanks!!!

Tagged:

Answers