首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在WSO2 ESB 4.8.1中配置代理设置

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

Stack Overflow用户
提问于 2014-03-18 09:25:59
回答 1查看 7.8K关注 0票数 1

我是wso2的新手。在使用EXTERNAl代理服务调用wso2esb SOAP服务时,我面临一个问题。我在公司代理中使用WSO2 ESB。我可以使用soap客户机直接调用这个外部soap服务。

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

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

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

有人能帮我一下吗。想了解更多信息,请看一下这个。(如何使用wso2代理服务向soap服务发送soap请求(Xml))

添加了错误脚本,请查看此

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

我的axis2.xml配置(我目前正在用NIO进行测试,因此我已经删除了标准存储库/ conf / axis2 2/axis2.xml,并将存储库/conf/axis2 2/axis2 2_nhttp.xml重命名为WSO2 /conf/axis2 2/axis2.xml,然后在我的axis2 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>

然后我的代理服务配置

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

代码语言:javascript
复制
`<?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控制台中使用了wso2客户机(Mozilla),成功地获得了重新定位。

非常感谢让-米歇尔帮助我完成这个任务

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-18 09:47:58

您将找到配置WSO2 这里的方法。

在/存储库/conf/axis2 2/axis2.xml中,编辑http传输的transportSender配置以指定代理服务器如下:

代码语言:javascript
复制
<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>

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

代码语言:javascript
复制
<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服务:

代码语言:javascript
复制
<?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控制台中,单击“尝试此服务”并输入以下请求:

代码语言:javascript
复制
<CelsiusToFahrenheit xmlns="http://www.w3schools.com/webservices/">
  <Celsius>20</Celsius>
</CelsiusToFahrenheit>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22475053

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档