Class XsdSchemaHandlerAdapter
java.lang.Object
org.springframework.xml.transform.TransformerObjectSupport
org.springframework.ws.transport.http.LocationTransformerObjectSupport
org.springframework.ws.transport.http.XsdSchemaHandlerAdapter
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,org.springframework.web.servlet.HandlerAdapter
public class XsdSchemaHandlerAdapter
extends LocationTransformerObjectSupport
implements org.springframework.web.servlet.HandlerAdapter, org.springframework.beans.factory.InitializingBean
Adapter to use the
XsdSchema
interface with the generic DispatcherServlet
.
Reads the source from the mapped XsdSchema
implementation, and writes that as the result to the
HttpServletResponse
. Allows for post-processing the schema in subclasses.
- Since:
- 1.5.3
- Author:
- Arjen Poutsma
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default XPath expression used for extracting allschemaLocation
attributes from the WSDL definition. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
long
getLastModified
(jakarta.servlet.http.HttpServletRequest request, Object handler) protected Source
getSchemaSource
(XsdSchema schema) Returns theSource
of the given schema.org.springframework.web.servlet.ModelAndView
handle
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler) void
setSchemaLocationExpression
(String schemaLocationExpression) Sets the XPath expression used for extracting theschemaLocation
attributes from the WSDL 1.1 definition.void
setTransformSchemaLocations
(boolean transformSchemaLocations) Sets whether relative address schema locations in the WSDL are to be transformed using the request URI of the incomingHttpServletRequest
.boolean
protected void
transformSchemaLocations
(Document definitionDocument, jakarta.servlet.http.HttpServletRequest request) Transforms allschemaLocation
attributes to reflect the server name givenHttpServletRequest
.Methods inherited from class org.springframework.ws.transport.http.LocationTransformerObjectSupport
transformLocation, transformLocations
Methods inherited from class org.springframework.xml.transform.TransformerObjectSupport
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
-
Field Details
-
DEFAULT_SCHEMA_LOCATION_EXPRESSION
Default XPath expression used for extracting allschemaLocation
attributes from the WSDL definition.- See Also:
-
-
Constructor Details
-
XsdSchemaHandlerAdapter
public XsdSchemaHandlerAdapter()
-
-
Method Details
-
setSchemaLocationExpression
Sets the XPath expression used for extracting theschemaLocation
attributes from the WSDL 1.1 definition.Defaults to
DEFAULT_SCHEMA_LOCATION_EXPRESSION
. -
setTransformSchemaLocations
public void setTransformSchemaLocations(boolean transformSchemaLocations) Sets whether relative address schema locations in the WSDL are to be transformed using the request URI of the incomingHttpServletRequest
. Defaults tofalse
. -
getLastModified
- Specified by:
getLastModified
in interfaceorg.springframework.web.servlet.HandlerAdapter
-
handle
public org.springframework.web.servlet.ModelAndView handle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler) throws Exception - Specified by:
handle
in interfaceorg.springframework.web.servlet.HandlerAdapter
- Throws:
Exception
-
supports
- Specified by:
supports
in interfaceorg.springframework.web.servlet.HandlerAdapter
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
getSchemaSource
Returns theSource
of the given schema. Allows for post-processing and transformation of the schema in sub-classes.Default implementation simply returns
XsdSchema.getSource()
.- Parameters:
schema
- the schema- Returns:
- the source of the given schema
- Throws:
Exception
- in case of errors
-
transformSchemaLocations
protected void transformSchemaLocations(Document definitionDocument, jakarta.servlet.http.HttpServletRequest request) throws Exception Transforms allschemaLocation
attributes to reflect the server name givenHttpServletRequest
. Determines the suitable attributes by evaluating the defined XPath expression, and delegates totransformLocation
to do the transformation for all attributes that match.This method is only called when the
transformSchemaLocations
property is true.
-