Subject: | can't set return code for soapresponse |
Date: | Sat, 17 Mar 2007 13:09:37 -0500 |
To: | bug-POE-Component-Server-SOAP [...] rt.cpan.org |
From: | Whitney Jackson <whjackson [...] gmail.com> |
Sometimes it's necessary to set the return code for the HTTP response.
For example, in order to request that a client provide credentials
according to the HTTP basic authentication scheme a return code of 401
must be set for the response. Currently, P::C::Server::SOAP
automatically overrides any attempts to set the return code. As a
result this doesn't work:
...
sub soap_challenge_method {
my ($kernel, $response) = @_;
# Challenge the client for credentials...
$response->header('WWW-Authenticate' => 'Basic');
$response->code(401); # will be overridden and set to 500
$kernel->post(
'MySOAP',
'FAULT',
$response,
'Client.Authentication',
'Must set user and password',
);
return;
}
...
Attached is a patch that causes P::C::Server::SOAP to set a default
return code only if one has not already been specified.
Whitney
Message body is not shown because sender requested not to inline it.