2016-03-30 62 views
2

我正在學習Web服務API,所以我在我的Rails應用程序中使用了Savon for SOAP。我似乎無法做一個簡單的操作來獲取提供者的語言列表。我究竟做錯了什麼?無法找到SOAP操作RAILS + SAVON

下面是SOAP請求的鏈接GetLanguages

下面是我對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>' 

薩翁的版本是2.11.1和Rails版本是4.2.6

回答

2

我已經終於搞清楚了。該follwing:

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

本來應該是:

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