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
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault XPath expression used for extracting allschemaLocationattributes from the WSDL definition. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidlonggetLastModified(jakarta.servlet.http.HttpServletRequest request, Object handler) Deprecated.protected SourcegetSchemaSource(XsdSchema schema) Returns theSourceof the given schema.org.springframework.web.servlet.ModelAndViewhandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler) voidsetSchemaLocationExpression(String schemaLocationExpression) Sets the XPath expression used for extracting theschemaLocationattributes from the WSDL 1.1 definition.voidsetTransformSchemaLocations(boolean transformSchemaLocations) Sets whether relative address schema locations in the WSDL are to be transformed using the request URI of the incomingHttpServletRequest.booleanprotected voidtransformSchemaLocations(Document definitionDocument, jakarta.servlet.http.HttpServletRequest request) Transforms allschemaLocationattributes to reflect the server name givenHttpServletRequest.Methods inherited from class org.springframework.ws.transport.http.LocationTransformerObjectSupport
transformLocation, transformLocationsMethods 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 allschemaLocationattributes from the WSDL definition.- See Also:
-
-
Constructor Details
-
XsdSchemaHandlerAdapter
public XsdSchemaHandlerAdapter()
-
-
Method Details
-
setSchemaLocationExpression
Sets the XPath expression used for extracting theschemaLocationattributes 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
@Deprecated public long getLastModified(jakarta.servlet.http.HttpServletRequest request, Object handler) Deprecated.- Specified by:
getLastModifiedin 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:
handlein interfaceorg.springframework.web.servlet.HandlerAdapter- Throws:
Exception
-
supports
- Specified by:
supportsin interfaceorg.springframework.web.servlet.HandlerAdapter
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getSchemaSource
Returns theSourceof 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 allschemaLocationattributes to reflect the server name givenHttpServletRequest. Determines the suitable attributes by evaluating the defined XPath expression, and delegates totransformLocationto do the transformation for all attributes that match.This method is only called when the
transformSchemaLocationsproperty is true.
-