1
votes

I want to use Mule ESB as a proxy for my web service. I'm SOATest to simulate the client. I'm a beginner, i'm using Mule Studio and i don't know which component i should use. I also need to get arguments values from the soap request. Any idea?

Here's my configuration:

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

3 Answers

1
votes

You need to use CXF proxy for a web service proxy An example of Mule Proxy service will be :-

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

You can modify the flow as per you need

1
votes

Trying this might help:

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