From: Lee on
> Yes, I got your example running with "setClass".
> I used this server:
> (source:
> with this client:
> (source:

Jonathan, you have been very helpful. Thank you! This example
works. However, I cannot get it to work in a client Perl Soap::Lite
script (which is my ultimate goal). I will CC comp.lang.perl.misc to
continue this conversation. The first part of this conversation can
be found at comp.lang.php (

Basically, I want to use a PHP Soap Server with a Perl client script.
Above is Jonathan's example PHP server and client that work
Below is the Perl script that works, but it does not keep the session
alive I think. In other words, it is not maintaining a class variable
between soap calls.

use strict;
use warnings;
use Data::Dumper;
use SOAP::Lite;# on_debug => sub{print@_};


my $soap = SOAP::Lite
-> uri('')
-> proxy('')

print valueToString($response);

# put the response's value into a string
sub valueToString{
my $value=$response->faultstring||$response->result||"";
if(ref($value) eq "HASH"){
# get all keys and values from hash
my $str="";
$str.="$k=>$v, ";
elsif(ref($value) eq "ARRAY"){
# join the array
$value=join(" ",@$value);
return $value;