Proxy 在WSO2 ESB 4.8.1中配置代理设置

Proxy 在WSO2 ESB 4.8.1中配置代理设置,proxy,wso2,wso2esb,Proxy,Wso2,Wso2esb,我是wso2的新手。。使用wso2esb代理服务调用外部SOAP服务时遇到问题。。我正在公司代理中使用WSO2 ESB。。我可以使用soap客户端直接调用这个外部soap服务 我需要在WSO2 ESB中设置任何代理配置吗 我在使用wso2proxy服务连接soap服务时遇到以下异常 2014-03-18 14:40:52193[-][PassThroughHTTPSender]警告连接回调连接被拒绝或失败原因:www.w3schools.com/68.232.44.251:80 2014-03-

我是wso2的新手。。使用wso2esb代理服务调用外部SOAP服务时遇到问题。。我正在公司代理中使用WSO2 ESB。。我可以使用soap客户端直接调用这个外部soap服务

我需要在WSO2 ESB中设置任何代理配置吗

我在使用wso2proxy服务连接soap服务时遇到以下异常

2014-03-18 14:40:52193[-][PassThroughHTTPSender]警告连接回调连接被拒绝或失败原因:www.w3schools.com/68.232.44.251:80
2014-03-18 14:40:52198[-][PassThroughMessageProcessor-3]警告EndpointContext端点:由于失败,AnonymousEndpoint将被标记为挂起
2014-03-18 14:40:52199[-][PassThroughMessageProcessor-3]警告EndpointContext挂起端点:AnonymousEndpoint-当前挂起持续时间为:30000ms-下一次重试时间:2014年3月18日星期二14:41:22
2014-03-18 14:41:51185[-][HTTP侦听器I/O dispatcher-2]读取请求后警告SourceHandler连接超时:HTTP-incoming-2
2014-03-18 14:51:49691[-][PassThroughHTTPSender]警告连接回调连接被拒绝或失败原因:www.w3schools.com/68.232.44.251:80
2014-03-18 14:51:49693[-][PassThroughMessageProcessor-5]警告EndpointContext端点:由于失败,AnonymousEndpoint将被标记为挂起
2014-03-18 14:51:49694[-][PassThroughMessageProcessor-5]警告端点上下文挂起端点:AnonymousEndpoint-上一次挂起持续时间为:30000ms,当前挂起持续时间为:30000ms-下一次重试时间:2014年3月18日星期二14:52:19

谁能帮我一下吗。。欲了解更多信息,请对此进行调查。()

添加了错误提示,请对此进行查看


修正了这个问题,下面是最终的配置


Jean告诉我的axis2.xml配置(我目前正在使用NIO进行测试,因此我删除了标准repository/conf/axis2/axis2.xml,并在我的WSO2 ESB v4.8.1中将repository/conf/axis2/axis2_nhttp.xml重命名为repository/conf/axis2/axis2.xml,然后编辑这个新的axis2 conf文件并搜索transportSender name=“http”和节点内部(发送方)


真的
proxy.abc.com
8080

然后是我的代理服务配置

********更改了我的代理服务配置,如下所示*****

`<?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控制台中使用Rest客户端(Mozilla Firefox插件)尝试此服务,并成功地获得了响应


非常感谢Jean Michel帮助完成此任务

您将找到配置WSO2的方法

在/repository/conf/axis2/axis2.xml中,编辑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">proxyhost.yourdomain</parameter>
    <parameter name="http.proxyPort" locked="false">proxyport</parameter>
</transportSender>

真的
proxyhost.yourdomain
代理端口
在向此代理服务器发送消息的代理服务的Synapse配置中,在发送中介之前设置以下两个属性:

<syn:property name="Proxy-Authorization" expression="fn:concat('Basic', base64Encode('userName:password'))" scope="transport"/>
<syn:property name="POST_TO_URI" value="true" scope="axis2"/>

用于测试tempconvert服务的代理示例:

<?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('DOMAIN\user:pass'))" 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>

在WSO2 ESB控制台中,单击“尝试此服务”并输入以下请求:

<CelsiusToFahrenheit xmlns="http://www.w3schools.com/webservices/">
  <Celsius>20</Celsius>
</CelsiusToFahrenheit>

20

感谢您的回复。。实际上,我想使用wso2代理服务调用此服务()。。当我在设计视图中测试地址端点时。。我得到的地址无效,无法建立连接。。。如何解决这个问题..我在一家公司里使用wso2,我有一个proxy.xxx.com这样的代理,我有用户名和密码,,,所以我需要按你说的那样设置,对吗??所以这里
localhost
我需要给proxy.xxx.com而不是localhost,这里
我需要给代理用户名和pwd权限??在我的问题中添加了代理服务。。。如何按u所述进行编辑??必须在repository/conf/axis2/axis2.xml中配置第一部分(带有proxyHost和proxyPort)(默认http发送方为PassThroughHttpSender:配置此发送方)。另一种方法是将proxyHost和proxyPort配置为java启动参数:-Dhttp.proxyHost=host-Dhttp.proxyPort=8080。第二部分发生在您的中介中。我已经配置了您建议的内容,并在我编辑的代理服务(是否正确)上面看到了这些内容,而我正在设计视图中测试相同的地址端点()。。我仍然收到无效地址,无法建立连接