[ https://issues.apache.org/jira/browse/CXF-3113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932013#action_12932013 ]
Sébastien commented on CXF-3113: -------------------------------- Ok, I see there is an javax.xml.ws.http.HTTPException, it could be more interesting to have that unified exception whatever the HTTP error message ? Anyway, for our purpose we need to create an incoming interceptor switching from the WebServiceException to our custom exception. The interceptor will have one strategy checking for the cause of the cause and provide the right message. > 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 > Attachments: > com.bsb.sf.sample.service.math.ws.HelloWorldWebServiceTestIt.txt > > > In one of my unit tests, 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.