简体   繁体   English

如何在Rails应用程序中处理肥皂数据?

[英]How to process soap data in rails app?

I wanna process soap data in my rails app, requirements is like this: 3rd party app connect to my app and post the soap data using http protocol, then in my controller, my app has to parse these soap data, store them and then send the result to the requestor using soap format. 我想在我的Rails应用程序中处理肥皂数据,要求是这样的:第三方应用程序连接到我的应用程序并使用http协议发布肥皂数据,然后在我的控制器中,我的应用程序必须解析这些肥皂数据,将其存储然后发送结果以肥皂格式发送给请求者。 Now the problem is I do not know how to deal these in my controller. 现在的问题是我不知道如何在控制器中处理这些问题。 Which gem shoud I used? 我使用了哪种宝石? wash_out or sovan?? wash_out还是sovan? Could someone give a detail example? Thanks for helping. 有人可以举一个详细的例子吗?谢谢您的帮助。

I'm not a fan of using SOAP, but there are a lot of documentation on internet, like this 我不使用SOAP的粉丝,但也有大量的文档资料的互联网上,像这样

Basically you need to include the next code in your model 基本上,您需要在模型中包含下一个代码

def initialize(zip)
    client = Savon::Client.new("http://theserver.com?WSDL")
    response = client.request :web, :info, body:{"foo" => foo}
    if response.success?
        #do code
    end
end

This railscast haves a good explanation too. 这个栏杆也有很好的解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM