2017-07-14 53 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,這個問題是由網絡團隊解決。 –