Spring Web Services Framework

org.springframework.ws.transport.http
Class WebServiceMessageReceiverHandlerAdapter

java.lang.Object
  extended by org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport
      extended by org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter
All Implemented Interfaces:
InitializingBean, HandlerAdapter

public class WebServiceMessageReceiverHandlerAdapter
extends WebServiceMessageReceiverObjectSupport
implements HandlerAdapter

Adapter to use the WebServiceMessageReceiver interface with the generic DispatcherServlet. Requires a WebServiceMessageFactory which is used to convert the incoming HttpServletRequest into a WebServiceMessage, and passes that context to the mapped WebServiceMessageReceiver. If a response is created, that is sent via the HttpServletResponse.

Note that the MessageDispatcher implements the WebServiceMessageReceiver interface, enabling this adapter to function as a gateway to further message handling logic.

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
WebServiceMessageReceiverObjectSupport.setMessageFactory(org.springframework.ws.WebServiceMessageFactory), WebServiceMessageReceiver, WebServiceMessageFactory, MessageDispatcher

Field Summary
 
Fields inherited from class org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport
logger
 
Constructor Summary
WebServiceMessageReceiverHandlerAdapter()
           
 
Method Summary
 long getLastModified(HttpServletRequest request, Object handler)
           
 ModelAndView handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler)
           
protected  void handleInvalidXmlException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler, InvalidXmlException ex)
          Template method that is invoked when parsing the request results in a InvalidXmlException.
protected  void handleNonPostMethod(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler)
          Template method that is invoked when the request method is not POST.
 boolean supports(Object handler)
           
 
Methods inherited from class org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport
afterPropertiesSet, getMessageFactory, handleConnection, setMessageFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebServiceMessageReceiverHandlerAdapter

public WebServiceMessageReceiverHandlerAdapter()
Method Detail

getLastModified

public long getLastModified(HttpServletRequest request,
                            Object handler)
Specified by:
getLastModified in interface HandlerAdapter

handle

public ModelAndView handle(HttpServletRequest httpServletRequest,
                           HttpServletResponse httpServletResponse,
                           Object handler)
                    throws Exception
Specified by:
handle in interface HandlerAdapter
Throws:
Exception

supports

public boolean supports(Object handler)
Specified by:
supports in interface HandlerAdapter

handleNonPostMethod

protected void handleNonPostMethod(HttpServletRequest httpServletRequest,
                                   HttpServletResponse httpServletResponse,
                                   Object handler)
                            throws Exception
Template method that is invoked when the request method is not POST. Called from handle(HttpServletRequest, HttpServletResponse, Object).

Default implementation set the response status to 405: Method Not Allowed. Can be overridden in subclasses.

Parameters:
httpServletRequest - current HTTP request
httpServletResponse - current HTTP response
handler - current handler
Throws:
Exception

handleInvalidXmlException

protected void handleInvalidXmlException(HttpServletRequest httpServletRequest,
                                         HttpServletResponse httpServletResponse,
                                         Object handler,
                                         InvalidXmlException ex)
                                  throws Exception
Template method that is invoked when parsing the request results in a InvalidXmlException. Called from handle(HttpServletRequest, HttpServletResponse, Object).

Default implementation set the response status to 400: Bad Request. Can be overridden in subclasses.

Parameters:
httpServletRequest - current HTTP request
httpServletResponse - current HTTP response
handler - current handler
ex - the invalid XML exception that resulted in this method being called
Throws:
Exception

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.