Class Jibx2Wsdl

java.lang.Object
org.jibx.ws.wsdl.tools.Jibx2Wsdl

public class Jibx2Wsdl extends Object
Start-from-code WSDL generator using JiBX data binding. This starts from one or more service classes, each with one or more methods to be exposed as service operations, and generates complete bindings and WSDL for the services. Although many of the methods in this class use public access, they are intended for use only by the JiBX developers and may change from one release to the next. To make use of this class from your own code, call the main(String[]) method with an appropriate argument list.
Author:
Dennis M. Sosnoski
  • Field Details

    • s_logger

      private static final Logger s_logger
      Logger for class.
    • m_generationParameters

      private final WsdlGeneratorCommandLine m_generationParameters
      Parameter information for generation.
    • m_bindingGenerator

      private final BindGen m_bindingGenerator
      Binding generator.
    • m_schemaGenerator

      private final SchemaGen m_schemaGenerator
      Schema generator.
    • m_uriSchemaMap

      private final Map m_uriSchemaMap
      Map from schema namespace URIs to schema holders.
  • Constructor Details

  • Method Details

    • getMappingQName

      private QName getMappingQName(String type, MappingElement mapping)
      Get the qualified name used for an abstract mapping. This throws an exception if the qualified name is not found.
      Parameters:
      type -
      mapping -
      Returns:
      qualified name
    • addSchemaReference

      private void addSchemaReference(QName qname, Map namemap, SchemaHolder holder)
      Add reference to another schema. The reference may either be to a definition in a supplied schema (in which case it'll be in the map) or in a generated schema (in which case the namespace is used to lookup the schema).
      Parameters:
      qname - referenced definition name
      namemap - map from qualified name to holder for defining schema (only for predefined schemas)
      holder - schema making the reference
    • buildValueElement

      private ElementElement buildValueElement(ValueCustom parm, Map typemap, Map namemap, SchemaHolder hold)
      Build an element representing a parameter or return value.
      Parameters:
      parm -
      typemap - map from parameterized type to abstract mapping qualified name
      namemap - map from qualified name to holder for defining schema (only for predefined schemas)
      hold - containing schema holder
      Returns:
      constructed element
    • buildWSDL

      private Definitions buildWSDL(ServiceCustom service, Map ptypemap, Map classelems, Map elemschemas, Map classtypes, Map typeschemas)
      Build WSDL for service.
      Parameters:
      service -
      ptypemap - map from parameterized type to abstract mapping name
      classelems - fully-qualified class name to element qualified name map
      elemschemas - element qualified name to schema holder map
      classtypes - fully-qualified class name to type qualified name map
      typeschemas - type qualified name to schema holder map
      Returns:
      constructed WSDL definitions
    • accumulateData

      private void accumulateData(ValueCustom value, Map clasmap, Set dataset)
      Accumulate data type(s) from value to be included in binding.
      Parameters:
      value -
      clasmap - map with classes to be excluded as keys
      dataset - set of types for binding
    • addCollectionBinding

      public QName addCollectionBinding(boolean doclit, ValueCustom value, Map typemap, BindingHolder bind)
      Add the <mapping> definition for a typed collection to a binding. This always creates an abstract mapping with the type name based on both the item type and the collection type, except in the case where an array is being used in unwrapped (non-plain doc/lit) form.
      Parameters:
      doclit - plain doc/lit handling flag
      value - collection value
      typemap - map from parameterized type to abstract mapping name
      bind - target binding
      Returns:
      qualified name for collection
    • generate

      private List generate(List classes, List extras, Map classelems, Map elemschemas, Map classtypes, Map typeschemas, Collection exists) throws JiBXException, IOException
      Generate based on list of service classes.
      Parameters:
      classes - service class list
      extras - list of extra classes for binding
      classelems - fully-qualified class name to element qualified name map
      elemschemas - element qualified name to schema element map
      classtypes - fully-qualified class name to type qualified name map
      typeschemas - type qualified name to schema element map
      exists - existing schemas potentially referenced
      Returns:
      list of WSDLs
      Throws:
      JiBXException
      IOException
    • accumulateBindingDefinitions

      private static void accumulateBindingDefinitions(BindingElement binding, Map elemmap, Map typemap)
      Accumulate all mapping definitions, including those found in included bindings. For each named abstract mapping found, the class name is associated with the type name in the type map; for each concrete mapping found, the class name is associated with the element name in the element map. Included bindings are handled with recursive calls.
      Parameters:
      binding - binding definition root
      elemmap - map from fully-qualified class name to element qualified name
      typemap - map from fully-qualified class name to type qualified name
    • processPregeneratedBinding

      public static BindingElement processPregeneratedBinding(URL url, Map elemmap, Map typemap) throws JiBXException, IOException
      Load and validate binding and process all mapping definitions, including those in included bindings.
      Parameters:
      url - binding definition path
      elemmap - map from element qualified name to class data
      typemap - map from type qualified name to class data
      Returns:
      binding
      Throws:
      JiBXException
      IOException
    • main

      public static void main(String[] args) throws JiBXException, IOException
      Run the WSDL generation using command line parameters.
      Parameters:
      args -
      Throws:
      JiBXException
      IOException