use SOAP::Lite; my $client = SOAP::Lite ->service('http://localhost/Service.wsdl'); my $auth = $client->login( 'username', 'password' ); exit 1 if $auth->fault != 0; my $header = SOAP::Header->name( 'auth' => $auth->result ); my $response = $client->private_method( $header );