Wso2 Callout正在调用不同的端点
您好,我是wso2新手,我有2个api,我想使用第一个调用第二个api,但是调用中介正在使用的url与我设置的url不同,导致错误HTTPSender无法发送到url[ 代码如下 欢迎任何帮助Wso2 Callout正在调用不同的端点,wso2,wso2esb,Wso2,Wso2esb,您好,我是wso2新手,我有2个api,我想使用第一个调用第二个api,但是调用中介正在使用的url与我设置的url不同,导致错误HTTPSender无法发送到url[ 代码如下 欢迎任何帮助 <api context="/Staff" name="StaffAPI" xmlns="http://ws.apache.org/ns/synapse"> <resource methods="GET" url-mapping="/Nurse"> <inSequen
<api context="/Staff" name="StaffAPI" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET" url-mapping="/Nurse">
<inSequence>
<log level="full"/>
<callout description="" initAxis2ClientOptions="false" serviceURL="http://192.168.20.1:8280/loginAPI/login">
<source type="envelope"/>
<target key="response"/>
</callout>
<log level="custom">
<property expression="get-property('response')" name="response"/>
</log>
<send>
<endpoint key="NurseEP"/>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
<faultSequence/>
</resource>
在postman上调用endpoint时有效如果您的serviceURL由api url映射作为后缀,请尝试在调用之前添加该后缀(在send mediator的情况下必须使用它,不确定调用是否有效,但它看起来像是相同的行为):
您可以添加“NurseEP”配置和“loginAPI”登录资源配置吗?您是否遵循了中描述的步骤?是的,我已经尝试了不止一次,以防跳过步骤现在我发现HTTPSender无法发送到url[并且该端点正在工作,我刚刚测试过
<api context="/loginAPI" name="LoginAPI" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET" uri-template="/login">
<inSequence>
<payloadFactory media-type="json">
<format>{
"userName": "xxx",
"password": "xxx",
"rememberMe": true,
"fireBaseToken": "string"
}</format>
<args/>
</payloadFactory>
<cache collector="false" hashGenerator="org.wso2.carbon.mediator.cache.digest.DOMHASHGenerator" id="Token" maxMessageSize="2000" scope="per-host" timeout="5000">
<onCacheHit/>
<implementation maxSize="1000" type="memory"/>
</cache>
<send>
<endpoint key="LoginEP"/>
</send>
</inSequence>
<outSequence>
<cache collector="true" scope="per-host"/>
<send/>
</outSequence>
<faultSequence/>
</resource>
<property name="REST_URL_POSTFIX" scope="axis2" action="remove"/>