Mule ESB代理肥皂webservice

时间:2013-12-18 12:37:12

标签: mule esb

我想使用Mule ESB作为我的Web服务的代理。我很想模拟客户端。 我是初学者,我正在使用Mule Studio,我不知道应该使用哪个组件。 我还需要从soap请求中获取参数值。 有什么想法吗?

这是我的配置:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.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://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd ">
    <flow name="getValidation_FlowFlow1" doc:name="getValidation_FlowFlow1">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8090" path="MyWSService/GetValidation" doc:name="Inbound"/>
        <http:outbound-endpoint exchange-pattern="request-response" host="XX.XXX.X.XX" port="8080" path="ws/MyWSService" doc:name="Outbound"/>
    </flow>
</mule>

3 个答案:

答案 0 :(得分:1)

答案 1 :(得分:1)

您需要将CXF代理用于Web服务代理 Mule代理服务的一个例子是: -

<flow name="ProxyFlow" doc:name="ProxyFlow" processingStrategy="synchronous">
 <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8086" path="proxy/mainData" doc:name="HTTP" />
 <cxf:proxy-service  namespace="http://services.test.com/schema/MainData/V1" service="MainData"  payload="body" wsdlLocation="MainData.wsdl" doc:name="SOAP"/> 
 <cxf:proxy-client payload="body" doc:name="SOAP" />
 <http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8082" path="mainData" method="POST" doc:name="HTTP" />
</flow>

您可以根据需要修改流程

答案 2 :(得分:1)

尝试这可能会有所帮助:

    <?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="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://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:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration"/>
    <cxf:configuration name="CXF_Configuration" enableMuleSoapHeaders="true" initializeStaticBusInstance="true" doc:name="CXF Configuration"/>
    <flow name="soapFlow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/helloworld" doc:name="HTTP"/>
        <cxf:jaxws-service configuration-ref="CXF_Configuration" serviceClass="soap.ISoapInterface" doc:name="CXF"/>
        <component class="soap.HelloSoap" doc:name="Java"/>
    </flow>
</mule>