0
votes

I'm trying to call a web service in tomcat through api resource in WSO2 ESB.

The resource is:

<resource methods="DELETE" url-mapping="/weight/delete">
<inSequence>
  <log level="custom">
    <property name="Access token value" expression="$trp:Authorization"/>
  </log>
  <oauthService remoteServiceUrl="https://host:port/services/" username="username" password="password"></oauthService>
  <header name="Authorization" scope="transport" action="remove"></header>
  <send>
    <endpoint>
      <address uri="http://host:8080/web-services/services/proyect1"></address>
    </endpoint>
  </send>
</inSequence>

It hasn't query params and path params.

But I have an 500 internal server error, and tomcat throw this exception:

Caused by: com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input

The request is:

All is correct sending request directly to tomcat.

1

1 Answers

0
votes

According to REST, delete method in HTTP must not content payload. Then, http://host:8282/web-services/services/proyect1/weight/delete it's not correct.

But, to resolve this problem I can use a PayLoadFactory mediator in WSO2 to send JSON to endpoint.