From: barjunk Date: 2007-04-27T09:15:04+09:00 Subject: Re: SOAP problems On Apr 26, 3:38 pm, barjunk wrote: > On Apr 26, 10:46 am, Philipp Taprogge > wrote: > > > > > > Unlikely. The error is pretty obvious: the XML parser encountered an > > element it did not expect in the server's response: . > > > This suggests that the server is not returning an XML document at > > all but rather a normal web page. Perhaps this is a 404 or 500 error > > page? > > In any case, the create_rpc_driver method experts to find a WSDL > > file which the server must provide. > > Perhaps your perl code is not using a wsdl driver? > > > HTH, > > > Phil > > Phil, > > Turns out that you are right, I type-od the url...shoulda been https. > > That was self-inflicted wound. > > Now all I have to do is figure out how to pass some arguments to the > soap call and I'll be moving along. > > The perl is: > > my $login_result = $soap->call('login' => ('username', 'pass'))- > > >result; > > but I haven't figured out to do it with ruby. I have tried: > > irb(main):170:0> p soap.call("login") > "No username passed" > => nil > > Which makes sense, but have no idea how to pass the username and > password. But I'll keep digging! > > Mike B. OK...so here it is. end_point = "https://my.endpoint.com/cgi-bin/ipc-SOAP/" soap = SOAP::RPC::Driver.new(end_point,"urn:/myurn") soap.options['protocol.http.ssl_config.verify_mode'] = OpenSSL::SSL::VERIFY_NONE soap.add_method_with_soapaction('login', 'login', "defaultusername", "defaultpassword") soap.login("realuser","realpass") In my case if use a valid username/pass pair I get a 1, if not, a nil. I'm not really sure what the purpose of putting defaultusername and defaultpassword in the add_method statement above, but I tried "" and " ", neither worked. I had to actuall put string values. For example: soap.add_method_with_soapaction('login', 'login', "a", "b") still worked, but : soap.add_method_with_soapaction('login', 'login', "", "") and soap.add_method_with_soapaction('login', 'login', " ", " ") didn't. Thanks for the feedback. Sure would be great if there was more documentation with the soap4r stuff...where can I submit some? Mike B.