Using SOAP and other Standard Libraries in Ruby 1.9.2

后端 未结 3 1718
执笔经年
执笔经年 2020-12-29 16:41

So, I recently upgraded to 1.9.2 Ruby, having used 1.8.7 for forever (I wanted to try out Rails 3).

The BIGGEST problem I\'m having is that none of my SOAP require

3条回答
  •  独厮守ぢ
    2020-12-29 17:31

    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.

提交回复
热议问题