Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The soap service that I'm trying to connect to has implemented a username and password layer:
I've got working c# (shudder) code:<soap:Header> <AuthenticationHeader xmlns="http://www.server.com/"> <username>string</username> <password>string</password> </AuthenticationHeader> </soap:Header>
But my perl code won't authenticate, in fact I get nothing back. I've tried passing the user:pass in the url, and I've tried it with the Transport sub. My code is below. I keep getting the error "Can't call method "GetData" on an undefined value"DataSet ds = new DataSet(); theGeoData.AuthenticationHeader auth = new theGeoData.Authenticati +onHeader(); theGeoData.GetData theAd = new theGeoData.GetData(); auth.username = "user"; auth.password = "pass"; theAdds.AuthenticationHeaderValue = auth; ds = theAdds.GetIt();
andsub SOAP::Transport::HTTP::Client::get_basic_credentials { return 'username' => 'user'; return 'password' => 'pass'; }
My soap code:-> service('http://user:pass@server/GetData.asmx?WSDL');
eval { $service = SOAP::Lite -> service('http://server/GetData.asmx?WSDL'); }; #|| ($_); # $@ will have the error message, perldoc -f eval $service -> GetData(); my $som = $service -> call || &soapGetBad();
Back to
Seekers of Perl Wisdom