[ https://issues.apache.org/jira/browse/CXF-3113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12930217#action_12930217 ]
Daniel Kulp commented on CXF-3113: ---------------------------------- Umm.. the actuall HTTP exception is set into the cause, I think two levels in. } catch (WebServiceException ex) { ex.getCause().getCause(); /// SHOULD be the HTTPRetryException I think for all the various HTTP exceptions, if you dig into the cause's, you can determine the root of the issues. > 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.