From: "NAKAMURA, Hiroshi" Date: 2004-03-12T11:19:03+09:00 Subject: Re: SOAP4R newbie question Hi, > From: "Allton, Paul" > Sent: Thursday, March 11, 2004 7:31 PM > I'm trying to access a service that requires users to logon before doing > stuff, my first effort was as follows: > > require 'soap/rpc/driver' > > base = 'http://foo.bar.com/services/' > > logon_service = SOAP::RPC::Driver.new(base + 'LogonService?wsdl', nil) > logon_service.add_method('login', 'username', 'password') > logon_service.login('foo', 'bar') > > do_stuff_service = SOAP::RPC::Driver.new(base + 'DoStuffService?wsdl', nil) > do_stuff_service.add_method('getThing') > do_stuff_service.getThing() > > This logs in to the first service okay, but calls to DoStuffService fail > with 'not logged in'. I assume this is because the login/session details > are maintained by cookies and so I need to invoke both services from the > same driver. Isn't the service a kind of "logging-in with user/passwd to get a session token then passing the token with all methods", is it? When the service uses http-cookies as you mention, you must use http-access2 instead of net/http (net/http does not support http-cookies as a first class), and must call some internal method (not out-of-box support for now). What version are you using? 1. ruby/1.8.1 + bundled soap module 2. ruby/CVS HEAD + bundled soap module 3. soap4r/1.5.2 4. soap4r/CVS HEAD > I just cant figure out how to tell each method to use which service (i.e.. > namespace) ... > > Should I be using add_method_with_soapaction? Yes. Or simply create a new driver. Regards, // NaHi