Pledges
Pledges

Reputation: 83

Unable to find SOAP operation RAILS + SAVON

I am learning the Web Service API, so I'm using Savon for SOAP on my rails app. I cant seem to do a simple operation as getting a list of languages from the provider. What am I doing wrong?

Here is a link to SOAP request GetLanguages

Below is my code on irb:

2.1.2 :001 > require 'savon'
 => true 
2.1.2 :002 > soap_wsdl = "https://www.betamobi.tym2sell.co.bw/service/portalservice.asmx"
 => "https://www.betamobi.tym2sell.co.bw/service/portalservice.asmx"
2.1.2 :003 > client = Savon.client(wsdl: soap_wsdl)
2.1.2 :004 > response = client.call(:get_languages)
Savon::UnknownOperationError: Unable to find SOAP operation: :get_languages
Operations provided by your service: []
from /home/sifiso/.rvm/gems/ruby-2.1.2/gems/savon-2.11.1/lib/savon/operation.rb:23:in `ensure_exists!'
from /home/sifiso/.rvm/gems/ruby-2.1.2/gems/savon-2.11.1/lib/savon/operation.rb:15:in `create'
from /home/sifiso/.rvm/gems/ruby-2.1.2/gems/savon-2.11.1/lib/savon/client.rb:32:in `operation'
from /home/sifiso/.rvm/gems/ruby-2.1.2/gems/savon-2.11.1/lib/savon/client.rb:36:in `call'
from (irb):99
from /home/sifiso/.rvm/rubies/ruby-2.1.2/bin/irb:11:in `<main>'

Savon version is 2.11.1 and Rails version is 4.2.6

Upvotes: 2

Views: 1244

Answers (1)

Pledges
Pledges

Reputation: 83

I've finally figured it out. The follwing:

soap_wsdl = "https://www.betamobi.tym2sell.co.bw/service/portalservice.asmx"

Should have been:

soap_wsdl = "https://www.betamobi.tym2sell.co.bw/service/portalservice.asmx?wsdl"

Upvotes: 3

Related Questions