Spring Web Services Framework

org.springframework.ws.wsdl.wsdl11.builder
Class XsdBasedSoap11Wsdl4jDefinitionBuilder

java.lang.Object
  extended by org.springframework.ws.wsdl.wsdl11.builder.AbstractWsdl4jDefinitionBuilder
      extended by org.springframework.ws.wsdl.wsdl11.builder.AbstractBindingWsdl4jDefinitionBuilder
          extended by org.springframework.ws.wsdl.wsdl11.builder.AbstractSoap11Wsdl4jDefinitionBuilder
              extended by org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder
All Implemented Interfaces:
InitializingBean, Wsdl11DefinitionBuilder

Deprecated. as of Spring Web Services 1.5: superseded by DefaultWsdl11Definition and the org.springframework.ws.wsdl.wsdl11.provider package

public class XsdBasedSoap11Wsdl4jDefinitionBuilder
extends AbstractSoap11Wsdl4jDefinitionBuilder
implements InitializingBean

Builds a WsdlDefinition with a SOAP 1.1 binding based on an XSD schema. This builder iterates over all elements found in the schema, and creates a message for those elements that end with the request or response suffix. It combines these messages into operations, and builds a portType based on the operations.

By default, the schema file is inlined in a types block. However, if the schemaLocation property is set, an XSD import is used instead. As such, the imported schema file can contain further imports, which will be resolved correctly in accordance with the schema location.

To create messages from imported and included schemas, set the followIncludeImport property to true.

Typically used within a DynamicWsdl11Definition, like so:

 <bean id="airline" class="org.springframework.ws.wsdl.wsdl11.DynamicWsdl11Definition">
   <property name="builder">
     <bean class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder">
     <property name="schema" value="/WEB-INF/airline.xsd"/>
     <property name="portTypeName" value="Airline"/>
     <property name="locationUri" value="http://localhost:8080/airline/services"/>
     </bean>
   </property>
 </bean>
 

Requires the schema and portTypeName properties to be set.

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
setSchema(org.springframework.core.io.Resource), setPortTypeName(String), setRequestSuffix(String), setResponseSuffix(String)

Field Summary
static String DEFAULT_FAULT_SUFFIX
          Deprecated. The default suffix used to detect fault elements in the schema.
static String DEFAULT_PREFIX
          Deprecated. The default prefix used to register the target namespace in the WSDL.
static String DEFAULT_REQUEST_SUFFIX
          Deprecated. The default suffix used to detect request elements in the schema.
static String DEFAULT_RESPONSE_SUFFIX
          Deprecated. The default suffix used to detect response elements in the schema.
static String DEFAULT_SCHEMA_PREFIX
          Deprecated. The default prefix used to register the schema namespace in the WSDL.
static String SERVICE_SUFFIX
          Deprecated. The suffix used to create a service name from a port type name.
 
Fields inherited from class org.springframework.ws.wsdl.wsdl11.builder.AbstractSoap11Wsdl4jDefinitionBuilder
DEFAULT_TRANSPORT_URI
 
Fields inherited from class org.springframework.ws.wsdl.wsdl11.builder.AbstractWsdl4jDefinitionBuilder
logger
 
Constructor Summary
XsdBasedSoap11Wsdl4jDefinitionBuilder()
          Deprecated.  
 
Method Summary
 void afterPropertiesSet()
          Deprecated.  
protected  void buildImports(Definition definition)
          Deprecated. Does nothing.
protected  void buildMessages(Definition definition)
          Deprecated. Creates messages for each element found in the schema for which isRequestMessage(QName), isResponseMessage(QName), or isFaultMessage(QName) is true.
protected  void buildPortTypes(Definition definition)
          Deprecated. Adds port types to the definition.
protected  void buildTypes(Definition definition)
          Deprecated. Creates a Types object containing a Schema.
protected  QName getFaultMessageName(QName requestMessageName)
          Deprecated. Given an request message name, return the corresponding fault message name.
