--- gdhgdh <gdh@...
Can someone offer assistance because my poor Perl skills are really
showing through here? I have a tiny SOAP::Lite client calling a
method on a SOAP::Lite service, and though I can see all the
elements of the returned array in a Dumper output, I cannot see how
to access it via the SOAP::Lite methods.
use SOAP::Lite +trace=>'debug';
$soap = SOAP::Lite
$soapcall = $soap->getCurrentIP();
@lansettings = $soapcall->result;
print "Current LAN settings:\n\n";
print " IP Address: $lansettings\n";
print " Subnet Mask: $lansettings\n";
print " Default Gateway: $lansettings\n";
Unfortunately, the @lansettings array only has one element.
You're returning an array with your server. ``result'' only returns the first element of this
array (a scalar). ``paramsout'' returns the rest of your output parameters, minus the first
element (if any exist).
To completely rebuild your array, you'll have to do something like this:
@lansettings = ($soapcall->result, $soapcall->paramsout);
@lansettings = $soapcall->paramsall;
This is explained at http://search.cpan.org/~byrne/SOAP-Lite-0.60a/lib/SOAP/Lite.pm#SOAP::SOM
I believe this was also explained in the book "Programming Web Services with Perl". If you don't
have this book, I recommend it (written by Pavel Kulchenko and Randy J. Ray). It's been an
invaluable resource to me thus far. Additionally, you may wish to check out "Programming Web
Services with SOAP" (written by James Snell, Dough Tidwell, and Pavel Kulchenko). Both are
available directly from O'Reilly's Web site: