|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.springframework.web.servlet.HttpServletBean org.springframework.web.servlet.FrameworkServlet org.springframework.ws.transport.http.MessageDispatcherServlet
public class MessageDispatcherServlet
Servlet for simplified dispatching of Web service messages.
This servlet is a convenient alternative to the standard Spring-MVCDispatcherServlet
with separate WebServiceMessageReceiverHandlerAdapter
, MessageDispatcher
, and WsdlDefinitionHandlerAdapter
instances.
This servlet automatically detects EndpointAdapters
, EndpointMappings
, and EndpointExceptionResolvers
by type.
This servlet also automatically detects any WsdlDefinition
defined in its application context. This WSDL is
exposed under the bean name: for example, a WsdlDefinition
bean named 'echo
' will be
exposed as echo.wsdl
in this servlet's context: http://localhost:8080/spring-ws/echo.wsdl
.
When the transformWsdlLocations
init-param is set to true
in this servlet's configuration
in web.xml
, all location
attributes in the WSDL definitions will reflect the URL of the
incoming request.
DispatcherServlet
,
MessageDispatcher
,
WebServiceMessageReceiverHandlerAdapter
,
Serialized FormField Summary | |
---|---|
static String |
DEFAULT_MESSAGE_FACTORY_BEAN_NAME
Well-known name for the WebServiceMessageFactory bean in the bean factory for this namespace. |
static String |
DEFAULT_MESSAGE_RECEIVER_BEAN_NAME
Well-known name for the WebServiceMessageReceiver object in the bean factory for this namespace. |
static String |
DEFAULT_MESSAGE_RECEIVER_HANDLER_ADAPTER_BEAN_NAME
Well-known name for the WebServiceMessageReceiverHandlerAdapter object in the bean factory for this
namespace. |
static String |
DEFAULT_WSDL_DEFINITION_HANDLER_ADAPTER_BEAN_NAME
Well-known name for the WsdlDefinitionHandlerAdapter object in the bean factory for this namespace. |
static String |
DEFAULT_XSD_SCHEMA_HANDLER_ADAPTER_BEAN_NAME
Well-known name for the XsdSchemaHandlerAdapter object in the bean factory for this namespace. |
Fields inherited from class org.springframework.web.servlet.FrameworkServlet |
---|
DEFAULT_CONTEXT_CLASS, DEFAULT_NAMESPACE_SUFFIX, SERVLET_CONTEXT_PREFIX |
Fields inherited from class org.springframework.web.servlet.HttpServletBean |
---|
logger |
Constructor Summary | |
---|---|
MessageDispatcherServlet()
Public constructor, necessary for some Web application servers. |
|
MessageDispatcherServlet(WebApplicationContext webApplicationContext)
Constructor to support programmatic configuration of the Servlet with the specified web application context. |
Method Summary | |
---|---|
protected void |
doService(HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
|
protected long |
getLastModified(HttpServletRequest httpServletRequest)
|
String |
getMessageFactoryBeanName()
Returns the bean name used to lookup a WebServiceMessageFactory . |
protected WebServiceMessageReceiver |
getMessageReceiver()
Returns the WebServiceMessageReceiver used by this servlet. |
String |
getMessageReceiverBeanName()
Returns the bean name used to lookup a WebServiceMessageReceiver . |
String |
getMessageReceiverHandlerAdapterBeanName()
Returns the bean name used to lookup a WebServiceMessageReceiverHandlerAdapter . |
protected WsdlDefinition |
getWsdlDefinition(HttpServletRequest request)
Determines the WsdlDefinition for a given request, or null if none is found. |
String |
getWsdlDefinitionHandlerAdapterBeanName()
Returns the bean name used to lookup a WsdlDefinitionHandlerAdapter . |
protected XsdSchema |
getXsdSchema(HttpServletRequest request)
Determines the XsdSchema for a given request, or null if none is found. |
String |
getXsdSchemaHandlerAdapterBeanName()
Returns the bean name used to lookup a XsdSchemaHandlerAdapter . |
protected void |
initStrategies(ApplicationContext context)
Initialize the strategy objects that this servlet uses. |
boolean |
isTransformSchemaLocations()
Indicates whether relative address locations in the XSD are to be transformed using the request URI of the incoming HttpServletRequest . |
boolean |
isTransformWsdlLocations()
Indicates whether relative address locations in the WSDL are to be transformed using the request URI of the incoming HttpServletRequest . |
protected void |
onRefresh(ApplicationContext context)
This implementation calls initStrategies(org.springframework.context.ApplicationContext) . |
void |
setMessageFactoryBeanName(String messageFactoryBeanName)
Sets the bean name used to lookup a WebServiceMessageFactory . |
void |
setMessageReceiverBeanName(String messageReceiverBeanName)
Sets the bean name used to lookup a WebServiceMessageReceiver . |
void |
setMessageReceiverHandlerAdapterBeanName(String messageReceiverHandlerAdapterBeanName)
Sets the bean name used to lookup a WebServiceMessageReceiverHandlerAdapter . |
void |
setTransformSchemaLocations(boolean transformSchemaLocations)
Sets whether relative address locations in the XSD are to be transformed using the request URI of the incoming HttpServletRequest . |
void |
setTransformWsdlLocations(boolean transformWsdlLocations)
Sets whether relative address locations in the WSDL are to be transformed using the request URI of the incoming HttpServletRequest . |
void |
setWsdlDefinitionHandlerAdapterBeanName(String wsdlDefinitionHandlerAdapterBeanName)
Sets the bean name used to lookup a WsdlDefinitionHandlerAdapter . |
void |
setXsdSchemaHandlerAdapterBeanName(String xsdSchemaHandlerAdapterBeanName)
Sets the bean name used to lookup a XsdSchemaHandlerAdapter . |
Methods inherited from class org.springframework.web.servlet.HttpServletBean |
---|
addRequiredProperty, createEnvironment, getEnvironment, getServletContext, getServletName, init, initBeanWrapper, setEnvironment |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doHead, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_MESSAGE_FACTORY_BEAN_NAME
WebServiceMessageFactory
bean in the bean factory for this namespace.
public static final String DEFAULT_MESSAGE_RECEIVER_BEAN_NAME
WebServiceMessageReceiver
object in the bean factory for this namespace.
public static final String DEFAULT_MESSAGE_RECEIVER_HANDLER_ADAPTER_BEAN_NAME
WebServiceMessageReceiverHandlerAdapter
object in the bean factory for this
namespace.
public static final String DEFAULT_WSDL_DEFINITION_HANDLER_ADAPTER_BEAN_NAME
WsdlDefinitionHandlerAdapter
object in the bean factory for this namespace.
public static final String DEFAULT_XSD_SCHEMA_HANDLER_ADAPTER_BEAN_NAME
XsdSchemaHandlerAdapter
object in the bean factory for this namespace.
Constructor Detail |
---|
public MessageDispatcherServlet()
public MessageDispatcherServlet(WebApplicationContext webApplicationContext)
ServletContext#addServlet
API.
Using this constructor indicates that the following properties / init-params will be ignored:
FrameworkServlet.setContextClass(Class)
/ 'contextClass'FrameworkServlet.setContextConfigLocation(String)
/ 'contextConfigLocation'FrameworkServlet.setContextAttribute(String)
/ 'contextAttribute'FrameworkServlet.setNamespace(String)
/ 'namespace'The given web application context may or may not yet be refreshed. If it has not already been refreshed (the recommended approach), then the following will occur:
ServletContext
and ServletConfig
objects will be delegated to
the application contextFrameworkServlet.postProcessWebApplicationContext(org.springframework.web.context.ConfigurableWebApplicationContext)
will be calledApplicationContextInitializer
s specified through the
"contextInitializerClasses" init-param or through the FrameworkServlet.setContextInitializers(org.springframework.context.ApplicationContextInitializer...)
property will be applied.refresh()
will be called if the context implements
ConfigurableWebApplicationContext
See WebApplicationInitializer
for usage examples.
webApplicationContext
- the context to useFrameworkServlet.FrameworkServlet(WebApplicationContext)
,
WebApplicationInitializer
,
FrameworkServlet.initWebApplicationContext()
,
FrameworkServlet.configureAndRefreshWebApplicationContext(org.springframework.web.context.ConfigurableWebApplicationContext)
Method Detail |
---|
public String getMessageFactoryBeanName()
WebServiceMessageFactory
.
public void setMessageFactoryBeanName(String messageFactoryBeanName)
WebServiceMessageFactory
. Defaults to DEFAULT_MESSAGE_FACTORY_BEAN_NAME
.
public String getMessageReceiverBeanName()
WebServiceMessageReceiver
.
public void setMessageReceiverBeanName(String messageReceiverBeanName)
WebServiceMessageReceiver
. Defaults to DEFAULT_MESSAGE_RECEIVER_BEAN_NAME
.
public boolean isTransformWsdlLocations()
HttpServletRequest
.
public void setTransformWsdlLocations(boolean transformWsdlLocations)
HttpServletRequest
. Defaults to false
.
public boolean isTransformSchemaLocations()
HttpServletRequest
.
public void setTransformSchemaLocations(boolean transformSchemaLocations)
HttpServletRequest
. Defaults to false
.
public String getMessageReceiverHandlerAdapterBeanName()
WebServiceMessageReceiverHandlerAdapter
.
public void setMessageReceiverHandlerAdapterBeanName(String messageReceiverHandlerAdapterBeanName)
WebServiceMessageReceiverHandlerAdapter
. Defaults to DEFAULT_MESSAGE_RECEIVER_HANDLER_ADAPTER_BEAN_NAME
.
public String getWsdlDefinitionHandlerAdapterBeanName()
WsdlDefinitionHandlerAdapter
.
public void setWsdlDefinitionHandlerAdapterBeanName(String wsdlDefinitionHandlerAdapterBeanName)
WsdlDefinitionHandlerAdapter
. Defaults to DEFAULT_WSDL_DEFINITION_HANDLER_ADAPTER_BEAN_NAME
.
public String getXsdSchemaHandlerAdapterBeanName()
XsdSchemaHandlerAdapter
.
public void setXsdSchemaHandlerAdapterBeanName(String xsdSchemaHandlerAdapterBeanName)
XsdSchemaHandlerAdapter
. Defaults to DEFAULT_XSD_SCHEMA_HANDLER_ADAPTER_BEAN_NAME
.
protected void doService(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception
doService
in class FrameworkServlet
Exception
protected void onRefresh(ApplicationContext context)
initStrategies(org.springframework.context.ApplicationContext)
.
onRefresh
in class FrameworkServlet
protected long getLastModified(HttpServletRequest httpServletRequest)
getLastModified
in class HttpServlet
protected WebServiceMessageReceiver getMessageReceiver()
WebServiceMessageReceiver
used by this servlet.
protected WsdlDefinition getWsdlDefinition(HttpServletRequest request)
WsdlDefinition
for a given request, or null
if none is found.
Default implementation checks whether the request method is GET
, whether the request uri ends with
".wsdl"
, and if there is a WsdlDefinition
with the same name as the filename in the
request uri.
request
- the HttpServletRequest
null
protected XsdSchema getXsdSchema(HttpServletRequest request)
XsdSchema
for a given request, or null
if none is found.
Default implementation checks whether the request method is GET
, whether the request uri ends with
".xsd"
, and if there is a XsdSchema
with the same name as the filename in the request
uri.
request
- the HttpServletRequest
null
protected void initStrategies(ApplicationContext context)
May be overridden in subclasses in order to initialize further strategy objects.
|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |