Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

SOAP::Lite Confusion

by gnork (Scribe)
on Dec 02, 2003 at 13:58 UTC ( [id://311616]=perlquestion: print w/replies, xml ) Need Help??

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)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://311616]
Approved by arthas
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-26 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found