Question

I have a simple API defined in my WSO2 ESB (version 4.7.0):

<api xmlns="http://ws.apache.org/ns/synapse" context="/test" name="TestAPI">
    <resource methods="GET" uri-template="/{param1}">
        <inSequence>
            <log category="INFO" level="custom" separator=",">
                <property expression="get-property('uri.var.param1')" name="Param1"/>
            </log>
            <send>
                <endpoint>
                    <http trace="enable" uri-template="http://localhost:8080/myservice/{uri.var.param1}/?aa=bb"/>
                </endpoint>
            </send>
        </inSequence>
        <outSequence>
            <send/>
        </outSequence>
        <faultSequence/>
    </resource>
</api>

When calling it:

http://localhost:8280/test/VALUE

I see, that in logs from ESB, seems that correct parameter is being logged and correct address seems being called:

INFO {org.apache.synapse.mediators.builtin.LogMediator} -  Param1 = VALUE {org.apache.synapse.mediators.builtin.LogMediator}
INFO TRACE_LOGGER Sending message through endpoint : endpoint_d8f2411c6ce735d2f6cca8d2a23af16a89c0d34f6b95d560 resolving to address = http://localhost:8080/myservice/VALUE/?aa=bb

Bug when I enable access logging on my service side, I see that the request was a little bit different:

"127.0.0.1" "NULL-AUTH-USER" "GET /myservice/VALUE/?aa=bb/VALUE HTTP/1.1" 200 220

The question is - why do I am getting "/VALUE" appended at the end of the URL and how to get rid of it?

Thanks!

Was it helpful?

Solution

As described in another question, it is related to REST_URL_POSTFIX variable. Clearing it before endpoint solves the issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top