Upgrade to CXF 2.2.2.    We've added a bunch of tests and fixes and such 
around exceptions with the Async methods.

Dan


On Wed June 3 2009 10:15:23 am Kyle.Bober wrote:
> I have implemented an Asynchronous web service call using the Call back
> approach via an AsyncHandler. I have noticed an issue where the remote web
> service is throwing a SOAPFaultException. The issue is the AsynHandler code
> I wrote does not seem to catch the exception. In fact it never receives a
> response at all. I am using Apache CXF 2.1.2 to generate the client side
> code
>
> How do I handle this accordingly???
>
> Here is the code making the Asynchronous request ::
>
> // Asynchronous WS callback approach
> ServiceAsyncHandler serviceAsyncHandler = new
> ServiceAsyncHandler(aSomeObject1, aSomeObject2);
> Future<?> response = thePort.getAnalysisAsync(criteria,
> serviceAsyncHandler);
>
> Here is the AsyncHandler code ::
>
> /**
>  * Aysynchronous KATDataService Handler
>  */
> public void handleResponse(Response<AnalysisResponse> response) {
>      try {
>               Object object = response.get();
>               this.analysis = (Analysis)object;
>
>                 // Do some processing here on the response
>
>               } catch(SOAPFaultException ex) {
>                       LOGGER.error("ERROR : KATDataServiceAsyncHandler", ex);
>               } catch (InterruptedException ex) {
>                       LOGGER.error("ERROR : KATDataServiceAsyncHandler", ex);
>               } catch (ExecutionException ex) {
>                       LOGGER.error("ERROR : KATDataServiceAsyncHandler", ex);
>               }
>       }
> }
>
> It also seems if I place a snippet of code after I make the Asynchronous
> web service request like so ::
>
> try {
>      response.isDone()
> } catch(SOAPFaultException ex) {
>      LOGGER.error("ERROR : Calling Remote Web Service", ex);
> }
>
> It will catch the SOAPFaultExcpetion occasionally but not all the time so
> this is not 100% reliable. I still have an issue where the
> SOAPFaultExcpetion falls through the cracks and is not caught by either the
> AsynchHandler or the code making the Asynchronous web service call.
>
> Please can someone explain why this is and how I go about resolving this
> issue.
> -Kyle

-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to