Forum: Ruby on Rails SOAP service - perl server, ruby consumer incompatability

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
F2ca3d0c2f322238910c91b9ec656a99?d=identicon&s=25 Elina Law (Guest)
on 2006-04-27 09:48
(Received via mailing list)
Hi All,

Wonder if any of you guys can help troubleshoot the following for me.

What I'm trying to achieve is:
1) Perl web service, using SOAP::Lite (server)
2) Ruby web service consumer, using SOAP::RPC::DRIVER (client)

My problem is, if my client and server are both Perl based, the
output is as expected.  However, if the client is Ruby based (haven't
tried another language), it gets an error.

I have three files.  Two on the server side and one on the client side.

*Server Side*
First, the script.
=== cgi script - located in c:/apache/cgi-bin/misc/ ===
#!C:/perl/bin/perl.exe -w

use strict;
use SOAP::Transport::HTTP;
use OdbcBridgeServer;

my $name = shift;

    -> dispatch_to('OdbcBridgeServer')
    -> handle;
=== end cgi script ===

Secondly, the Perl server side module (this is a cut down version).
=== module file - located in c:/perl/lib/ ===
package OdbcBridgeServer;

use DBI;
use strict;

sub new
    my $type = shift(@_);
    my $class = ref($type) || $type;
    my $self = {
                   class => $class,
                   sql => shift,

    bless ($self, $class);


sub set_sql()
    my $self = shift(@_);
    my $sql = shift(@_) || "Select * from stock_master";

    return "" if !($sql =~ /^select/i);

    $self->{sql} = $sql;

=== end module file ===

*Client Side*
The third file is the client.
=== client script - on /Users/elinalaw/src/odbcBridgeClient.rb ===
require 'soap/rpc/driver'

    ENDPOINT = 'http://elina/cgi-bin/misc/'
    NAMESPACE = 'http://elina/cgi-bin/misc/OdbcBridgeServer'
    ob =, NAMESPACE)
    ob.add_rpc_method('set_sql', 'a_string')
rescue Exception => ex
    puts "first block"
    puts ex

begin"set_sql", "select * from cre_master")
rescue Exception => ex
    puts "second block"
    puts ex
=== end client script ===

When I run the programme, the output was:
=== start output ===
RubyMate r2903 running Ruby v1.8.3.
 >>> ~/src/odbcBridgeClient.rb

second block
Failed to access class (cgi-bin::misc::OdbcBridgeServer) at C:/Perl/
site/lib/SOAP/ line 2131.
Program exited normally.
=== end output ===

What's the best way to find out what requests/responses are going
between the client and server?

Thanks all,
E0c987f680cd640c14912ebfbf0f0f07?d=identicon&s=25 unknown (Guest)
on 2006-04-27 22:37
(Received via mailing list)
>     puts ex
> end
> . . .
> What's the best way to find out what requests/responses are going
> between the client and server?

>From the Ruby end:
    ob.wiredump_dev = STDERR
will dump to standard error; there is probably something similar on
the Perl end.

Also, a sniffer such as tcpdump or Ethereal can be used; Ethereal's
follow TCP
stream feature is quite nice.
This topic is locked and can not be replied to.