为什么使用CXF-Proxy后出站地址没有重定向到mule?

时间:2013-02-02 08:30:26

标签: mule

我使用cxf代理服务在mule 3.3.0 CE发布了一个Web服务。

<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>

我的mule服务器的IP是:192.168.0.59。我只能通过Ip(192.168.0.59)看到出站地址(http://websrv.mydns.com:8080/App/WSService)。 在runnig web服务之后我可以看到我使用cxf代理发布它的wsdl但是当我用SoapUI检查它时,我无法收到响应。我在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?

1 个答案:

答案 0 :(得分:1)

尝试使用以下配置:

<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>