HTTP Delete Rest service with request body as payload

Hi All,

My Integration server version is 9.12 and I have developed a HTTP DELETE Rest service for delete operation. Request for this service will be passed by source application in request body as payload and not in query parameters. I try to test the service using SOAPUI/POSTMAN app and below steps are followed.

  1. HTTP Method Name selected as DELETE
  2. Header parameter Content-Type set with value as application/xml
  3. Placed the request xml in body of request as a payload.

When tested it. Service was not working. Got error as request object is null. I debugged the code by adding savePipeline service inside _delete flow service to save the request. When restore it request body which usually appear as object (node) was missing.

If I pass query parameters to the same DELETE service, I am able to retrieve it. The only problem is whenever request xml/json passed in request body, Integration server either not reading or ignoring it. This is happening only when HTTP method is DELETE.

Can anyone faced the same problem?.

Is there any solution to overcome this problem?

Thanks & Regards,
Marimuthu Chellamuthu

Hi,

please check documentation or forum for

watt.server.http.xmlFormat
and
watt.server.http.jsonFormat

Cheers Alex

This is an know scenario and Integration Server doesn’t accept request body for HTTP DELETE Method.

The only means to accept the content for DELETE method in IS is by passing the Query parameter.

Maybe this might help if the subject issue is the same.

Resolution:

This issue is resolved as part of Integration Server Core Fix “IS_9.8_Core_Fix17”.

Fix Details:

PIE-47698

The pub.client:http service does not include a body in requests that use the DELETE method.

It is common practice to qualify HTTP DELETE requests by including query parameters in the URL. While it is not explicitly forbidden to include a body with a DELETE request, most HTTP servers do not support it. The pub.client:http service does not include a body in requests that use the DELETE method, which makes it difficult to communicate with HTTP servers that expect one.

You can now supply a value in the data/bytes input variable to pub.client:http service when the method input variable is DELETE. The service will transmit the value in the body of the request to the remote server. The data/bytes input variable is the only variable that can be used to send a body with DELETE requests. The data/stream and data/mimeStream input variables are not supported with DELETE. If the data/stream or data/mimeStream input variables specify a value when method is set to DELETE, the service ignores data/stream or data/mimeStream.

Note: Handling of the data/args, data/table and data/string input variables has not changed for DELETE. The service appends the input variable values to the URL as query parameters.

The above fix from SAG is applicable when IS is interacting with the remote server (not an IS) using HTTP DELETE method and requires a body content to be sent.

Where as if IS is providing a REST service using DELETE method, it cannot receive the content in request body.

Makes sense if IS is acting as a REST resource/server. I think this should be treated as a feature request if conventional REST DELETE method supports the payload.