Class WSDLGenerator


  • public class WSDLGenerator
    extends Object
    Class used to generate WSDLs from a SEIModel.
    Author:
    WS Development Team
    • Method Detail

      • setEndpointAddress

        public void setEndpointAddress​(String address)
        Sets the endpoint address string to be written. Defaults to REPLACE_WITH_ACTUAL_URL.
        Parameters:
        address - wsdl:port/soap:address/[@location] value
      • 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 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)
      • generateService

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

        public Result createOutputFile​(String namespaceUri,
                                       String suggestedFileName)
                                throws 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:
        IOException - thrown if on IO error occurs
      • relativize

        protected static String relativize​(String uri,
                                           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