savon HTTPI POST EOFError:到达文件末尾



我尝试使用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'

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

感谢

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

  HTTPI.adapter = :net_http

您可以尝试"rest client"。我认为它应该起作用。

相关内容

  • 没有找到相关文章

最新更新