protected  QName getResponseMessageName(QName requestMessageName)
          Deprecated. Given an request message name, return the corresponding response message name.
protected  boolean isFaultMessage(QName name)
          Deprecated. Indicates whether the given name should be included as Message in the definition.
protected  boolean isRequestMessage(QName name)
          Deprecated. Indicates whether the given name name should be included as request Message in the definition.
protected  boolean isResponseMessage(QName name)
          Deprecated. Indicates whether the given name should be included as Message in the definition.
protected  void populateDefinition(Definition definition)
          Deprecated. Adds the target namespace and schema namespace to the definition.
protected  void populateMessage(Message message, QName elementName)
          Deprecated. Called after the Message has been created.
protected  void populateOperation(Operation operation, Message requestMessage, Message responseMessage)
          Deprecated. Called after the Operation has been created.
protected  void populatePart(Part part, QName elementName)
          Deprecated. Called after the Part has been created.
protected  void populatePortType(PortType portType)
          Deprecated. Called after the PortType has been created.
protected  void populateService(Service service)
          Deprecated. Sets the name of the service to the name of the port type, with "Service" appended to it.
 void setFaultSuffix(String faultSuffix)
          Deprecated. Sets the suffix used to detect fault elements in the schema.
 void setFollowIncludeImport(boolean followIncludeImport)
          Deprecated. Indicates whether schema <xsd:include/> and <xsd:import/> should be followed.
 void setPortTypeName(String portTypeName)
          Deprecated. Sets the port type name used for this definition.
 void setPrefix(String prefix)
          Deprecated. Sets the prefix used to declare the target namespace.
 void setRequestSuffix(String requestSuffix)
          Deprecated. Sets the suffix used to detect request elements in the schema.
 void setResponseSuffix(String responseSuffix)
          Deprecated. Sets the suffix used to detect response elements in the schema.
 void setSchema(Resource schemaResource)
          Deprecated. Sets the XSD schema to use for generating the WSDL.
 void setSchemaLocation(String schemaLocation)
          Deprecated. Sets the location of the schema to import.
 void setSchemaPrefix(String schemaPrefix)
          Deprecated. Sets the prefix used to declare the schema target namespace.
 void setTargetNamespace(String targetNamespace)
          Deprecated. Sets the target namespace used for this definition.
 
Methods inherited from class org.springframework.ws.wsdl.wsdl11.builder.AbstractSoap11Wsdl4jDefinitionBuilder
createSoapExtension, populateBinding, populateBindingFault, populateBindingInput, populateBindingOperation, populateBindingOutput, populatePort, populateSoapAddress, populateSoapBinding, populateSoapBody, populateSoapFault, populateSoapOperation, setLocationUri, setTransportUri
 
Methods inherited from class org.springframework.ws.wsdl.wsdl11.builder.AbstractBindingWsdl4jDefinitionBuilder
buildBindings, buildServices
 
Methods inherited from class org.springframework.ws.wsdl.wsdl11.builder.AbstractWsdl4jDefinitionBuilder
buildBindings, buildDefinition, buildImports, buildMessages, buildPortTypes, buildServices, buildTypes, createExtension, getDefinition, populateExtensionRegistry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_REQUEST_SUFFIX

public static final String DEFAULT_REQUEST_SUFFIX
Deprecated. 
The default suffix used to detect request elements in the schema.

See Also:
Constant Field Values

DEFAULT_RESPONSE_SUFFIX

public static final String DEFAULT_RESPONSE_SUFFIX
Deprecated. 
The default suffix used to detect response elements in the schema.

See Also:
Constant Field Values

DEFAULT_FAULT_SUFFIX

public static final String DEFAULT_FAULT_SUFFIX
Deprecated. 
The default suffix used to detect fault elements in the schema.

See Also:
Constant Field Values

DEFAULT_SCHEMA_PREFIX

public static final String DEFAULT_SCHEMA_PREFIX
Deprecated. 
The default prefix used to register the schema namespace in the WSDL.

See Also:
Constant Field Values

