0

在soap4r gem的帮助下,我编写了ruby代码来访问magento核心api。当我运行代码时,它运行良好,但问题是它应该给出大量的肥皂警告。

/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/xsd/charset.rb:13: warning: variable $KCODE is no longer effective
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/property.rb:68: warning: encoding option is ignored - u
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/property.rb:69: warning: encoding option is ignored - u
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/property.rb:70: warning: encoding option is ignored - u
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key

我收到了上述警告。所以有人告诉我如何隐藏这些警告。谢谢。

4

3 回答 3

1

soap4r 在 Ruby 1.9 中存在许多已知问题。您应该考虑使用较新的 SOAP 工具包之一,例如savonhandsoap

于 2011-06-01T13:32:53.997 回答
0

考虑使用soap4r-spox gem

于 2011-06-24T04:16:57.120 回答
0

您只需设置$VERBOSE=nil,所有警告都会消失。

于 2012-08-20T17:04:18.670 回答