Hi all,
I'm calling a .net webservice from Linux using Perl (5.8.7). I'm using the SOAP::Lite library.
The basic proof of concept worked fine and now I'm trying it in the real world where I have to call the webservice many times. Now it looks like the web service call opens a file but does not release the file descriptor. The default maximum number of available is set to 256 and it suns out of that quickly after which the program dies. :(
Here's the code:
# Create the soap client
my $client = SOAP::Lite->new;
# Get raw SOAP xml output
$client->outputxml(1);
# Set connection parameters
$client->uri($namespace);
# set the url in the proxy member. The keep_alive parameter is needed if user authentication
# is used, it is passed on to the user agent class to set up an authenticated HTTP session
$client->proxy($url, keep_alive => 1);
# Set the user credentials
$client->transport->credentials("$host:$port", ''
, $user
, $password
);
# define the webservice method
$client->on_action( sub { return "$namespace$method" } );
my $soapmethod = SOAP::Data->name($method)
->attr({xmlns => $namespace});
# Generate the SOAP parameters and make the call
my @paramarray = ( \%paramhash );
my $ps = ${MakeSoapParameters(\@paramarray)};
# output the current number of filedescriptors used for this process
system("ls -l /proc/$$/fd | wc -l");
# Make the call
my $result = $client->call($soapmethod => $ps );
# output the current number of filedescriptors used for this process AFTER the call
system("ls -l /proc/$$/fd | wc -l");
If I monitor the file descriptors used with ls -l /proc/$$/fd | wc -l I notice the number of used filedescriptors to go up every time I make a web service call.
Any help or hint would be appreciated.