use strict; use warnings; use IO::Socket; use LWP::UserAgent; use LWP::Protocol::http; use HTTP::Request; use Data::Dumper; use Dis::Time; use Storable qw(store_fd fd_retrieve); $ENV{HTTPS_DEBUG} = 1; .... my $userAgent = LWP::UserAgent->new(agent => 'ClientSim.pl/0.2', keep_alive => 1, local_address => $localAddr, ssl_opts => { verify_hostname => 0 }, timeout => 1, ); push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, SendTE => 0); my $heads = HTTP::Headers->new( Content_Type => $data->{Soap}{Content}, Accept_Encoding => $data->{Soap}{Encoding}, Expect => '100-continue', SOAPAction => $data->{Soap}{Ns}{tem}.$data->{Soap}{Method}, ); print "Executing: HTTP::Request\n" if $debug; my $req = HTTP::Request->new("POST", $data->{Soap}{Uri},$heads, $data->{Message}); $data->{Retry} = 0; while(1) { $data->{Start} = Dis::Time->new(); print "Executing: HTTP::Response\n" if $debug; $data->{Response} = $userAgent->request($req); my $code = $data->{Response}->code; print "Responce code $code Recieved\n" if $debug; last if ("200" eq $code || "500" ne $code || $data->{Retry}>=$retry); $data->{Retry}++; print $data->{Response}->as_string,"Retrying...\n" if $debug; } ....