Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SOAP::Lite and cookies

Status
Not open for further replies.

k5tm

Programmer
Aug 24, 2001
2,038
US
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!
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";
I am getting correct results, but the server is starting two instances of the calculator. The trace confirms this.

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top