From e6b2a9f314f6024a0e424cd27ca422cbe3c03ef9 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Fri, 18 May 2007 22:04:47 +0000 Subject: [PATCH] Docs --- src/docbkx/server.xml | 131 +++++++++--------------------------------- 1 file changed, 26 insertions(+), 105 deletions(-) diff --git a/src/docbkx/server.xml b/src/docbkx/server.xml index 3e8ecb9b..588b031c 100644 --- a/src/docbkx/server.xml +++ b/src/docbkx/server.xml @@ -759,120 +759,41 @@ public class AnnotationOrderEndpoint {
Handling Exceptions - Spring-WS provides - EndpointExceptionResolvers - to ease the pain of unexpected + Spring-WS provides EndpointExceptionResolvers to ease the pain of unexpected exceptions occurring while your message is being processed by an endpoint which matched the request. - EndpointExceptionResolver - s somewhat resemble the exception mappings that can be - defined in the web application descriptor - web.xml - . - Rather than expose the innards of your application by giving a client a full stack trace, you can handle - the exception any way you want, e.g. return a SOAP fault with a specific fault code and string. + Endpoint exception resolvers somewhat resemble the exception mappings that can be + defined in the web application descriptor web.xml. + However, they provide a more flexible way to handle exceptions. They provide information about what + endpoint was invoked when the exception was thrown. Furthermore, a programmatic way of handling exceptions gives you many more options for how to respond appropriately. + Finally, rather than expose the innards of your application by giving an exception and stack trace, you + can handle the exception any way you want, e.g. return a SOAP fault with a specific fault code and string. - Besides implementing the - HandlerExceptionResolver - interface, which is only a - matter of implementing the - resolveException(MessageContext, endpoint, Exception) - method and returning a - boolean, you may also use the - SoapFaultMappingExceptionResolver - . + Besides implementing the EndpointExceptionResolver interface, which is only a + matter of implementing the resolveException(MessageContext, endpoint, Exception) + method, you may also use the SoapFaultMappingExceptionResolver. This resolver enables you to take the class name of any exception that might be thrown and map it to a SOAP Fault, like so: - - - - - - - SENDER,Invalid request - - - - -]]> - This configuration will map exceptions of type - ValidationFailureException - to a - sender side SOAP Fault with a fault string "Invalid request". + + + + + + + + SENDER,Invalid request + + + + +]]> + This configuration will map exceptions of type ValidationFailureException + to a sender side SOAP Fault with a fault string "Invalid request". If any other exception occurs, it will return the default fault: a server side fault with fault string "Server error". - Refer to the Javadoc of - SoapFaultDefinitionEditor - to read more about the exact - notation of the faults. - -
- -
- Similarities between Spring-MVC and Spring-WS - - Spring-WS has the same basic architecture as Spring's Web MVC framework. - The table below shows some of the core concepts of Spring Web MVC, and the corresponding class in Spring-WS. - - - - - Spring Web MVC - Spring Web Services - - - - - - DispatcherServlet - - - MessageDispatcher - - - - handler - endpoint - - - - HandlerAdapter - - - EndpointAdapter - - - - - HandlerMapping - - - EndpointMapping - - - - - HandlerInterceptor - - - EndpointInterceptor - - - - - HandlerExceptionResolver - - - EndpointExceptionResolver - - - - -