I am experiencing a similar problem, not with gSOAP, but with
Apache''s SOAP library. Just like Guido, XML-RPC works perfectly, but
the SOAP request processing fails during protocol discovery. Rail''s
SOAP client also works perfectly, so I''m fairly certain the error is
not in my code.
I am new to both ActionWebService and the Ruby XMLRPC module, so I''m
not quite sure what is supposed to be going on in
Protocol::Discovery::InstanceMethods#discover_web_service_request.
However, it seems that it expects
Protocol::XmlRpc::XmlRpcProtocol#decode_action_pack_request to return
nil in the case that the request is SOAP rather than throwing the "No
valid method call" exception (see below).
As a quick test, I wrapped the decode_action_pack_request call in a
rescue block, only to get the second exception listed below.
Any help would be appreciated. I plan to use XML-RPC until I have
more time to investigate the issue (sorry Guido!).
Take care,
Matt
Version info (running on Mac OS X, ruby 1.8.2) :
actionwebservice (1.1.2, 0.8.1, 0.8.0, 0.7.1)
Web service support for Action Pack.
rails (1.1.2, 0.13.1, 0.13.0, 0.12.1)
Web-application framework with template engine, control-flow layer,
and ORM.
> Hi!
>
> I''ve successfully created a Rails web service. I can connect to it
> with an XML-RPC client, without any problems at all. However, when I
> try to use a gSOAP application to connect to the web service, it
> doesn''t work. The back trace that I get is at the end of this
> message. From the back trace, it appears that the SOAP request is not
> being recognized as a SOAP request, and is instead being routed to
> the XML RPC protocol handler.
>
> Inspecting discovery.rb shows that things fall over when decoding the
> action pack request. If it tried SOAP first, that wouldn''t be a
> problem. Or if it tried to grok XML RPC and failed, it should have
> fallen back to SOAP?
>
> > def discover_web_service_request(action_pack_request)
> > (self.class.read_inheritable_attribute
> > ("web_service_protocols") || []).each do |protocol|
> > protocol = protocol.create(self)
> > request = protocol.decode_action_pack_request
> > (action_pack_request)
> > return request unless request.nil?
> > end
> > nil
> > end
>
> Ideally, I''d like to specify in environment.rb or in my controller
> that Rails should use SOAP, and never XML RPC. Is that possible? What
> about telling Rails to try SOAP first? Won''t that just bring
problems
> in the inverse situation?
>
> I wish I didn''t have to use gSOAP, but I''m creating the
client for an
> embedded system and can''t run Java, a scripting language or
anything
> that''s not C. Eric Kidds XML-RPC library seems a little too
> heavyweight due to its reliance on libwww. I''d appreciate some
help.
>
> -- G.
RuntimeError (No valid method call - missing method name!):
/usr/lib/ruby/1.8/xmlrpc/parser.rb:478:in `parseMethodCall''
/usr/lib/ruby/1.8/xmlrpc/marshal.rb:63:in `load_call''
/usr/lib/ruby/1.8/xmlrpc/marshal.rb:32:in `load_call''
/usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/
action_web_service/protocol/xmlrpc_protocol.rb:36:in `decode_request''
/usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/
action_web_service/protocol/xmlrpc_protocol.rb:32:in
`decode_action_pack_request''
/usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/
action_web_service/protocol/discovery.rb:21:in
`discover_web_service_request''
/usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/
action_web_service/protocol/discovery.rb:18:in `each''
/usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/
action_web_service/protocol/discovery.rb:18:in
`discover_web_service_request''
/usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/
action_web_service/dispatcher/action_controller_dispatcher.rb:44:in
`dispatch_web_service_request''
(eval):1:in `api''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/base.rb:910:in `send''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/base.rb:910:in `perform_action_without_filters''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/filters.rb:368:in `perform_action_without_benchmark''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/benchmarking.rb:69:in `perform_action_without_rescue''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/benchmarking.rb:69:in `measure''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/benchmarking.rb:69:in `perform_action_without_rescue''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/rescue.rb:82:in `perform_action''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/base.rb:381:in `send''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/base.rb:381:in `process_without_filters''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/filters.rb:377:in
`process_without_session_management_support''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/session_management.rb:117:in `process''
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in
`dispatch''
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:
115:in `handle_dispatch''
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:
81:in `service''
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service''
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''
/usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread''
/usr/lib/ruby/1.8/webrick/server.rb:144:in `start''
/usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread''
/usr/lib/ruby/1.8/webrick/server.rb:94:in `start''
/usr/lib/ruby/1.8/webrick/server.rb:89:in `each''
/usr/lib/ruby/1.8/webrick/server.rb:89:in `start''
/usr/lib/ruby/1.8/webrick/server.rb:79:in `start''
/usr/lib/ruby/1.8/webrick/server.rb:79:in `start''
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:
67:in `dispatch''
script/server:49
NoMethodError (You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.collect):
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/rescue.rb:136:in `clean_backtrace''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/rescue.rb:44:in `log_error''
/usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/
action_web_service/dispatcher/action_controller_dispatcher.rb:67:in
`dispatch_web_service_request''
(eval):1:in `api''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/base.rb:910:in `send''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/base.rb:910:in `perform_action_without_filters''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/filters.rb:368:in `perform_action_without_benchmark''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/benchmarking.rb:69:in `perform_action_without_rescue''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/benchmarking.rb:69:in `measure''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/benchmarking.rb:69:in `perform_action_without_rescue''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/rescue.rb:82:in `perform_action''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/base.rb:381:in `send''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/base.rb:381:in `process_without_filters''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/filters.rb:377:in
`process_without_session_management_support''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/session_management.rb:117:in `process''
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in
`dispatch''
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:
115:in `handle_dispatch''
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:
81:in `service''
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service''
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''
/usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread''
/usr/lib/ruby/1.8/webrick/server.rb:144:in `start''
/usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread''
/usr/lib/ruby/1.8/webrick/server.rb:94:in `start''
/usr/lib/ruby/1.8/webrick/server.rb:89:in `each''
/usr/lib/ruby/1.8/webrick/server.rb:89:in `start''
/usr/lib/ruby/1.8/webrick/server.rb:79:in `start''
/usr/lib/ruby/1.8/webrick/server.rb:79:in `start''
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:
67:in `dispatch''
script/server:49