【发布时间】:2014-04-23 21:06:18
【问题描述】:
我是 wso2 的新手。我在使用 wso2esb 代理服务调用外部 SOAP 服务时遇到问题。我在公司代理中使用 WSO2 ESB。我可以直接使用肥皂客户端..
我需要在 WSO2 ESB 中设置任何代理配置吗?
我在使用 wso2proxy 服务连接肥皂服务时遇到以下异常
2014-03-18 14:40:52,193 [-] [PassThroughHTTPSender] WARN ConnectCallback Connection refused or failed for : www.w3schools.com/68.232.44.251:80
2014-03-18 14:40:52,198 [-] [PassThroughMessageProcessor-3] WARN EndpointContext Endpoint : AnonymousEndpoint will be marked SUSPENDED as it failed
2014-03-18 14:40:52,199 [-] [PassThroughMessageProcessor-3] WARN EndpointContext Suspending endpoint : AnonymousEndpoint - current suspend duration is : 30000ms - Next retry after : Tue Mar 18 14:41:22 IST 2014
2014-03-18 14:41:51,185 [-] [HTTP-Listener I/O dispatcher-2] WARN SourceHandler Connection time out after request is read: http-incoming-2
2014-03-18 14:51:49,691 [-] [PassThroughHTTPSender] WARN ConnectCallback Connection refused or failed for : www.w3schools.com/68.232.44.251:80
2014-03-18 14:51:49,693 [-] [PassThroughMessageProcessor-5] WARN EndpointContext Endpoint : AnonymousEndpoint will be marked SUSPENDED as it failed
2014-03-18 14:51:49,694 [-] [PassThroughMessageProcessor-5] WARN EndpointContext Suspending endpoint : AnonymousEndpoint - last suspend duration was : 30000ms and current suspend duration is : 30000ms - Next retry after : Tue Mar 18 14:52:19 IST 2014
任何人都可以帮我解决这个问题。有关更多信息,请查看此内容。 (How to send a soap request(xml) to soap service using wso2 proxy service)
添加了错误截图,请查看
修复了问题,下面是最终配置
我的axis2.xml配置为Jean Told(我目前正在使用NIO进行测试,因此我删除了标准repository/conf/axis2/axis2.xml并将repository/conf/axis2/axis2_nhttp.xml重命名为repository/conf /axis2/axis2.xml 在我的 WSO2 ESB v4.8.1 中,然后编辑这个新的axis2 conf文件并搜索transportSender name="http"并在节点transportSender内)
<transportSender name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
<parameter name="non-blocking" locked="false">true</parameter>
<parameter name="http.proxyHost" locked="false">proxy.abc.com</parameter>
<parameter name="http.proxyPort" locked="false">8080</parameter>
</transportSender>
然后是我的代理服务配置
********更改了我的代理服务配置,如下答案*****
`<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="CelsiusToFahrenheitService"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="messageType" value="text/xml" scope="axis2"/>
<property name="Proxy-Authorization"
expression="fn:concat('Basic', base64Encode('INDIA\username:pwd'))"
scope="transport"/>
<property name="POST_TO_URI" value="true" scope="axis2"/>
<property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
<header name="Action"
value="http://www.w3schools.com/webservices/CelsiusToFahrenheit"/>
<send>
<endpoint>
<address uri="http://www.w3schools.com/webservices/tempconvert.asmx"
format="soap11"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<property name="messageType" value="text/xml" scope="axis2"/>
<send/>
</outSequence>
</target>
<description/>
</proxy>`
然后我重新启动了 ESB,然后在 wso2 控制台中转到 try this service 并使用 Rest Client(Mozilla Firefox Addon),成功获得了响应
非常感谢 Jean-Michel 帮助完成这项任务
【问题讨论】: