|Keep It Simple, Stupid|
Problem with SOAP::Lite moduleby oldwarrior32 (Sexton)
|on Jun 07, 2012 at 03:43 UTC||Need Help??|
oldwarrior32 has asked for the
wisdom of the Perl Monks concerning the following question:
Hi. I would like to ask for your wisdom. I hope if you can guide me. If not, it's OK :)(is an oscure topic presented by a noob and with not low level details).
I need to connect to some machines using SOAP protocol, the idea is to connect to one machine, get the data, connect to the next machine, get the data and so on. I am using a foreach loop when in each loop i change the IP address.
I can connect to one machine at once and get the data, but using the loop in the second iteration I got an error.
That code works just fine. But when I add a loop to iterate a pool of IP addresses i got the error.
The error is this:
SOAP::Transport::HTTP::Client::send_receive: 500 Status read failed: invalid argument
Status read failed: Invalid argument at C:/strawberry /perl/site/lib/Net/HTTP/Methods.pm line 269. 500 Status read failed: Invalid argument. at cm.pl lin e 41
Line 41 is:$res = $cm->listPhoneByName($test->name("searchString" => "%"));
I think is some low level thing, since if I run the same program, once a time, but with a different IP address I got the data from the 3 machines.
In other words, the program is this: start a TCP session using SOAP destined to IP address 10.10.100.1. Get the requested data. Close the session(this works fine). Start a new TCP session using SOAP to IP address 10.10.100.2. Get the data(here the program crashes).
As a last resort I copied the first code two times in the same file. Changed variable names in the copied code so all objects are new. In this way I got the same program two times in the same file simulating a loop with two iterations, but with different variable names. The error appears again.
The only solution I got is to run the program once a time with a different IP address each time. In this way I got the data required but involves some extra hand work :(.
By the way, I tried the sleep command to delay the execution of each interation by 5 or 10 seconds(thinking about a buffer thing) with no success.
I made a packet capture too. Unfortunately the traffic is encripted so I can't find a clue about problem reading the payload of the http traffic. But my computer resets the session, not the remote machine.
A last note. The Soap module has a debug option. This prints the message sended to the remote machine. In each iteration is exactly the same, except for the IP address.
Any suggestion is welcome!