com.sun.xml.ws.wsdl.writer
Class WSDLGenerator

java.lang.Object
  extended by com.sun.xml.ws.wsdl.writer.WSDLGenerator

public class WSDLGenerator
extends java.lang.Object

Class used to generate WSDLs from a SEIModel.


Nested Class Summary
protected  class WSDLGenerator.JAXWSOutputSchemaResolver
          Implements the SchemaOutputResolver used by JAXB to
 
Constructor Summary
WSDLGenerator(AbstractSEIModelImpl model, com.oracle.webservices.api.databinding.WSDLResolver wsdlResolver, WSBinding binding, Container container, java.lang.Class implType, boolean inlineSchemas, boolean disableXmlSecurity, WSDLGeneratorExtension... extensions)
          Creates the WSDLGenerator
WSDLGenerator(AbstractSEIModelImpl model, com.oracle.webservices.api.databinding.WSDLResolver wsdlResolver, WSBinding binding, Container container, java.lang.Class implType, boolean inlineSchemas, WSDLGeneratorExtension... extensions)
          Creates the WSDLGenerator
 
Method Summary
 javax.xml.transform.Result createOutputFile(java.lang.String namespaceUri, java.lang.String suggestedFileName)
          Creates the Result object used by JAXB to generate a schema for the namesapceUri namespace.
 void doGeneration()
          Performes the actual WSDL generation
protected  void generateBinding()
          Generates the Binding section of the WSDL
protected  void generateBindingOperation(JavaMethodImpl method, Binding binding)
           
protected  void generateDocumentParameterOrder(Operation operation, JavaMethodImpl method)
          Generates the parameterOrder for a PortType operation
protected  void generateInputMessage(Operation operation, JavaMethodImpl method)
           
protected  void generateMessages()
          Generates the WSDL messages
protected  void generateOutputMessage(Operation operation, JavaMethodImpl method)
           
protected  void generateParameterOrder(Operation operation, JavaMethodImpl method)
          Generates the parameterOrder for a PortType operation
protected  void generatePortType()
          Generates the WSDL portType
protected  void generateRpcParameterOrder(Operation operation, JavaMethodImpl method)
          Generates the parameterOrder for a PortType operation
protected  void generateService()
          Generates the Service section of the WSDL
protected  void generateSOAP12BindingOperation(JavaMethodImpl method, Binding binding)
           
protected  void generateSOAP12Headers(com.sun.xml.txw2.TypedXmlWriter writer, java.util.List<ParameterImpl> parameters, javax.xml.namespace.QName message)
           
protected  void generateSOAPHeaders(com.sun.xml.txw2.TypedXmlWriter writer, java.util.List<ParameterImpl> parameters, javax.xml.namespace.QName message)
           
protected  void generateSOAPMessages(JavaMethodImpl method, SOAPBinding binding)
          Generates messages for a SOAPBinding
protected  void generateTypes()
          Generates the types section of the WSDL
protected  boolean isAttachmentParameter(ParameterImpl parameter)
           
protected  boolean isBodyParameter(ParameterImpl parameter)
          Determines if a parameter is associated with the message Body
protected  boolean isHeaderParameter(ParameterImpl parameter)
           
protected  boolean isRpcLit(JavaMethodImpl method)
          Determines if a JavaMethod is rpc/literal
protected  boolean isWrapperStyle(JavaMethodImpl method)
          Determines if the method is wrapper style
protected  java.lang.String mangleName(java.lang.String name)
           
protected static java.lang.String relativize(java.lang.String uri, java.lang.String baseUri)
          Relativizes a URI by using another URI (base URI.)
 void setEndpointAddress(java.lang.String address)
          Sets the endpoint address string to be written.
protected  java.util.List<ParameterImpl> sortMethodParameters(JavaMethodImpl method)
          Sorts the parameters for the method by their position
