How to convert SOAP web service to REST web service in Mule

若如初见. 提交于 2019-12-09 19:31:28

问题


I would like to convert SOAP ws to REST. Is there any elegant solution to this problem?

REST should take input in json format.

{key:value}

This json should be put inside Body/Order/data tags:

<soapenv:Body>
  <myApp:Order>
    <data>{key:value}</data>
  </myApp:Order>
</soapenv:Body>

回答1:


I guess Mule ESB should be best in doing this.

Step 1 : You can expose a rest service via http endpoint which should accept your JSON.

Step 2: Then a Custom Transformer can be used to prepare the SOAP request for the SOAP service which needs to be called.

Step 3: OutBound Call to SOAP Web-Service

Step 4: Transformer to convert your SOAP Response from previous out-bound call to JSON response.

The response will be sent back to the client which calle dthe Rest Endpoint.

Hope this helps :)




回答2:


It may be too late to answer this question but it worth to have look on strongloop and its loopback-soap-connector. Check This out this article Soap into apis with loopback-node-js. You can Extend a model to wrap/mediate SOAP operations. It works like a charm and with very reliable performance!




回答3:


For asp.net/ Visual Studio, you need to do File --> New Project --> Select Online from the left panel --> You will find Soap to Rest Converter

I hope that will work.




回答4:


If you wish to call a SOAP Web service using a REST web service, please read this article at https://www.wsdltophp.com/Blog/Call-any-SOAP-Web-service-using-a-REST-Web-service



来源:https://stackoverflow.com/questions/16914842/how-to-convert-soap-web-service-to-rest-web-service-in-mule

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!