I am currently trying to access any REST service for deleting a resource from my WSO2 EI sequence. The code looks something like below
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="DELETE_COMPANY_INFO" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<log level="custom">
<property name="Sequence" value="DELETE COMPANY INFO started"/>
</log>
<log level="custom">
<property expression="json-eval($)" name="Request Payload"/>
</log>
<property name="NO_ENTITY_BODY" action="set" value="false" type="BOOLEAN" scope="axis2"/>
<call blocking="true">
<endpoint>
<http method="delete" uri-template="http://<IP>:<Port>/companyinfo/<id>">
</http>
</endpoint>
</call>
</sequence>
As can be seen I wish to send the message payload to this endpoint. However I am not able to send this as the payload is dropped by WSO2 EI v6.4 Logs are below
[2020-02-21 14:00:33,127] [micro-integrator] INFO - LogMediator Sequence = DELETE COMPANY INFO started
[2020-02-21 14:00:33,128] [micro-integrator] INFO - LogMediator Request Payload = {"CompanyName":"test123"}
[2020-02-21 14:00:33,131] [micro-integrator] DEBUG - header >> "DELETE /companyinfo/123 HTTP/1.1[\r][\n]"
[2020-02-21 14:00:33,131] [micro-integrator] DEBUG - header >> "Content-Type: application/json; charset=UTF-8[\r][\n]"
[2020-02-21 14:00:33,132] [micro-integrator] DEBUG - header >> "User-Agent: Axis2[\r][\n]"
[2020-02-21 14:00:33,132] [micro-integrator] DEBUG - header >> "Host: <IP>:<Port>[\r][\n]"
[2020-02-21 14:00:33,132] [micro-integrator] DEBUG - header >> "[\r][\n]"
[2020-02-21 14:00:33,136] [micro-integrator] DEBUG - header << "HTTP/1.1 200 [\r][\n]"
[2020-02-21 14:00:33,136] [micro-integrator] DEBUG - header << "HTTP/1.1 200 [\r][\n]"
[2020-02-21 14:00:33,136] [micro-integrator] DEBUG - header << "Content-Type: application/json[\r][\n]"
[2020-02-21 14:00:33,136] [micro-integrator] DEBUG - header << "Content-Length: 25[\r][\n]"
[2020-02-21 14:00:33,137] [micro-integrator] DEBUG - header << "Date: Fri, 21 Feb 2020 08:30:32 GMT[\r][\n]"
[2020-02-21 14:00:33,137] [micro-integrator] DEBUG - header << "[\r][\n]"
[2020-02-21 14:00:33,137] [micro-integrator] DEBUG - content << "{"CompanyName":"test123"}"
I know that REST Webservice implementation should not use Payload for HTTP DELETE operation, however I think ESB should not make the decision to drop the Payload if the underlying transport allows it. Additionally, I know that this issue was reported earlier (https://wso2.org/jira/browse/ESBJAVA-5060) and marked as resolved in v6.2 of WSO2 EI. However I am facing this in 6.4 version of EI.
Is there a solution to allow Payload with HTTP DELETE call using Call Mediator in WSO2 EI v6.4?