DEFAULT_PREFIX

public static final String DEFAULT_PREFIX
Deprecated. 
The default prefix used to register the target namespace in the WSDL.

See Also:
Constant Field Values

SERVICE_SUFFIX

public static final String SERVICE_SUFFIX
Deprecated. 
The suffix used to create a service name from a port type name.

See Also:
Constant Field Values
Constructor Detail

XsdBasedSoap11Wsdl4jDefinitionBuilder

public XsdBasedSoap11Wsdl4jDefinitionBuilder()
Deprecated. 
Method Detail

setRequestSuffix

public void setRequestSuffix(String requestSuffix)
Deprecated. 
Sets the suffix used to detect request elements in the schema.

See Also:
DEFAULT_REQUEST_SUFFIX

setResponseSuffix

public void setResponseSuffix(String responseSuffix)
Deprecated. 
Sets the suffix used to detect response elements in the schema.

See Also:
DEFAULT_RESPONSE_SUFFIX

setFaultSuffix

public void setFaultSuffix(String faultSuffix)
Deprecated. 
Sets the suffix used to detect fault elements in the schema.

See Also:
DEFAULT_FAULT_SUFFIX

setPortTypeName

public void setPortTypeName(String portTypeName)
Deprecated. 
Sets the port type name used for this definition. Required.


setTargetNamespace

public void setTargetNamespace(String targetNamespace)
Deprecated. 
Sets the target namespace used for this definition.


setSchemaPrefix

public void setSchemaPrefix(String schemaPrefix)
Deprecated. 
Sets the prefix used to declare the schema target namespace.

See Also:
DEFAULT_SCHEMA_PREFIX

setPrefix

public void setPrefix(String prefix)
Deprecated. 
Sets the prefix used to declare the target namespace.

See Also:
DEFAULT_PREFIX

setSchema

public void setSchema(Resource schemaResource)
Deprecated. 
Sets the XSD schema to use for generating the WSDL.


setSchemaLocation

public void setSchemaLocation(String schemaLocation)
Deprecated. 
Sets the location of the schema to import. If this property is set, the schema element in the generated WSDL will only contain an import, referring to the value of this property.


setFollowIncludeImport

public void setFollowIncludeImport(boolean followIncludeImport)
Deprecated. 
Indicates whether schema <xsd:include/> and <xsd:import/> should be followed. Default is false.


afterPropertiesSet

public final void afterPropertiesSet()
                              throws IOException,
                                     ParserConfigurationException,
                                     SAXException
Deprecated. 
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IOException
ParserConfigurationException
SAXException

populateDefinition

protected void populateDefinition(Definition definition)
                           throws WSDLException
Deprecated. 
Adds the target namespace and schema namespace to the definition.

Overrides:
populateDefinition in class AbstractSoap11Wsdl4jDefinitionBuilder
Parameters:
definition - the WSDL4J Definition
Throws:
WSDLException - in case of errors
See Also:
AbstractWsdl4jDefinitionBuilder.buildDefinition()

buildImports

protected void buildImports(Definition definition)
                     throws WSDLException
Deprecated. 
Does nothing.

Specified by:
buildImports in class AbstractWsdl4jDefinitionBuilder
Parameters:
definition - the WSDL4J Definition
Throws:
WSDLException - in case of errors

buildTypes

protected void buildTypes(Definition definition)
                   throws WSDLException
Deprecated. 
Creates a Types object containing a Schema. By default, the schema set by the schema property will be inlined into this type. If the schemaLocation is set, object that is populated with the types found in the schema.

Specified by:
buildTypes in class AbstractWsdl4jDefinitionBuilder
Parameters:
definition - the WSDL4J Definition
Throws:
WSDLException - in case of errors

buildMessages

protected void buildMessages(Definition definition)
                      throws WSDLException
Deprecated. 
Creates messages for each element found in the schema for which isRequestMessage(QName), isResponseMessage(QName), or isFaultMessage(QName) is true.

