Over a million developers have joined DZone.

How to Create a SOAP API Proxy in Mulesoft ESB

Here's a simple way to create a SOAP API proxy using Mule ESB.

· Integration Zone

Build APIs from SQL and NoSQL or Salesforce data sources in seconds. Read the Creating REST APIs white paper, brought to you in partnership with CA Technologies.

Here's a simple way to create a SOAP API proxy in Mule ESB.

1. Let's assume that this is your WSDL link: http://domain.com:8080/somename/name2?wsdl.

2. Now open this link into your browser and copy its content into Notepad.

3. Do this with wsdlFileName.wsdl, as well.

4. Check your Namespace name and service name in WSDL. Below is a hint to find a tag. You will find a tag name like this:

targetNamespace="http://ws.los.xyz.com"

 service name="XyzServiceService"

5. Now, we are ready to create a proxy! Open the studio and start your work.

6. Drag HTTP Listener, CXF Connector, and HTTP Requester.

7. Configure the HTTP listener give port(8087) as per your system and provide the path as /somename/name2 from your WSDL URL.

8. Configure the CXF Connector:          

 operation :- Proxy service
    Namespace :- http://ws.los.xyz.com
    Service :- XyzServiceService
    Check Box :- validation Enabled
    Payload :- envelope

Note: Paste the wsdlFileName.wsdl file into the resource directory.    

Advanced TAB > WSDL Location: wsdlFileName.wsdl (WSDL file name).

Advanced TAB > Select a checkbox of SOAP Version 1.1 or 1.2 as per your service.   

9. Now configure the HTTP requester:

Protocal :- Http (as per wsdl link)
    port     :-  8080 (as per wsdl link)
    basepath :-  /somename/name2 (as per wsdl link)
    path :- #[message.inboundProperties.'http.listener.path']
    method :- #[message.inboundProperties.'http.method']

10. When the proxy API is ready, you can run it and check it with this link.

Please refer to the XML code below:

<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8087" doc:name="HTTP Listener Configuration"/>
    <http:request-config name="HTTP_Request_Configuration"  host="domain.com" port="8080" basePath="somename/name2" doc:name="HTTP Request Configuration" protocol="HTTP"/>
 <flow name="HttpWebServiceBridge">
         <http:listener config-ref="HTTP_Listener_Configuration" path="/TUWebService/services/TUWebService" doc:name="HTTP"/>
          <cxf:proxy-service
             wsdlLocation="wsdlFileName.wsdl" 
             service="XyzServiceService"
             namespace="http://ws.los.xyz.com"
             validationEnabled="true"
             enableMuleSoapHeaders="false" doc:name="CXF" payload="envelope"/>
         <http:request config-ref="HTTP_Request_Configuration" path="#[message.inboundProperties.'http.listener.path']" method="#[message.inboundProperties.'http.method']" doc:name="HTTP"/>
 </flow>

The Integration Zone is brought to you in partnership with CA Technologies.  Use CA Live API Creator to quickly create complete application backends, with secure APIs and robust application logic, in an easy to use interface.

Topics:
mulesoft ,integration ,soap api

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}