File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handle Exception in Web Service

 
Smita S. Mutha
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to web services world.
Can someone please tell me how can I handle exception occered in Service.
i.e.

If there is any exception while executing the service method code, if any exception occurs, may be run time exception or, some error condition, where custom message need to be sent back to user, how can one do it?

Can we send the exception/message in Soap:Fault. Or
I need to have some provision in return type of method.

Please help.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most SOAP toolkits will create a SOAP message with a Fault message.
The requirements for error handling are laid out in the by now very lengthy SOAP specification.

Be aware that if your request never gets through to your SOAP service due to some addressing problem, the server will probably send back a plain HTML message and an error code that your SOAP client may have a hard time interpreting.

Most developers use something like TCPMON to record the exact text of request and response when debugging.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic