Chapter 3 Service Endpoint Design
  You cannot throw nonserializable exceptions to a client through the Web ser 
vice endpoint.
  When a service throws 
 exceptions, the exception type and its 
context information are lost to the client that receives the thrown exception. 
For example, if your service throws a 
to the client, the client may receive an exception named 
, but 
its type information may not be available to the client. Furthermore, the type 
of the exception to the client may not be the same as the type of the thrown ex 
ception. (Depending on the tool used to generate the client side interfaces, the 
exception may even belong to some package other than 
As a result, you should avoid directly throwing 
 exceptions to
clients. Instead, when your service encounters one of these types of exceptions,
wrap it within a meaningful service specific exception and throw this service 
specific exception back to the client. For example, suppose your service
encounters a 
 exception while processing a client
request. The service should catch the 
 exception, and then, rather
than throwing this exception as is back to the client, the service should instead
throw a service specific exception that has more meaning for the client. See Code
Example 3.12.
try {
// findByPrimaryKey
// Do processing
// return results
} catch (javax.ejb.FinderException fe) {
throw new InvalidKeyException(
 Unable to find row with given primary key );
Code Example 3.12
Converting an Exception into a Service Specific Exception
Exception inheritances are lost when you throw a service specific exception.
You should avoid defining service specific exceptions that inherit or extend
other exceptions. For example, if 
 in Code Example 3.10

New Page 1

Home : About Us : Network : Services : Support : FAQ : Control Panel : Order Online : Sitemap : Contact : Terms Of Service


Our web partners:  Jsp Web Hosting  Unlimited Web Hosting  Cheapest Web Hosting  Java Web Hosting  Web Templates  Best Web Templates  Web Design Templates  Interland Web Hosting  Cheap Web Hosting  Filemaker Web Hosting  Tomcat Web Hosting  Quality Web Hosting  Best Web Hosting  Mac Web Hosting


Virtualwebstudio. Business web hosting division of Vision Web Hosting Inc. All rights reserved

Web Hosting Apache