Forum: Ruby SOAP4R WSDL Factory is horked! Anyone want to comment on wh

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.
6a657bbaaa704aa1fc7dfa6d680c06fc?d=identicon&s=25 bluengreen (Guest)
on 2007-04-20 00:41
(Received via mailing list)
Hello,

I spent hours trying to find  a solution to why some basic code that
was actually pulled directly from page 630 of the O'Reilly Ruby
Cookboook.

require 'soap/wsdlDriver'
wsdl = 'http://services.xmethods.net/soap/urn:xmethods-delayed-
quotes.wsdl'
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
puts 'Stock Price: %.2f' % driver.getQuote('TR')

Why would this not work as expected on a Fedora Core 5 box? I get this
error:

/usr/lib/ruby/1.8/net/http.rb:562:in `initialize': Connection refused
- connect(2) (Errno::ECONNREFUSED)
        from /usr/lib/ruby/1.8/net/http.rb:562:in `connect'
        from /usr/lib/ruby/1.8/timeout.rb:48:in `timeout'
        from /usr/lib/ruby/1.8/timeout.rb:76:in `timeout'
        from /usr/lib/ruby/1.8/net/http.rb:562:in `connect'
        from /usr/lib/ruby/1.8/net/http.rb:555:in `do_start'
        from /usr/lib/ruby/1.8/net/http.rb:544:in `start'
        from /usr/lib/ruby/1.8/soap/netHttpClient.rb:115:in `start'
        from /usr/lib/ruby/1.8/soap/netHttpClient.rb:92:in `post'
        from /usr/lib/ruby/1.8/soap/streamHandler.rb:170:in
`send_post'
        from /usr/lib/ruby/1.8/soap/streamHandler.rb:109:in `send'
        from /usr/lib/ruby/1.8/soap/rpc/proxy.rb:170:in `route'
        from /usr/lib/ruby/1.8/soap/rpc/proxy.rb:141:in `call'
        from /usr/lib/ruby/1.8/soap/rpc/driver.rb:178:in `call'
        from /usr/lib/ruby/1.8/soap/rpc/driver.rb:232:in `getQuote'
        from soap_test.rb:17

Its so basic. And yet it seems like there is no one other than myself
getting this error. At least I can't find a single peep from anything
on Google.

Thanks,
Phill
Ac0085dae0703db56ad7f8cb9e1798ba?d=identicon&s=25 Phillip Gawlowski (Guest)
on 2007-04-20 00:57
(Received via mailing list)
bluengreen wrote:
> puts 'Stock Price: %.2f' % driver.getQuote('TR')
>         from /usr/lib/ruby/1.8/net/http.rb:555:in `do_start'
>         from soap_test.rb:17
>
> Its so basic. And yet it seems like there is no one other than myself
> getting this error. At least I can't find a single peep from anything
> on Google.

Read the error message you posted. Your connection is refused in the
first place.

irb(main):001:0> require 'soap/wsdlDriver'
=> true
irb(main):002:0> wsdl =
'http://services.xmethods.net/soap/urn:xmethods-del...
=> "http://services.xmethods.net/soap/urn:xmethods-del...
irb(main):003:0> driver =
SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
=>
#<SOAP::RPC::Driver:#<SOAP::RPC::Proxy:http://38.102.129.128:9090/soap>>
irb(main):004:0> puts 'Stock Price: %.2f' % driver.getQuote('TR')
Stock Price: 29.81
=> nil
irb(main):005:0> VERSION
=> "1.8.5"
irb(main):007:0> Time.now
=> Fri Apr 20 00:55:53 +0200 2007


--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan.110mb.com/
http://clothred.rubyforge.org

Rule of Open-Source Programming #15:

If you like it, let the author know. If you hate it, let the author
know why.
6a657bbaaa704aa1fc7dfa6d680c06fc?d=identicon&s=25 bluengreen (Guest)
on 2007-04-20 16:17
(Received via mailing list)
On Apr 19, 4:55 pm, Phillip Gawlowski <cmdjackr...@googlemail.com>
wrote:
> > driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
> >         from /usr/lib/ruby/1.8/net/http.rb:562:in `connect'
> >         from /usr/lib/ruby/1.8/soap/rpc/driver.rb:232:in `getQuote'
> => true
> => "1.8.5"
> irb(main):007:0> Time.now
> => Fri Apr 20 00:55:53 +0200 2007
>
> --
> Phillip "CynicalRyan" 
Gawlowskihttp://cynicalryan.110mb.com/http://clothred.rubyforge.org
>
> Rule of Open-Source Programming #15:
>
> If you like it, let the author know. If you hate it, let the author
> know why.

Thanks I just tested on another machine at home and found that you are
right. It works fine. Its the firewall at work thats causing the
problems. The thing that confused me was the non-wsdl version works
fine. If I do it like this it will work fine behind our work firewall
-

require 'soap/rpc/driver'
driver = SOAP::RPC::Driver.new('http://services.xmethods.net/soap/',
'urn:xmethods-delayed-quotes')
driver.add_method('getQuote', 'symbol')
puts 'Stock Price: %.2f' % driver.getQuote('TR')

So that confused me. But I just noticed running through IRB that the
WSDL redirects to a different port. We block all ports except for 22,
23, and 80.

Thanks for pointing that out. It was driving me crazy trying to make
that work.

- Phill
This topic is locked and can not be replied to.