我正在为其中一个租户定义WSO2ESB中的API。定义API时,该租户会自动获得其自己的上下文路径(例如http://127.0.0.1:8280/tenant1/api-istientifier/(。
下一步是将此请求转发到http端点(例如http://127.0.0.0.1:9191/v1/(。但是,当查看日志时,ESB试图将此请求发送到http://127.0.0.1:9191/v1/tenant1/api-istentifier/无法给出答复。我可以从URL中删除此部分吗?感觉这应该可以从开箱即用。
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.wso2.carbon.mediation.registry.WSO2Registry">
<parameter name="cachableDuration">1500</parameter>
</registry>
<taskManager provider="org.wso2.carbon.mediation.ntask.NTaskTaskManager"/>
<sequence name="In">
<log category="TRACE" level="full"/>
<send>
<endpoint key="gov:/HelloWorld"/>
</send>
</sequence>
<sequence name="fault">
<log level="full"/>
</sequence>
<sequence name="main">
<in>
<log/>
<sequence key="conf:/InSecure"/>
</in>
<out>
<send/>
</out>
</sequence>
<sequence name="Out">
<send/>
</sequence>
<sequence name="InSecure">
<log/>
<send>
<endpoint key="gov:/HelloWorld"/>
</send>
</sequence>
<api context="/lensworld.be/hw" hostname="192.168.1.100"
name="HelloWorld" port="9191">
<resource inSequence="InSecure" methods="GET" outSequence="Out"/>
</api>
尝试删除REST_URL_POSTFIX
属性:
<property name="REST_URL_POSTFIX" action="remove" scope="axis2"/>
来自文档:
通过地址端点以宁静的方式发送消息时,此属性的值将附加到目标URL。当您需要将上下文附加到目标URL的情况下,这很有用。如果您使用的是HTTP端点而不是地址端点,请在" uri.var。"格式中指定变量,而不是使用此属性。