简体   繁体   中英

SOAP REQUEST USING Savon Gem

I have savon version =>1

and my code is here

require 'savon'
 client = Savon::Client.new "http://midoffice.makemytrip.com/MMT_Webs_CreateIncident/MMT_Webs_CreateIncident.asmx"
response = client.do_simple do |soap|
 soap.body = {
  :FirstName =>"ravendra"
 }
end

and it gives us

undefined method `do_simple' for #<Savon::Client:0xb6c87178>

You need to call a request method as parameter as method you want to call as like below.

   require 'savon'
 client = Savon::Client.new "http://abc.com"
response = client.request :do_simple do
 soap.body = {
  :FirstName =>"ravendra"
 }
end

This http://fagiani.github.io/savon/ helps you.

You are trying to call do_simple SOAP action on http://abc.com . Are you sure this action is there in WSDL?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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