Spring Web Services Framework

org.springframework.ws.transport.http
Class XsdSchemaHandlerAdapter

java.lang.Object
  extended by org.springframework.xml.transform.TransformerObjectSupport
      extended by org.springframework.ws.transport.http.LocationTransformerObjectSupport
          extended by org.springframework.ws.transport.http.XsdSchemaHandlerAdapter
All Implemented Interfaces:
InitializingBean, HandlerAdapter

public class XsdSchemaHandlerAdapter
extends LocationTransformerObjectSupport
implements HandlerAdapter, 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:
XsdSchema, getSchemaSource(XsdSchema)

Field Summary
static String DEFAULT_SCHEMA_LOCATION_EXPRESSION
          Default XPath expression used for extracting all schemaLocation attributes from the WSDL definition.
 
Constructor Summary
XsdSchemaHandlerAdapter()
           
 
Method Summary
 void afterPropertiesSet()
           
 long getLastModified(HttpServletRequest request, Object handler)
           
protected  Source getSchemaSource(XsdSchema schema)
          Returns the Source of the given schema.
 ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler)
           
 void setSchemaLocationExpression(String schemaLocationExpression)
          Sets the XPath expression used for extracting the schemaLocation 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 incoming HttpServletRequest.
 boolean supports(Object handler)
           
protected  void transformSchemaLocations(Document definitionDocument, HttpServletRequest request)
          Transforms all schemaLocation attributes to reflect the server name given HttpServletRequest.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SCHEMA_LOCATION_EXPRESSION

public static final String DEFAULT_SCHEMA_LOCATION_EXPRESSION
Default XPath expression used for extracting all schemaLocation attributes from the WSDL definition.

See Also:
Constant Field Values
Constructor Detail

XsdSchemaHandlerAdapter

public XsdSchemaHandlerAdapter()
Method Detail

setSchemaLocationExpression

public void setSchemaLocationExpression(String schemaLocationExpression)
Sets the XPath expression used for extracting the schemaLocation 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 incoming HttpServletRequest. Defaults to false.


getLastModified

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

handle

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

supports

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

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

getSchemaSource

protected Source getSchemaSource(XsdSchema schema)
                          throws Exception
Returns the Source 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,
                                        HttpServletRequest request)
                                 throws Exception
Transforms all schemaLocation attributes to reflect the server name given HttpServletRequest. Determines the suitable attributes by evaluating the defined XPath expression, and delegates to transformLocation to do the transformation for all attributes that match.

This method is only called when the transformSchemaLocations property is true.

Throws:
Exception
See Also:
setSchemaLocationExpression(String), LocationTransformerObjectSupport.transformLocation(String, javax.servlet.http.HttpServletRequest)

Spring Web Services Framework

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