如何从WSO2_ESB代理服务调用WSO2_AM中的API

如何从WSO2_ESB代理服务调用WSO2_AM中的API,wso2,wso2esb,wso2-am,Wso2,Wso2esb,Wso2 Am,我在WSO2AM中发布了一个API,商店中显示的url是https://{ip}:8243/phoneverify/1.0.0 现在我尝试从ESB代理服务(稍后将由调度器调用)调用它,如下所示 <?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="a" transports="https,http" stat

我在
WSO2AM
中发布了一个API,商店中显示的url是
https://{ip}:8243/phoneverify/1.0.0

现在我尝试从ESB代理服务(稍后将由调度器调用)调用它,如下所示

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="a"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <log level="full"/>
         <send>
            <endpoint>
               <http method="get"
                     uri-template="https://{ip}:8243/phoneverify/1.0.0/CheckPhoneNumber">
                  <timeout>
                     <duration>30000</duration>
                     <responseAction>fault</responseAction>
                  </timeout>
               </http>
               <property name="Authorization"
                         value="Bearer aaa4663b5851e06f2f1bc6e871fd20b7"
                         scope="axis2"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <log level="full"/>
      </outSequence>
   </target>
   <description/>
</proxy>

我可以使用Chrome Advanced Rest Client调用API。因此,通过代理服务调用它,我做错了什么?

如果您的API需要REST/JSon消息,那么在您的代理(WSO2 ESB)中,您应该在
之前添加
。 如果API需要REST/XML,则使用
application/XML

注意。

对于“主机名验证失败”异常,请尝试wso2.org/jira/browse/apimager-2089中建议的配置

而且,在代理服务中,必须使用头中介来设置授权头

<header name="Authorization" value="xxxxxx" scope="transport"/>


什么是
/services/TesAM
?还可以将
{ip}
替换为实际值,并删除
仅用于测试。启用Tcpmon检查WSO2 ESB到WSO2 AM的传出请求消息。很抱歉,日志已更正,{ip}被故意替换为原始名称,为什么
内,应该介于
之间,否?我认为这是配置问题。请尝试中建议的配置,您必须将其作为标题发送。对Hi Sajith和Isuru使用标题中介,
是正确的。有关信息,请查看此。
<header name="Authorization" value="xxxxxx" scope="transport"/>