E-Mac
2008-Apr-14 23:41 UTC
wrong number of arguments (0 for 1) when calling 0 argument web service call
I created a Ruby client using the following command: wsdl2ruby.rb --wsdl https://fba-inbound.amazonaws.com/doc/2007-05-10/FBAInboundService.wsdl --type client --force Here is how I call the service: @service = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver @service.generate_explicit_type = true @service.wiredump_dev = STDOUT @service.endpoint_url = url begin result = @service.GetServiceStatus() rescue Exception => ex puts "Caught an exception:\n#{ex}" end Here is the relevant part of default.rb (generated by the above command): # {http://fba-inbound.amazonaws.com/doc/2007-05-10/}GetServiceStatus class GetServiceStatus @@schema_type "GetServiceStatus" @@schema_ns = "http://fba-inbound.amazonaws.com/doc/ 2007-05-10/" @@schema_qualified = "true" @@schema_element = [] def initialize end end # {http://fba-inbound.amazonaws.com/doc/ 2007-05-10/}GetServiceStatusResponse class GetServiceStatusResponse @@schema_type = "GetServiceStatusResponse" @@schema_ns = "http://fba-inbound.amazonaws.com/doc/2007-05-10/" @@schema_qualified = "true" @@schema_element = [["getServiceStatusResult", [nil, XSD::QName.new("http://fba-inbound.amazonaws.com/doc/2007-05-10/", "GetServiceStatusResult")]], ["responseMetadata", [nil, XSD::QName.new("http://fba-inbound.amazonaws.com/doc/2007-05-10/", "ResponseMetadata")]]] def GetServiceStatusResult @getServiceStatusResult end def GetServiceStatusResult=(value) @getServiceStatusResult = value end def ResponseMetadata @responseMetadata end def ResponseMetadata=(value) @responseMetadata = value end def initialize(getServiceStatusResult = nil, responseMetadata nil) @getServiceStatusResult = getServiceStatusResult @responseMetadata = responseMetadata end end When I run this I get: Caught an exception: wrong number of arguments (0 for 1) Also, when I try to get clever and call it as follows: result = @service.GetServiceStatus(nil) I can see the response from the web server, but I get the following exception (I believe this is thrown when creating the GetServiceStatusResponse object as the "result" variable above is nil): Caught an exception: private method `sub'' called for nil:NilClass Calls to other methods which have at least one argument work, but I cannot successfully call this 0-argument method and get back the response. Any help is appreciated. Thanks. Eric --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Guterl
2008-Apr-15 03:41 UTC
Re: wrong number of arguments (0 for 1) when calling 0 argument web service call
On Mon, Apr 14, 2008 at 7:41 PM, E-Mac <eric.ott-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I created a Ruby client using the following command: > wsdl2ruby.rb --wsdl https://fba-inbound.amazonaws.com/doc/2007-05-10/FBAInboundService.wsdl > --type client --force > > Here is how I call the service: > > @service = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver > @service.generate_explicit_type = true > @service.wiredump_dev = STDOUT > @service.endpoint_url = url > > begin > result = @service.GetServiceStatus() > rescue Exception => ex > puts "Caught an exception:\n#{ex}" > end > > > > > Here is the relevant part of default.rb (generated by the above > command): > # {http://fba-inbound.amazonaws.com/doc/2007-05-10/}GetServiceStatus > class GetServiceStatus > @@schema_type > "GetServiceStatus" > @@schema_ns = "http://fba-inbound.amazonaws.com/doc/ > 2007-05-10/" > @@schema_qualified = "true" > @@schema_element = [] > > def initialize > end > > end > # {http://fba-inbound.amazonaws.com/doc/ > 2007-05-10/}GetServiceStatusResponse > class GetServiceStatusResponse > @@schema_type = "GetServiceStatusResponse" > @@schema_ns = "http://fba-inbound.amazonaws.com/doc/2007-05-10/" > @@schema_qualified = "true" > @@schema_element = [["getServiceStatusResult", [nil, > XSD::QName.new("http://fba-inbound.amazonaws.com/doc/2007-05-10/", > "GetServiceStatusResult")]], ["responseMetadata", [nil, > XSD::QName.new("http://fba-inbound.amazonaws.com/doc/2007-05-10/", > "ResponseMetadata")]]] > > def GetServiceStatusResult > @getServiceStatusResult > end > > def GetServiceStatusResult=(value) > @getServiceStatusResult = value > end > > def ResponseMetadata > @responseMetadata > end > > def ResponseMetadata=(value) > @responseMetadata = value > > end > def initialize(getServiceStatusResult = nil, responseMetadata > nil) > @getServiceStatusResult = getServiceStatusResult > @responseMetadata = responseMetadata > end > end > > > When I run this I get: > Caught an exception: wrong number of arguments (0 for 1) > > > > > Also, when I try to get clever and call it as follows: > result = @service.GetServiceStatus(nil) > > I can see the response from the web server, but I get the following > exception (I believe this is thrown when creating the > GetServiceStatusResponse object as the "result" variable above is > nil): > Caught an exception: private method `sub'' called for nil:NilClass > > Calls to other methods which have at least one argument work, but I > cannot successfully call this 0-argument method and get back the > response. > > Any help is appreciated. >This would probably be more appropriate for the ruby-talk mailing list. Regards, Michael Guterl --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---