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 recieves a
response at all. 

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


-- 
View this message in context: 
http://www.nabble.com/Issue-with-Asynchronous-Callback-and-SOAPFaultException-handling-tp23852265p23852265.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to