Using SOAP and other Standard Libraries in Ruby 1.9.2

ぐ巨炮叔叔 提交于 2019-11-30 05:49:09
Seamus Abshere

If you want to keep using Ruby 1.8's standard soap library (aka soap4r), you can try https://github.com/spox/soap4r-spox ...

wget --no-check-certificate https://github.com/spox/soap4r-spox/tarball/1.5.8.4
tar -xzf spox-soap4r-spox-1.5.8.4-0-g345a6cb.tar.gz
cd spox-soap4r-spox-345a6cb/
ruby setup.rb all

If you're using rvm, don't sudo the last command... instead su into root and rvm to ruby 1.9 so that setup.rb puts the files into the right place.

$ irb
ruby-1.9.2-p0 > require 'soap/rpc/driver'
 => true 
ruby-1.9.2-p0 > require 'xsd/qname'
 => false 
ruby-1.9.2-p0 > require 'soap/wsdlDriver'
 => true 
ruby-1.9.2-p0 > require 'fileutils'
 => true 

As suggested by other StackOverflow answers, you might want to switch to a gem like savon.

https://rubygems.org/gems/soap4r-ruby1.9

gem install soap4r-ruby1.9

This gem solved most of my soap related issues with ruby 1.9

if you are trying rails 3 update your gem file with

gem 'soap4r', :git => 'git://github.com/felipec/soap4r.git'

this is updated with fix.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!