From: David Ross Date: 2004-11-12T22:51:55+09:00 Subject: Re: Using .NET web service with soap4r Roland Schmitt wrote: >Hello, > >i try to call a ASP.NET based web service with soap4r. >The call is successful, this means no error is thrown in ruby nor in the web service. The problem is that the value returned is not as expected. > >I cut i down to the following: > >This is what soap4r sends: > > > > > > Roland > > > > >This is what the service returns: >... >Hello, >... > >This is what i expect: >... >Hello, Roland > >If i remove the namespace definition (ns1) by hand in the soap4r call, e.g. > > > > > Roland > > > >i get the correct answer. > >Here is my ruby code: >require "soap/rpc/driver" > >include SOAP::RPC > >class Test > def initialize() > driver = SOAP::RPC::Driver.new('http://localhost:8070/PingService/PingService.asmx','http://localhost/PingService/') > driver.allow_unqualified_element=true > driver.add_method_with_soapaction('SayHello','http://localhost/PingService/SayHello','name') > puts("Ergebnis: ", driver.SayHello("Roland")) > end >end >Test.new > >Any hints? > >Regards, >Roland > > > > I've never used soap4r with ASP.NET services, but I believe there might be a missing encoding setting for ASPDotNet. try.. require "soap/rpc/driver" include SOAP::RPC class Test def initialize() driver = SOAP::RPC::Driver.new('http://localhost:8070/PingService/PingService.asmx','http://localhost/PingService/') driver.default_encodingstyle = SOAP::EncodingStyle::ASPDotNetHandler::Namespace driver.allow_unqualified_element=true driver.add_method_with_soapaction('SayHello','http://localhost/PingService/SayHello','name') puts("Ergebnis: ", driver.SayHello("Roland")) end end Test.new David Ross -- Hazzle free packages for Ruby? RPA is available from http://www.rubyarchive.org/