Forum: Ruby on Rails gSOAP and ActionWebService interop problems

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Guido S. (Guest)
on 2006-01-07 21:37
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.

Processing FeePaymentsController#api (for 10.0.0.5 at 2006-01-06
23:26:39) [POST]
  Parameters:
{"<SOAP-ENV:Envelope><SOAP-ENV:Body><n1:FindStudent><student_id>0</student_id></n1:FindStudent></SOAP-ENV:Body></SOAP-ENV:Envelope>"=>"",
"action"=>"api", "controller"=>"fee_payments"}


RuntimeError (No valid method call - missing method name!):
    /opt/local/lib/ruby/1.8/xmlrpc/parser.rb:478:in `parseMethodCall'
    /opt/local/lib/ruby/1.8/xmlrpc/marshal.rb:63:in `load_call'
    /opt/local/lib/ruby/1.8/xmlrpc/marshal.rb:32:in `load_call'
    /opt/local/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/protocol/xmlrpc_protocol.rb:36:in
`decode_request'
    /opt/local/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/protocol/xmlrpc_protocol.rb:32:in
`decode_action_pack_request'
    /opt/local/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/protocol/discovery.rb:20:in
`discover_web_service_request'
    /opt/local/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/protocol/discovery.rb:18:in
`each'
    /opt/local/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/protocol/discovery.rb:18:in
`discover_web_service_request'
    /opt/local/lib/ruby/gems/1.8/gems/actionwebservice-1.0.0/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:44:in
`dispatch_web_service_request'
    (eval):1:in `api'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:in
`send'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:in
`perform_action_without_filters'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/filters.rb:332:in
`perform_action_without_benchmark'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
`measure'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/rescue.rb:82:in
`perform_action'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:in
`send'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:in
`process_without_session_management_support'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session_management.rb:116:in
`process'
    /opt/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in
`dispatch'
This topic is locked and can not be replied to.