anypoint studio - How to consume a SOAP Webservice in Mule ESB -
i new mule , need consume it. have 3rd party soap service takes 1 input , provides 1 output mention below. how can call mule, passthrough proxy need transformation required. need call mule.
request:
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://test.co.nz/controlkeysdetails"> <soapenv:header/> <soapenv:body> <con:getcontrolkeydetail xmlns:con="http://test.co.nz/controlkeysdetails"> <con:keycode>m2m_in_product_code</con:keycode> </con:getcontrolkeydetail> </soapenv:body> </soapenv:envelope>
response:
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:body> <controlkeydetailresponse xmlns="http://test.co.nz/controlkeysdetails"/> </soapenv:body> </soapenv:envelope>
mule code:
<?xml version="1.0" encoding="utf-8"?> <mule xmlns:ws="http://www.mulesoft.org/schema/mule/ws" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" 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: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/ws http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd"> <http:listener-config name="http_listener_configuration" host="0.0.0.0" port="8081" doc:name="http listener configuration"/> <ws:consumer-config name="web_service_consumer" service="dss_controlkeydetailsproxy" port="dss_controlkeydetailsproxyhttpsoap11endpoint" serviceaddress="http://esb1.test.2degreesmobile.co.nz:8280/services/dss_controlkeydetailsproxy.dss_controlkeydetailsproxyhttpsoap11endpoint" wsdllocation="http://hnzclakl194:8280/services/dss_controlkeydetailsproxy?wsdl" doc:name="web service consumer"/> <flow name="soapwebserviceflow"> <http:listener config-ref="http_listener_configuration" path="/" doc:name="http"/> <set-payload value="{'con:keycode':'m2m_in_product_code'}" doc:name="set payload"/> <ws:consumer config-ref="web_service_consumer" operation="getcontrolkeydetail" doc:name="web service consumer"/> </flow> </mule>
any appreciated.
thanks reply anirban. have updated code getting "org.apache.cxf.interceptor.fault: could_not_read_xml_stream" error. not sure how set payload
1.put request before <ws:consumer/>
may in set payload component:-
<con:getcontrolkeydetail xmlns:con="http://test.co.nz/controlkeysdetails"> <con:keycode>m2m_in_product_code</con:keycode> </con:getcontrolkeydetail>
2. remove <echo-component/>
after <ws:consumer/>
, replace <mulexml:dom-to-xml-transformer/>
following :-
<flow name="soapwebserviceflow"> <http:listener config-ref="http_listener_configuration" path="/" doc:name="http"/> <ws:consumer config-ref="web_service_consumer" operation="getcontrolkeydetail" doc:name="web service consumer"/> <mulexml:dom-to-xml-transformer doc:name="dom xml"/> </flow>
Comments
Post a Comment