2017-07-14 89 views
0

我无法在wso2 ei和wso2 esb中调用第三方休息API(https://api.github.com/users/hackeryou)。 下面是示例代码:Wso2 EI 6.1.1 +第三方休息api集成

<api xmlns="http://ws.apache.org/ns/synapse" name="VerifyCustID" context="/mambu"> 
<resource methods="GET" uri-template="/verify"> 
<inSequence> 
<log> 
<property name="CustID API" value="*********Inside CustID API********** "/> 
</log> 
<send> 
<endpoint> 
<http method="GET" uri-template="https://api.github.com/users/hackeryou"/> 
</endpoint> 
</send> 
</inSequence> 
<outSequence> 
<send/> 
</outSequence> 
</resource> 
</api> 

下面是在服务器日志中的错误:

ID API = *********Inside CustID API********** 
[2017-07-14 15:01:48,756] [] WARN - ConnectCallback Connection refused or failed for : api.github.com/192.30.253.116:443 
[2017-07-14 15:01:48,759] [] WARN - EndpointContext Endpoint : AnonymousEndpoint with address https://api.github.com/users/hackeryou will be marked S 
USPENDED as it failed 
[2017-07-14 15:01:48,760] [] WARN - EndpointContext Suspending endpoint : AnonymousEndpoint with address https://api.github.com/users/hackeryou - cur 
rent suspend duration is : 30000ms - Next retry after : Fri Jul 14 15:02:18 IST 2017 
[2017-07-14 15:01:48,772] [] INFO - LogMediator To: https://api.github.com/users/hackeryou, MessageID: urn:uuid:7b834e0e-e348-4b60-adeb-f60a70f00483, 
Direction: request, MESSAGE = Executing default 'fault' sequence, ERROR_CODE = 101503, ERROR_MESSAGE = Error connecting to the back end, Envelope: <? 
xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope> 

回答

1

我们可能有一些网络连接问题api.github.com:443(也许防火墙等)

的API在EI611上工作得很好:

enter image description here

如果你不使用默认的信任client-truststore.jks)随WSO2或者已经修改了它,你可能需要导入证书api.github.com到您WSO2服务器实际使用的信任存储区。
除了网络连接和信任存储缺失证书,看不到为什么你的API不应该能够调用远程服务

+0

非常感谢你维杰。 –

+0

@RajuK最后是什么问题? –

+0

防火墙问题,我的防火墙不允许打任何第三方API,这个问题是由网络团队解决。 –