java - How to develop REST and SOAP interface for same web service using MuleSoft? -


right services exposed using rest while using soap. there more 2000 services. requirement expose these in soap 1.2 , rest api (yes both).

i wondering if can take build on integration layer (preferable mulesoft) this. integration layer call services , expose/convert "rest soap" , "soap rest"

flow of call

  1. client makes soap call mulesoft
  2. mulesoft makes rest call actual service
  3. mulesoft receives rest response
  4. mulesoft uses above response , send client soap response

how may achieve above flow in mulesoft? algorithm very helpful.

thanks in advance.

for example: changename(string id, string newname) should called soap as:

<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">    <soapenv:header>     </soapenv:header>    <soapenv:body>       <urn:changename>          <urn:id>1001</urn:id>          <urn:newname>steve jobs</urn:newname>       </urn:changename>    </soapenv:body> </soapenv:envelope> 

and form rest, example

http://www.mywebserviceurl/changename/ post  {id:1001, name:steve jobs} 

soap protocol , rest architectural style. , different in nature.

in usecase, can

  1. you can create mule flow, accept soap request

  2. and can extract value using xpath3 , store in flow variable ,

  3. then create json request actual rest web service using expression transformer reference :- how transform json-to-json document in mule esb,

  4. and post rest service using mule http outbound or request component actual rest service exposed

  5. get json response actual rest service, , parse , extract values using json:json-to-object-transformer, , store value in flow variables

  6. use data mapper or if use mule ce, use xslt create soap response client ref: https://developer.mulesoft.com/docs/display/current/xslt+transformer

the above simple , easiest way create client api/flow in mule accept soap request client , transform json request rest service exposed , post through http actual service.

this way can make mule interface application between soap call , actual rest service

,


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -