Meaningful Exception for HTTP Exceptions
----------------------------------------
Key: CXF-3113
URL: https://issues.apache.org/jira/browse/CXF-3113
Project: CXF
Issue Type: Improvement
Components: Transports
Affects Versions: 2.2.11
Reporter: Sébastien
Priority: Minor
In one of my unit test, a client interacts with a
basic-authentication-protected web service. If the authentication fails (an
HTML 401 error page is displayed) the client receives a web service exception
caused by an IOException caused by a HTTPRetryException. But, there is no
programmatic way to know the cause. *This test illustrates a global issue:
identifying the HTTP error code*.
It could be interesting to have a web service exception containing an exception
describing the HTTP error code and the message. Like that third party clients
can identify the origin of the exception and eventually (through the usage of
interceptors) throw a meaningful exception.
I'm using Spring security, this is my configuration:
{code}
<sec:authentication-provider>
<sec:user-service>
<sec:user name="myUser" password="password"
authorities="ROLE_USER"/>
</sec:user-service>
</sec:authentication-provider>
<sec:http auto-config="true">
<sec:http-basic />
<!-- Anonymous clients are authorized to get WSDLs. -->
<sec:intercept-url method="GET" pattern="/services/*"
access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<!-- Anonymous clients are authorized to see the service list. -->
<sec:intercept-url method="GET" pattern="/services"
access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<!-- Web services and servlets require any authenticated user. -->
<sec:intercept-url pattern="/services/**" access="ROLE_USER"/>
</sec:http>
{code}
That request may also affect CXF 2.3 (I've only tried on 2.2.11).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.