Web Service Consumer Connector in Mule 4


Web service consumer in mule 4



Web Service Consumer is used to consuming SOAP web service in Mule.

flow of Web Service Consumer in Mule:


WSDL file you can get from here:  http://mu.learn.mulesoft.com/delta?wsdl

for consuming soap web service we need to give WSDL file path in web service consumer.

WSDL file is stored in src/main/resources


Web service consumer configuration:


Connector configuration:


Transform message configuration:


URL: http://localhost:8085/web?code=pune
Method: GET


XML project code:

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

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xmlns:wsc="http://www.mulesoft.org/schema/mule/wsc"
     xmlns:http="http://www.mulesoft.org/schema/mule/http"
     xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="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/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/wsc http://www.mulesoft.org/schema/mule/wsc/current/mule-wsc.xsd">
     <wsc:config name="Web_Service_Consumer_Config" doc:name="Web Service Consumer Config" doc:id="f63d6809-4952-4571-a4ff-aa8da598973d" >
          <wsc:connection wsdlLocation="soap.wsdl" service="TicketServiceService" port="TicketServicePort" address="http://mu.learn.mulesoft.com/delta" />
     </wsc:config>
     <http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="8f86ba62-35e2-4861-b5e3-11e57c0aca7d" >
          <http:listener-connection host="0.0.0.0" port="8085" />
     </http:listener-config>
     <flow name="test_webserviceconsumerFlow" doc:id="ea35e9f8-694f-4b1b-91d8-ad76a918659f" >
          <http:listener doc:name="Listener" doc:id="68fa6fed-9b7a-4115-ab18-d1becf2cf39f" config-ref="HTTP_Listener_config" path="/web"/>
          <ee:transform doc:name="Transform Message" doc:id="d618ff14-5ba3-4b56-a832-79bc2a796003" >
              <ee:message >
                   <ee:set-payload ><![CDATA[%dw 2.0
output application/xml
ns ns0 http://soap.training.mulesoft.com/
---
{
     ns0#listAllFlights: attributes.queryParams.id
}]]></ee:set-payload>
              </ee:message>
          </ee:transform>
          <wsc:consume operation="listAllFlights" doc:name="Consume" doc:id="a3d33234-e13c-4ad4-8fc8-e75c1786105b" config-ref="Web_Service_Consumer_Config"/>
     </flow>
</mule>


© 2020 goformule.com

Share on :

Mule 4:

XML to JSON in mule 4 Web service consumer VM Validation in Mule 4 Until Successful
Sub flow Set Variable & Remove Variable Set Transaction ID Scatter Gather Round Robin
Consume Restful Service CRUD in Mule 4 Parse Template Object to JSON Load Static Resource
JSON to XML Invoke Idempotent Filter ForEach Flat file to JSON
Fixwidth to JSON First Successful File Execute Error Handling
Email Dynamic Evaluate Custom Business Event CSV to JSON Copybook to JSON
Choice Router Async RabbitMQ


Mule 3:


Database Connector Async CXF Attachement XSLT
Mongo DB Cache scope Custom Business Event Gzip Compress Expression
SMTP For Each Expression Javascript Filter Reference
Salesforce Message Enricher Groovy Parse Template Idempotent
VM Poll Invoke Ruby Message
Webservice consumer Python Transformer reference Message Property Not
Collection Aggregator First Sucessful Catch Exception Strategy Reference Exception Strategy Or
Choice Message Chunk Aggregator Choice Exception Strategy Global Exception Strategy Schema Validation
Custom Aggregator Scatter Gather Custom Exception Strategy Batch Processing MEL
M Unit RAML Map Operator API Mocking Dataweave