From: Lee on
> Yes, I got your example running with "setClass".
>
> I used this server:http://www.jsp-hotel.dk/test/soappersistence-setClass.php
> (source:http://www.jsp-hotel.dk/test/soappersistence-setClass.txt)
>
> with this client:http://www.jsp-hotel.dk/test/soapclient.php
> (source:http://www.jsp-hotel.dk/test/soapclient.txt)

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 (http://groups.google.com/group/
comp.lang.php/browse_thread/thread/7657d5bf882f287b/
4f89ac2542e7ba7c#4f89ac2542e7ba7c)

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
together.
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($response,$value);

my $soap = SOAP::Lite
-> uri('http://mgip2.biology.gatech.edu')
-> proxy('http://mgip2.biology.gatech.edu/api/apiServer4.php')
;

$response=$soap->subtractOne;
$response=$soap->subtractOne;
$response=$soap->subtractOne;
print valueToString($response);

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