如何构建肥皂休息网关
您将如何以最少的工作量构建一个肥皂休息网关?我在 Rails 3.2 服务器上提供了 REST API。我的客户要求我提供 SOAP API。我不想使用 Rails 来提供 SOAP API,因为这可能比使用完全支持 SOAP 的框架构建 SOAP 到 REST 网关需要更多的工作。
How would you build a soap to rest gateway with the least amount of work? I provide a REST API on my Rails 3.2 server. My customer requires me to provide a SOAP API. I don't want to use Rails for providing the SOAP API since that would probably take much more work than building a SOAP to REST gateway using a framework that fully supports SOAP.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚注意到 Rails 3.2 自动将 SOAP 请求解析为 params 哈希(ActionDispatch::ParamsParser Rack 中间件)。因此,我决定在 Rails 中实现网关。由于我并不真正关心实现功能齐全的 SOAP 服务器——我想要的只是让它适用于客户当前的 SOAP 客户端——我只需从 params 哈希中读取我需要的数据并构建 xml 响应使用 Builder 并发布静态 wsdl 文件(如果需要)。它将少于 20 行代码。
config/routes.rb
应用程序/控制器/clientx_controller.rb
I just noticed that Rails 3.2 parses SOAP requests automatically into the params hash (ActionDispatch::ParamsParser Rack middleware). So, I decided to implement the gateway in Rails. Since I don't really care to implement a full featured SOAP Server--all I want is to make it work for my customer's current SOAP client--I will just read the data that I need from the params hash and build the xml response using Builder and publish a static wsdl file if they need it. It will be less than 20 lines of code.
config/routes.rb
app/controllers/clientx_controller.rb
Mule ESB 怎么样?支持多种形式的输入和输出可能性。自己基于Mule实现了一个SOAP接收应用程序。
What about Mule ESB? Supports a various form of input and output possibilities. Implemented a SOAP-receiving application based on Mule myself.