Proxy之后的出站地址

Proxy之后的出站地址

本文介绍了为什么在C子中没有重定向使用CXF-Proxy之后的出站地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在cule 3.7.0 CE中使用cxf代理服务发布了一个Web服务.

I published a web service in mule 3.3.0 CE with cxf proxy-service.

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
xmlns:cxf-core="http://cxf.apache.org/core" xmlns:mule-xml="http://www.mulesoft.org/schema/mule/xml"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security"
xmlns:ss="http://www.springframework.org/schema/security" xmlns:test="http://www.mulesoft.org/schema/mule/test"
xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
    http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
    http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
    http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
    http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
    http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/3.3/mule-spring-security.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
    http://www.mulesoft.org/schema/mule/test http://www.mulesoft.org/schema/mule/test/current/mule-test.xsd "
    version="CE-3.3.0">
<flow name="wbs" doc:name="wbs">
    <http:inbound-endpoint host="localhost" port="9094"
        path="myPath/app" exchange-pattern="request-response" doc:name="HTTP">
    </http:inbound-endpoint>

    <cxf:proxy-service doc:name="wbsrv" service="AppWSService"
        wsdlLocation="schema/wsdl/App/WSService.wsdl" namespace="http://wbservice.com/"
        payload="body"></cxf:proxy-service>
    <copy-properties propertyName="SOAPAction" doc:name="Property" />
    <cxf:proxy-client doc:name="wbsrv" />

    <http:outbound-endpoint address="http://websrv.mydns.com:8080/App/WSService"
        doc:name="HTTP" encoding="UTF-8" responseTimeout="1000000"
        exchange-pattern="request-response">
    </http:outbound-endpoint>
</flow>

我的m子服务器的IP为192.168.0.59.我可以看到出站地址( http://websrv.mydns.com:8080/App/WSService)就是那个IP(192.168.0.59).在运行runnig Web服务之后,我可以看到我用wxdl使用cxf代理发布它的wsdl,但是当我用SoapUI对其进行检查时,我无法收到响应.我在SoapUI xml中出现以下错误:

Ip of my mule server is : 192.168.0.59. I can see outbound address (http://websrv.mydns.com:8080/App/WSService) just by that Ip (192.168.0.59).after runnig web service I can see my wsdl that I publish it with cxf proxy but when I checked it with SoapUI, I can't receive response. I have below error in SoapUI xml:

<soap:Fault>
     <faultcode>soap:Server</faultcode>
     <faultstring>Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=http://websrv.mydns.com:8080/App/WSService, connector=HttpConnector
{   name=httpConnector   lifecycle=start   this=16a2c7b
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true   connected=true
supportedProtocols=[http]   serviceOverrides=
session.handler=org.mule.session.NullSessionHandler } ,  name='endpoint.http.websrv.mydns.com.8080.App.WSService',
mep=REQUEST_RESPONSE, properties={},
transactionConfig=Transaction{factory=null, action=INDIFFERENT,
timeout=0}, deleteUnacceptedMessages=false, initialState=started,
responseTimeout=1000000, endpointEncoding=UTF-8,
disableTransportTransformer=false}. Message payload is of type:
websrvMethod
</faultstring>
      </soap:Fault>

如何重定向我可以在每个服务器和IP上使用的出站地址?

How to redirect outbound address that I can use it each server and IP?

推荐答案

尝试以下配置:

<flow name="wbs">
    <http:inbound-endpoint host="localhost" port="9094"
        path="myPath/app" exchange-pattern="request-response">
        <cxf:proxy-service service="AppWSService"
            wsdlLocation="schema/wsdl/App/WSService.wsdl"
            namespace="http://wbservice.com/"
            payload="body" />
    </http:inbound-endpoint>

    <copy-properties propertyName="SOAPAction" />

    <http:outbound-endpoint address="http://websrv.mydns.com:8080/App/WSService"
        encoding="UTF-8" responseTimeout="1000000"
        exchange-pattern="request-response">
        <cxf:proxy-client payload="body" />
    </http:outbound-endpoint>
</flow>

这篇关于为什么在C子中没有重定向使用CXF-Proxy之后的出站地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 09:53