my $service_status = 1; my $client = SOAP::Lite -> uri( $URI ) -> on_action(sub{ qq($on_action) }) -> on_fault(sub { $service_status = 0 }) -> envprefix('soapenv') -> autotype(0) -> proxy( $Proxy ); my $method = SOAP::Data->name($method); my $header = SOAP::Header->type('data'=>SOAP::Data->type('xml' => '')); my $body = _arrayref_to_soap($body); my $result; eval { $result = $client->call($method,$header,@$body); }; if ( $@ ) { # error handling } if ( !$service_status ) { # error handling }