astroboy has asked for the wisdom of the Perl Monks concerning the following question:
Hi
In have a class generated by SOAP::WSDL for a resource that requires Basic Authentication. The usual way to provide the credentials is to put something like this in your code
*SOAP::WSDL::Transport::HTTP::get_basic_credentials = sub { return ($user, $password); };
The underlying HTTP transport, LWP::UserAgent, won't supply the credentials until it receives either a HTTP::Status::RC_UNAUTHORIZED or a HTTP::Status::RC_PROXY_AUTHENTICATION_REQUIRED status code (401 or 407, I believe). This is correct, as specified in RFC2616.
Unfortunately, the SOAP service returns a 501 status, and a fault stating that the Basic Authentication credentials were never received. So I need a away around this. One way to to edit the class generated by SOAP::WSDL, and supply the credentials in the proxy = e.g. http://user:password@service. However, I really want to avoid this, as it will mean that I've hard-coded the authentication details in a package, which then isn't shareable by anyone else wishing to call the same service, and if I need to generate packages from the WSDL again, I''ll lose the credentials
So can anyone see a way around this?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Sending HTTP credentials with SOAP
by almut (Canon) on Mar 17, 2010 at 02:10 UTC | |
by astroboy (Chaplain) on Mar 17, 2010 at 04:21 UTC | |
Re: Sending HTTP credentials with SOAP
by Anonymous Monk on Mar 17, 2010 at 07:19 UTC | |
by Corion (Patriarch) on Mar 17, 2010 at 08:42 UTC | |
by Anonymous Monk on Mar 17, 2010 at 09:13 UTC | |
by astroboy (Chaplain) on Mar 17, 2010 at 19:49 UTC | |
by astroboy (Chaplain) on Mar 17, 2010 at 19:46 UTC | |
Re: Sending HTTP credentials with SOAP
by astroboy (Chaplain) on Mar 17, 2010 at 04:03 UTC |