Class Axis2WSServerConnector

  • All Implemented Interfaces:
    ConnectorInterface, VersionInfoInterface

    public class Axis2WSServerConnector
    extends Connector
    implements ConnectorInterface
    This Connector can be used to provide a SOAP web service, which is accessible via HTTP/HTTPS. It is named after the underlying Axis2 Java library: http://ws.apache.org/axis2/. The Connector uses the HTTP Server Connector as its HTTP transport.
    Since:
    TDI 7.0
    • Field Detail

      • PARAM_WSDL

        public static final java.lang.String PARAM_WSDL
        A URL of a WSDL document. Both WSDL 1.1 and WSDL 2.0 documents are allowed.
        See Also:
        Constant Field Values
      • PARAM_SERVICE

        public static final java.lang.String PARAM_SERVICE
        The name of the service description inside the WSDL document.
        See Also:
        Constant Field Values
      • ATTR_OPERATION_CARRIER

        public static final java.lang.String ATTR_OPERATION_CARRIER
        This Attribute carries the name of the AL Operation. The static configuration of this Connector (tdi.xml) declares this Attribute as the Operation Carrier.
        See Also:
        Constant Field Values
      • ATTR_SOAP_HEADER

        public static final java.lang.String ATTR_SOAP_HEADER
        The SOAP header of the request/response message.
        See Also:
        Constant Field Values
      • ATTR_AUTH_RESULT

        public static final java.lang.String ATTR_AUTH_RESULT
        Whether the authentication of the client is successful.
        See Also:
        Constant Field Values
      • ATTR_FAULT_CODE

        public static final java.lang.String ATTR_FAULT_CODE
        SOAP fault code (the local part of the qualified name). If specified, the Connector will send a SOAP fault response to the client.
        See Also:
        Constant Field Values
      • ATTR_FAULT_CODE_NS_URI

        public static final java.lang.String ATTR_FAULT_CODE_NS_URI
        SOAP fault code (the namespace URI).
        See Also:
        Constant Field Values
      • ATTR_FAULT_CODE_NS_PREFIX

        public static final java.lang.String ATTR_FAULT_CODE_NS_PREFIX
        SOAP fault code (the namespace prefix).
        See Also:
        Constant Field Values
      • ATTR_FAULT_REASON

        public static final java.lang.String ATTR_FAULT_REASON
        SOAP fault reason. If you specify SOAP fault code, you must specify this one too.
        See Also:
        Constant Field Values
      • ATTR_FAULT_NODE

        public static final java.lang.String ATTR_FAULT_NODE
        SOAP fault node.
        See Also:
        Constant Field Values
      • ATTR_FAULT_ROLE

        public static final java.lang.String ATTR_FAULT_ROLE
        SOAP fault role.
        See Also:
        Constant Field Values
      • ATTR_FAULT_DETAIL

        public static final java.lang.String ATTR_FAULT_DETAIL
        SOAP fault detail. This is a Hierarchical Attribute.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Axis2WSServerConnector

        public Axis2WSServerConnector()
        Creates the Connector.
    • Method Detail

      • initialize

        public void initialize​(java.lang.Object obj)
                        throws java.lang.Exception
        Initialize the Connector.
        Specified by:
        initialize in interface ConnectorInterface
        Overrides:
        initialize in class Connector
        Parameters:
        obj - Pass an instance of the HTTPServerConnector, which handles a particular client to initialize the Connector for a client session. Otherwise the Connector will start an HTTP server and will wait for clients.
        Throws:
        java.lang.Exception - If the 'service' parameter is not specified and the WSDL document contains multiple service descriptions. If the 'service' parameter is specified, but does not refer to an existing service description from the WSDL document. A problem while reading the WSDL document or an Axis2 related error.
      • getNextClient

        public ConnectorInterface getNextClient()
                                         throws java.lang.Exception
        Server mode - return a clone of self that handles the next client instance when running in server mode. The returned connector may be used in its own thread to handle a "client" request so if the returned instance is returned more than once it must be thread safe.
        Specified by:
        getNextClient in interface ConnectorInterface
        Overrides:
        getNextClient in class Connector
        Returns:
        the clone of itself
        Throws:
        java.lang.Exception - if an error occurs.
      • terminate

        public void terminate()
                       throws java.lang.Exception
        Terminate the connector. This function closes all connection and releases all resources used by the connector. This function also calls the parser's closeParser() method if a parser is active.
        Specified by:
        terminate in interface ConnectorInterface
        Overrides:
        terminate in class Connector
        Throws:
        java.lang.Exception - if an error occurs.
      • getNextEntry

        public Entry getNextEntry()
                           throws java.lang.Exception
        Returns the next Entry from the connector. The entry is populated with attributes and values from the next entry in the input set.

        Example:

         var ctor = input.getConnector();
         var entry = ctor.getNextEntry();
         
         for (; entry != null; entry = ctor.getNextEntry()) {
                main.logmsg("Read entry...");
                main.dumpEntry(entry);
         }
         
        Specified by:
        getNextEntry in interface ConnectorInterface
        Overrides:
        getNextEntry in class Connector
        Returns:
        - the next Entry, or null if no more data
        Throws:
        java.lang.Exception - if an error occurs.
        See Also:
        ConnectorInterface.selectEntries()
      • replyEntry

        public void replyEntry​(Entry conn)
                        throws java.lang.Exception
        Send a reply to the connector.
        Specified by:
        replyEntry in interface ConnectorInterface
        Overrides:
        replyEntry in class Connector
        Parameters:
        conn - the information as an Entry
        Throws:
        java.lang.Exception - if an error occurs.
      • getVersion

        public java.lang.String getVersion()
        Version information.
        Specified by:
        getVersion in interface VersionInfoInterface
        Returns:
        version of the Connector.
      • isTerminating

        public boolean isTerminating()
        Returns:
        Whether the Connector is terminating.
      • getHTTPHeaders

        public static java.util.Map<java.lang.String,​java.lang.String> getHTTPHeaders​(Entry httpEntry)
        Parameters:
        httpEntry - An Entry produced by the HTTP Server Connector.
        Returns:
        The HTTP headers from the Entry.
      • getResHash

        public static ResourceHash getResHash()
        Returns:
        The container with Connector's messages.
      • querySchema

        public java.lang.Object querySchema​(java.lang.Object input)
                                     throws java.lang.Exception
        This function translates to whatever means a connector has to discover schema for a connection. The connector may implement this, in which case a Vector of Entry objects is returned for each column/attribute it discovered. For a database connector this would typically be column names and their attributes.

        Each Entry in the Vector returned should contain the following attributes:

        Name Value
        name The name of the column/attribute/field ....
        syntax The syntax or expected value type
        size If specified this will give the user a hint as to how long the field may be

        Specified by:
        querySchema in interface ConnectorInterface
        Overrides:
        querySchema in class Connector
        Parameters:
        input - The object on which to discover schema. This may be an Entry or a string value
        Returns:
        A Vector of com.ibm.di.entry.Entry objects describing each entity
        Throws:
        java.lang.Exception - if an error while retrieving the schema occurs.
        See Also:
        Entry, Vector