Specified by:
buildMessages in class AbstractWsdl4jDefinitionBuilder
Parameters:
definition - the WSDL4J Definition
Throws:
WSDLException - in case of errors

isRequestMessage

protected boolean isRequestMessage(QName name)
Deprecated. 
Indicates whether the given name name should be included as request Message in the definition. Default implementation checks whether the local part ends with the request suffix.

Parameters:
name - the name of the element elligable for being a message
Returns:
true if to be included as message; false otherwise
See Also:
setRequestSuffix(String)

isResponseMessage

protected boolean isResponseMessage(QName name)
Deprecated. 
Indicates whether the given name should be included as Message in the definition. Default implementation checks whether the local part ends with the response suffix.

Parameters:
name - the name of the element elligable for being a message
Returns:
true if to be included as message; false otherwise
See Also:
setResponseSuffix(String)

isFaultMessage

protected boolean isFaultMessage(QName name)
Deprecated. 
Indicates whether the given name should be included as Message in the definition. Default implementation checks whether the local part ends with the fault suffix.

Parameters:
name - the name of the element elligable for being a message
Returns:
true if to be included as message; false otherwise
See Also:
setFaultSuffix(String)

populateMessage

protected void populateMessage(Message message,
                               QName elementName)
                        throws WSDLException
Deprecated. 
Called after the Message has been created.

Default implementation sets the name of the message to the element name.

Parameters:
message - the WSDL4J Message
elementName - the element name
Throws:
WSDLException - in case of errors

populatePart

protected void populatePart(Part part,
                            QName elementName)
                     throws WSDLException
Deprecated. 
Called after the Part has been created.

Default implementation sets the element name of the part.

Parameters:
part - the WSDL4J Part
elementName - the elementName
Throws:
WSDLException - in case of errors
See Also:
Part.setElementName(javax.xml.namespace.QName)

buildPortTypes

protected void buildPortTypes(Definition definition)
                       throws WSDLException
Deprecated. 
Description copied from class: AbstractWsdl4jDefinitionBuilder
Adds port types to the definition.

Specified by:
buildPortTypes in class AbstractWsdl4jDefinitionBuilder
Parameters:
definition - the WSDL4J Definition
Throws:
WSDLException - in case of errors

populatePortType

protected void populatePortType(PortType portType)
                         throws WSDLException
Deprecated. 
Called after the PortType has been created.

Default implementation sets the name of the port type to the defined value.

Parameters:
portType - the WSDL4J PortType
Throws:
WSDLException - in case of errors
See Also:
setPortTypeName(String)

getResponseMessageName

protected QName getResponseMessageName(QName requestMessageName)
Deprecated. 
Given an request message name, return the corresponding response message name.

Default implementation removes the request suffix, and appends the response suffix.

Parameters:
requestMessageName - the name of the request message
Returns:
the name of the corresponding response message, or null

getFaultMessageName

protected QName getFaultMessageName(QName requestMessageName)
Deprecated. 
Given an request message name, return the corresponding fault message name.

Default implementation removes the request suffix, and appends the fault suffix.

Parameters:
requestMessageName - the name of the request message
Returns:
the name of the corresponding response message, or null

populateOperation

protected void populateOperation(Operation operation,
                                 Message requestMessage,
                                 Message responseMessage)
                          throws WSDLException
Deprecated. 
Called after the Operation has been created.

Default implementation sets the name of the operation to name of the messages, without suffix.

Parameters:
operation - the WSDL4J Operation
requestMessage - the WSDL4J request Message
responseMessage - the WSDL4J response Message
Throws:
WSDLException - in case of errors
See Also:
setPortTypeName(String)

populateService

protected void populateService(Service service)
                        throws WSDLException
Deprecated. 
Sets the name of the service to the name of the port type, with "Service" appended to it.

Overrides:
populateService in class AbstractBindingWsdl4jDefinitionBuilder
Parameters:
service - the WSDL4J Service
Throws:
WSDLException - in case of errors

Spring Web Services Framework

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