gnork has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks!

I would like to use SOAP::Lite to provide the vital parts of our system functionality. However, not everyone is a perl lover. I found the WSDL::Generator on CPAN, which will be a good help on my way to make these SOAP RPC Servers talk to C/C++/PHP/Perl/whatever speaks SOAP.

While trying to figure out, how this works, I became totally confused about Namespace(s), URI, URN etc.pp. Until now there was no need to use these, since this code works under perl:

Server:
# define the routines ... sub return_sumfink { #do something } # and $daemon = SOAP::Transport::HTTP::Daemon -> new(LocalAddr => $host, LocalPort => $port, Reuse => 1) -> dispatch_to('return_sumfink','aFunction') $daemon->handle;
BTW, if you ran out of sockets with SOAP::Lite or had to wait 30secs to start a new SOAP Server (Port already in use), have a look at the Reuse option above.

Client:
$s = SOAP::Lite ->proxy("http://$machine:$port") ->on_fault(sub{}); $r = $s->test_connection; unless (defined $r && defined $r->envelope) { return 'NOGO:', $s->transport->status, "\n"; } return $s->call(@_)->result;
This worked like a charm, but now for the language independend way ... AFAIK, one way to construct the URN is using Namespaces (packages) within the Server. Lets say I defined a package ExternalIO in the server, which contains the sub return_sumfink. NOTE: I have no external modules (e.g. ExternalIO.pm), its within the server.

Now I try to call the function:
use SOAP::Lite +autodispatch => uri=>'ExternalIO', proxy=>'http://localhost:8081'; $hi = return_sumfink('scalar'); print $hi . "\n";
The sub return_sumfink never gets called. Where am I wrong? Is there good reading material about SOAP somewhere out there?

Any hint is appreciated,
TIA
Gnork

cat /dev/world | perl -e "(/(^.*? \?) 42\!/) && (print $1))
errors->(c)

Replies are listed 'Best First'.
Re: SOAP::Lite Confusion
by gnork (Scribe) on Dec 05, 2003 at 09:12 UTC
    Finally solved it, it was a problem with my package declaration. I specified "package do_something" instead of "package modules::do_something". The package entries in the symbol table were invalid, so the subs never got called.

    cat /dev/world | perl -e "(/(^.*? \?) 42\!/) && (print $1))"
    errors->(c)