Search code examples
apipostwso2esb

WSO2 ESB No Response after POST request


I am using WSO2 ESB to send a POST request to a Rest API of mine. actually, the API returns a 201 status with some data. The API itself using POSTMAN works perfectly, but a 202 accepted response is return using the ESB link here's my implementation: the POST API Link: http://mysite/sites/4/floors/4/pois/12/prelock

My ESB API :

<resource methods="POST" uri-template="/sites/{siteId}/floors/{floorId}/pois/{poiId}/prelock">
    <inSequence>
        <log level="full"/>
        <header name="Content-Type" scope="transport" value="application/json"/>
        <property expression="$axis2:HTTP_SC" name="Status" scope="default" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
        <send>
            <endpoint key="NodeRedPrelock"/>
        </send>
    </inSequence>
    <outSequence>
        <log level="full"/>
        <send/>
    </outSequence>
    <faultSequence/>
</resource>

endpoint :

<endpoint name="NodeRedPrelock" xmlns="http://ws.apache.org/ns/synapse">
<http method="post" uri-template="http://mysite/sites/{uri.var.siteId}/floors/{uri.var.floorId}/pois/{uri.var.poiId}/prelock"/>


Solution

  • The problem seems to be with the http method .Can you try with this

        <endpoint name="NodeRedPrelock" xmlns="http://ws.apache.org/ns/synapse">
      <http trace="disable" uri-template="http://169.46.25.33:1880/sites/{uri.var.siteId}/floors/{uri.var.floorId}/pois/{uri.var.poiId}/prelock"/>
    </endpoint>