如何在Mule中将SOAP Web服务转换为REST Web服务 [英] How to convert SOAP web service to REST web service in Mule

查看:357
本文介绍了如何在Mule中将SOAP Web服务转换为REST Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将SOAP ws转换为REST.有没有解决这个问题的好方法?

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

REST应该以json格式接受输入.

REST should take input in json format.

{key:value}

此json应该放在Body/Order/data标记内

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

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

推荐答案

我认为Mule ESB应该是最好的选择.

I guess Mule ESB should be best in doing this.

第1步:您可以通过http终结点公开一个REST服务,该终结点应该接受您的JSON.

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

第2步:然后可以使用Custom Transformer来为需要调用的SOAP服务准备SOAP请求.

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

第3步:对SOAP Web服务的出站调用

Step 3: OutBound Call to SOAP Web-Service

第4步:转换器将您的SOAP响应从先前的出站调用转换为JSON响应.

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.

希望这会有所帮助:)

这篇关于如何在Mule中将SOAP Web服务转换为REST Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