使用 Savon gem 在 Ruby 中使用 SOAP 服务
我正在尝试使用 Savon gem 来使用 SOAP 服务,但遇到困难。我已经使用soapUI 访问了SOAP 服务并且工作正常。
我的代码:
require 'rubygems'
require 'savon'
# Client instance with a WSDL endpoint
client = Savon::Client.new "http://realtime.nationalrail.co.uk/ldbws/wsdl.aspx"
p client.wsdl.namespace_uri
p client.wsdl.soap_actions
response = client.get_arrival_board
我收到的错误:
D, [2010-07-13T11:38:58.967684 #3909] DEBUG -- : Retrieving WSDL from: http://realtime.nationalrail.co.uk/ldbws/wsdl.aspx
"http://thalesgroup.com/RTTI/2008-02-20/ldb/"
[]
/home/abcb293/.gem/ruby/1.8/gems/savon-0.7.9/lib/savon/client.rb:92:in `method_missing': undefined method `get_arrival_board' for #<Savon::Client:0xb7597218> (NoMethodError)
from natrail.rb:11
感谢任何帮助。
I am trying to consume a SOAP service using the Savon gem but having difficulty. I have accessed the SOAP service using soapUI and it works fine.
My code:
require 'rubygems'
require 'savon'
# Client instance with a WSDL endpoint
client = Savon::Client.new "http://realtime.nationalrail.co.uk/ldbws/wsdl.aspx"
p client.wsdl.namespace_uri
p client.wsdl.soap_actions
response = client.get_arrival_board
The error I am getting:
D, [2010-07-13T11:38:58.967684 #3909] DEBUG -- : Retrieving WSDL from: http://realtime.nationalrail.co.uk/ldbws/wsdl.aspx
"http://thalesgroup.com/RTTI/2008-02-20/ldb/"
[]
/home/abcb293/.gem/ruby/1.8/gems/savon-0.7.9/lib/savon/client.rb:92:in `method_missing': undefined method `get_arrival_board' for #<Savon::Client:0xb7597218> (NoMethodError)
from natrail.rb:11
Appreciate any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有你需要通过的所有数据,所以我无法对此进行测试。这段代码很可能是一个问题,但至少它会让你走上正确的道路。希望有帮助。
I don't have all the data you need to pass so I couldn't test this. May very well be an issue with this code but at least it will put you on the right path. Hope it helps.