Forum: Ruby on Rails Problem with Mongrel, Rails and web services using xmlrpc

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Berger, Daniel (Guest)
on 2006-04-21 19:47
(Received via mailing list)
Hi all,

Ruby 1.8.4
Windows XP Pro / Solaris 10
Mongrel 0.3.12
Rails 1.1.2

I've got a fairly simple and straightforward layered dispatching web
service setup for my Rails app.  This simple xmlrpc script works fine
with WEBrick, but chokes on Mongrel.  Is there anything special I need
to do to make web services work with Mongrel and Rails?  Some Google
searching indicates that there had been some xmlrpc issues in the past
with Mongrel but I thought they were worked out.

Anyway, here's the script and error:

# xmlrpctest.rb
require 'xmlrpc/client'
rpc = XMLRPC::Client.new('localhost', 'http://localhost/webservice/api',
3000)
rpc.call('hardware.FindHardwareById', 2)

c:/ruby/lib/ruby/1.8/net/protocol.rb:133:in `sysread': Invalid argument
(Errno::EINVAL)
        from c:/ruby/lib/ruby/1.8/net/protocol.rb:133:in `rbuf_fill'
        from c:/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout'
        from c:/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout'
        from c:/ruby/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill'
        from c:/ruby/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
        from c:/ruby/lib/ruby/1.8/net/protocol.rb:126:in `readline'
        from c:/ruby/lib/ruby/1.8/net/http.rb:1988:in `read_status_line'
        from c:/ruby/lib/ruby/1.8/net/http.rb:1977:in `read_new'
        from c:/ruby/lib/ruby/1.8/net/http.rb:1046:in `request'
        from c:/ruby/lib/ruby/1.8/net/http.rb:1033:in `request'
        from c:/ruby/lib/ruby/1.8/net/http.rb:545:in `start'
        from c:/ruby/lib/ruby/1.8/net/http.rb:1031:in `request'
        from c:/ruby/lib/ruby/1.8/net/http.rb:988:in `post2'
        from c:/ruby/lib/ruby/1.8/xmlrpc/client.rb:535:in `do_rpc'
        from c:/ruby/lib/ruby/1.8/xmlrpc/client.rb:420:in `call2'
        from c:/ruby/lib/ruby/1.8/xmlrpc/client.rb:410:in `call'
        from xmlrpctest.rb:13
8c43ed7f065406bf171c0f3eb32cf615?d=identicon&s=25 Zed Shaw (Guest)
on 2006-04-21 20:27
(Received via mailing list)
On 4/21/06 1:44 PM, "Berger, Daniel" <Daniel.Berger@qwest.com> wrote:

> to do to make web services work with Mongrel and Rails?  Some Google
> searching indicates that there had been some xmlrpc issues in the past
> with Mongrel but I thought they were worked out.
>
> Anyway, here's the script and error:
>

Are you inside a Rails controller/action and then trying to connect back
to
the same Rails application via xmlrpc?  Mongrel has to lock Rails to
keep it
sane, so if you're inside a Rails app, and then connect back to the same
app
via HTTP you'll get a dead-lock.

Also, can you run your setup with "mongrel_rails start -B" and see what
headers are being dumped in the log/mongrel_debug/rails.log?

Finally, can you shoot me the other half of the sample or a simplified
xml-rpc rails test case?  With that I can run it through and make sure
it
always works with Mongrel in the future.

Zed A. Shaw
http://www.zedshaw.com/
http://mongrel.rubyforge.org/
This topic is locked and can not be replied to.