A
Alasdair Allan
Sascha said:I`ve a Hashtable containing several Hashtables and I want to send this to
a server using SOAP::Lite, but the problem is that I don`t know how to
serialize and deserialize the data...
Well you can just do it this way...
Sending,
my $soap = new SOAP::Lite();
$soap->uri( $urn );
$soap->proxy( $endpoint );
eval { $result = $soap->method( %hash ); };
if ( $@ ) {
print "Error: $@";
exit;
}
unless ( $result->fault() ) {
print "Result: " . $result->result() . "\n";
} else {
print "Fault: " . $result->faultstring() . "\n";
}
and then recieving,
sub method {
my $self = shift;
my %hash = @_;
foreach my $key ( sort keys % hash ) {
print "$key = $hash{$key}\n";
}
return SOAP:ata->name('return', 'ACK')->type('xsd:string');
}
I'm not sure why you're trying to concern yourself with serialisaton and
deserialisation? Are you calling an RPC style service, or a document
literal style service? If its an RPC style serice the above code will
do what you want, and SOAP::Lite will take care of the messy details for
you...
Al.