Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to catch org.apache.axis2.AxisFault on server side  RSS feed

 
Nghia Le
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I used the top-down approach to generate Web Services using Eclipse. In the skeleton code, I need to be able to detect response status to the client request. I don't know how to do this. e.g, if response to client is successful, update client record on the server side. If response failed, do nothing. How can I detect Socket exception passed down from HttpServlet to org.apache.axis2. Thank you.
 
Bosun Bello
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try something like this -

 
Nghia Le
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should have been more specific on my question. The invokeBusinessLogic method in the generated MessageReceiverInputOutput class is called by the axis library. The invokeBusinessLogic method calls the method in the generated Skeleton class. Everything is fined in the return from the Skeleton method and invokeBusinessLogic. The problem is when axis returns the response back to the HTTPServlet and the servlet detects SoketIO error. I tried putting the following code in the finally block of the invokeBusinessLogic but it is not working. I am looking for something almost like a callback to detect response to the client and then perform action based on the status of the response to the client.

finally{
if(newMsgContext.isFault()){
//Any update to database or sending msg, only if there is no fault then perform opertion System.out.println("Fault detected in SOAP response");
}

Thank you so much for your time.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!