I am attempting to write a simple web services client to demonstrate the language independence of web services.
My server is a simple four function calculator that returns a cookie so that the same calculator instance is invoked. Unfortunately, my simple client is not returning the cookie (despite documentation to the contrary in SOAP::Lite).
Help, please!
I am getting correct results, but the server is starting two instances of the calculator. The trace confirms this.
Tom Morrison
My server is a simple four function calculator that returns a cookie so that the same calculator instance is invoked. Unfortunately, my simple client is not returning the cookie (despite documentation to the contrary in SOAP::Lite).
Help, please!
Code:
use HTTP::Cookies;
use SOAP::Lite;
use SOAP::Lite +trace;
my $cookies = HTTP::Cookies->new(autosave => 1, ignore_discard => 1);
my $soap = SOAP::Lite
->proxy ('[URL unfurl="true"]http://localhost/xbis10/samples/sample3/calculator.srf');[/URL]
my $service = $soap
->schema ('[URL unfurl="true"]http://localhost/xbis10/samples/sample3/calculator.srf');[/URL]
$soap->transport->cookie_jar($cookies);
my $addResult = $service->Add("3", "4");
print "My add result is $addResult\n";
$cookies->save('afteradd.txt');
$cookies->load('afteradd.txt');
my $divResult = $service->Divide("10", "3");
print "My divide result is $divResult\n";
Tom Morrison