简体   繁体   中英

savon HTTPI POST EOFError: end of file reached

I tried to use the SOAP service using savon v2.0.3 and its throwing error which I am not able to debug.

I have the following code

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

I get the url from config file and its correct and the method_name_in_symbolic_form method also exist.

Now this produce error as shown below:

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'

Whats the reason behind this error.

Thanks

甚至我也有类似的问题,可以通过将HTTPI适配器设置为net_http来解决。

  HTTPI.adapter = :net_http

You can try " rest-client ". I think it should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM