savon HTTPI POST EOFError:到达文件结尾

时间:2013-06-25 12:52:06

标签: ruby-on-rails eof savon httpi

我尝试使用savon v2.0.3的SOAP服务及其无法调试的抛出错误。

我有以下代码

client = Savon.client(wsdl: $APP_CONFIG["billing_url"])
response = client.call({{method_name_in_symbolic_form}}, message: {:numbers => "50608289"})

我从配置文件中获取了url并且它正确,并且method_name_in_symbolic_form方法也存在。

现在这会产生错误,如下所示:

EOFError: end of file reached
    from /Users/ckgagan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/protocol.rb:141:in `read_nonblock'
    from /Users/ckgagan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/protocol.rb:141:in `rbuf_fill'
    from /Users/ckgagan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
    from /Users/ckgagan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
    from /Users/ckgagan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
    from /Users/ckgagan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
    from /Users/ckgagan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request'
    from /Users/ckgagan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
    from /Users/ckgagan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
    from /Users/ckgagan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:1293:in `request'
    from /Users/ckgagan/.rvm/gems/ruby-1.9.3-p327@prime2_gemset/gems/httpi-2.0.2/lib/httpi/adapter/net_http.rb:33:in `block in request'
    from /Users/ckgagan/.rvm/gems/ruby-1.9.3-p327@prime2_gemset/gems/httpi-2.0.2/lib/httpi/adapter/net_http.rb:55:in `block in do_request'
    from /Users/ckgagan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/net/http.rb:745:in `start'
    from /Users/ckgagan/.rvm/gems/ruby-1.9.3-p327@prime2_gemset/gems/httpi-2.0.2/lib/httpi/adapter/net_http.rb:54:in `do_request'
    from /Users/ckgagan/.rvm/gems/ruby-1.9.3-p327@prime2_gemset/gems/httpi-2.0.2/lib/httpi/adapter/net_http.rb:31:in `request'
    from /Users/ckgagan/.rvm/gems/ruby-1.9.3-p327@prime2_gemset/gems/httpi-2.0.2/lib/httpi.rb:137:in `request'
    from /Users/ckgagan/.rvm/gems/ruby-1.9.3-p327@prime2_gemset/gems/httpi-2.0.2/lib/httpi.rb:109:in `post'
    from /Users/ckgagan/.rvm/gems/ruby-1.9.3-p327@prime2_gemset/gems/savon-2.0.3/lib/savon/request.rb:29:in `call'
    from /Users/ckgagan/.rvm/gems/ruby-1.9.3-p327@prime2_gemset/gems/savon-2.0.3/lib/savon/operation.rb:47:in `call'
    from /Users/ckgagan/.rvm/gems/ruby-1.9.3-p327@prime2_gemset/gems/savon-2.0.3/lib/savon/client.rb:36:in `call'

这个错误背后的原因是什么。

由于

2 个答案:

答案 0 :(得分:1)

即使我遇到了类似的问题,也可以通过将HTTPI适配器设置为net_http来解决它。

  HTTPI.adapter = :net_http

答案 1 :(得分:-1)

您可以尝试“rest-client”。我认为它应该有用。