2
我有我的WSO2 ESB定義的簡單API(4.7.0版本):WSO2 ESB HTTP端點URI參數
<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>
當調用它:
http://localhost:8280/test/VALUE
我看到,在日誌從ESB,似乎是正確的參數被記錄和正確的地址似乎被稱爲:
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
錯誤,當我在我的SERVIC啓用訪問日誌記錄戊方,我看到,請求是有一點不同:
"127.0.0.1" "NULL-AUTH-USER" "GET /myservice/VALUE/?aa=bb/VALUE HTTP/1.1" 200 220
的問題是 - 爲什麼我收到「/VALUE
」附加在URL的末尾,如何擺脫它?
謝謝!