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

I'm trying to get a Java client and Perl server to pass some information via SOAP and want the server to read a specific node of the client message:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/env +elope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <ns1:findingit xmlns:ns1="urn:emailfind"> <cookie>Cookie_data</cookie> </ns1:findingit></SOAP-ENV:Body> </SOAP-ENV:Envelope>
I've been trying SOAP::Som but to no avail so far to access the cookie element to get the data, play with it and send it back.
#!c:\perl\bin\perl.exe use strict; use warnings; use SOAP::Lite; use SOAP::Transport::HTTP; use HTTP::Cookies; SOAP::Transport::HTTP::CGI ->dispatch_to('emailfind') ->handle; package emailfind; sub findingit { my $som ->match('/Envelope/Header/Body/findingit'); $som ->valueof('/cookie'); my ($e) = split(/-/, $som); $e = pack ("H*", $som); return $e; }
I either get an undefined value error or a null return which causes the client to fail, so assume that it is not reading the stream at all? Is there a better way of parsing the data coming across so that the server can do its job from the request coming towards it? Thanks in advance for any guidance to sorting this out.

Replies are listed 'Best First'.
Re: Accessing a node in a SOAP message from a Java client
by jhourcle (Prior) on Jan 22, 2008 at 17:36 UTC

    Check your web server's error log ... you'll likely find a message about calling a method on an undefined object, as you never declare what $som is.