protected  void splitParameters(java.util.List<ParameterImpl> bodyParams, java.util.List<ParameterImpl> headerParams, java.util.List<ParameterImpl> params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSDLGenerator

public WSDLGenerator(AbstractSEIModelImpl model,
                     com.oracle.webservices.api.databinding.WSDLResolver wsdlResolver,
                     WSBinding binding,
                     Container container,
                     java.lang.Class implType,
                     boolean inlineSchemas,
                     WSDLGeneratorExtension... extensions)
Creates the WSDLGenerator

Parameters:
model - The AbstractSEIModelImpl used to generate the WSDL
wsdlResolver - The WSDLResolver to use resovle names while generating the WSDL
binding - specifies which BindingType to generate
extensions - an array WSDLGeneratorExtension that will be invoked to generate WSDL extensions

WSDLGenerator

public WSDLGenerator(AbstractSEIModelImpl model,
                     com.oracle.webservices.api.databinding.WSDLResolver wsdlResolver,
                     WSBinding binding,
                     Container container,
                     java.lang.Class implType,
                     boolean inlineSchemas,
                     boolean disableXmlSecurity,
                     WSDLGeneratorExtension... extensions)
Creates the WSDLGenerator

Parameters:
model - The AbstractSEIModelImpl used to generate the WSDL
wsdlResolver - The WSDLResolver to use resovle names while generating the WSDL
binding - specifies which BindingType to generate
disableXmlSecurity - specifies whether to disable the secure xml processing feature
extensions - an array WSDLGeneratorExtension that will be invoked to generate WSDL extensions
Method Detail

setEndpointAddress

public void setEndpointAddress(java.lang.String address)
Sets the endpoint address string to be written. Defaults to REPLACE_WITH_ACTUAL_URL.

Parameters:
address - wsdl:port/soap:address/[@location] value

mangleName

protected java.lang.String mangleName(java.lang.String name)

doGeneration

public void doGeneration()
Performes the actual WSDL generation


generateTypes

protected void generateTypes()
Generates the types section of the WSDL


generateMessages

protected void generateMessages()
Generates the WSDL messages


generateSOAPMessages

protected void generateSOAPMessages(JavaMethodImpl method,
                                    SOAPBinding binding)
Generates messages for a SOAPBinding

Parameters:
method - The JavaMethod to generate messages for
binding - The SOAPBinding to add the generated messages to

generatePortType

protected void generatePortType()
Generates the WSDL portType


isWrapperStyle

protected boolean isWrapperStyle(JavaMethodImpl method)
Determines if the method is wrapper style

Parameters:
method - The JavaMethod to check if it is wrapper style
Returns:
true if the method is wrapper style, otherwise, false.

isRpcLit

protected boolean isRpcLit(JavaMethodImpl method)
Determines if a JavaMethod is rpc/literal

Parameters:
method - The method to check
Returns:
true if method is rpc/literal, otherwise, false

generateParameterOrder

protected void generateParameterOrder(Operation operation,
                                      JavaMethodImpl method)
Generates the parameterOrder for a PortType operation

Parameters:
operation - The operation to generate the parameterOrder for
method - The JavaMethod to generate the parameterOrder from

generateRpcParameterOrder

protected void generateRpcParameterOrder(Operation operation,
                                         JavaMethodImpl method)
Generates the parameterOrder for a PortType operation

Parameters:
operation - the operation to generate the parameterOrder for
method - the JavaMethod to generate the parameterOrder from

generateDocumentParameterOrder

protected void generateDocumentParameterOrder(Operation operation,
                                              JavaMethodImpl method)
Generates the parameterOrder for a PortType operation

Parameters:
operation - the operation to generate the parameterOrder for
method - the JavaMethod to generate the parameterOrder from

sortMethodParameters

protected java.util.List<ParameterImpl> sortMethodParameters(JavaMethodImpl method)
Sorts the parameters for the method by their position

Parameters:
method - the JavaMethod used to sort the parameters
Returns:
the sorted List of parameters

isBodyParameter

protected boolean isBodyParameter(ParameterImpl parameter)
Determines if a parameter is associated with the message Body

Parameters:
parameter - the parameter to check
Returns:
true if the parameter is a body parameter

isHeaderParameter

protected boolean isHeaderParameter(ParameterImpl parameter)

isAttachmentParameter

protected boolean isAttachmentParameter(ParameterImpl parameter)

generateBinding

protected void generateBinding()
Generates the Binding section of the WSDL


generateBindingOperation

protected void generateBindingOperation(JavaMethodImpl method,
                                        Binding binding)

generateSOAP12BindingOperation

protected void generateSOAP12BindingOperation(JavaMethodImpl method,
                                              Binding binding)

splitParameters

protected void splitParameters(java.util.List<ParameterImpl> bodyParams,
                               java.util.List<ParameterImpl> headerParams,
                               java.util.List<ParameterImpl> params)

generateSOAPHeaders

protected void generateSOAPHeaders(com.sun.xml.txw2.TypedXmlWriter writer,
                                   java.util.List<ParameterImpl> parameters,
                                   javax.xml.namespace.QName message)

generateSOAP12Headers

protected void generateSOAP12Headers(com.sun.xml.txw2.TypedXmlWriter writer,
                                     java.util.List<ParameterImpl> parameters,
                                     javax.xml.namespace.QName message)

generateService

protected void generateService()
Generates the Service section of the WSDL


generateInputMessage

protected void generateInputMessage(Operation operation,
                                    JavaMethodImpl method)

generateOutputMessage

protected void generateOutputMessage(Operation operation,
                                     JavaMethodImpl method)

createOutputFile

public javax.xml.transform.Result createOutputFile(java.lang.String namespaceUri,
                                                   java.lang.String suggestedFileName)
                                            throws java.io.IOException
Creates the Result object used by JAXB to generate a schema for the namesapceUri namespace.

Parameters:
namespaceUri - The namespace for the schema being generated
suggestedFileName - the JAXB suggested file name for the schema file
Returns:
the Result for JAXB to generate the schema into
Throws:
java.io.IOException - thrown if on IO error occurs

relativize

protected static java.lang.String relativize(java.lang.String uri,
                                             java.lang.String baseUri)
Relativizes a URI by using another URI (base URI.)

For example, relative("http://www.sun.com/abc/def","http://www.sun.com/pqr/stu") => "../abc/def"

This method only works on hierarchical URI's, not opaque URI's (refer to the java.net.URI javadoc for complete definitions of these terms.

This method will not normalize the relative URI.

Parameters:
uri - the URI to relativize
baseUri - the base URI to use for the relativization
Returns:
the relative URI or the original URI if a relative one could not be computed


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.