The Axis Easy Web Service Server Connector is part of the Tivoli® Directory Integrator Web Services suite. It is a simplified version of the Web Service Receiver Server Connector in that it internally instantiates, configures and uses the AxisSoapToJava and AxisJavaToSoap FCs.
The functionality provided is the same as if you chain and configure these FCs in an AssemblyLine which hosts the Web Service Receiver Server Connector. When using this Connector you forgo the possibility of hooking custom processing before parsing the SOAP request and after serializing the SOAP response, that is, you are tied to the processing and binding provided by Axis, but you gain simplicity of setup and use.
The Axis Easy Web Service Server Connector operates in Server mode only.
AssemblyLines support an Operation Entry (op-entry). The op-entry has an attribute $operation that contains the name of the current operation executed by the AssemblyLine. In order to process different web service operations easier, the Axis Easy Web Service Server Connector will set the $operation attribute of the op-entry.
The Axis Easy Web Service Server Connector supports generation of a WSDL file according to the input and output schema of the AssemblyLine. As in Tivoli Directory Integrator 7.1.1 AssemblyLines support multiple operations, the WSDL generation can result in a web service definition with multiple operations. There are some rules about naming the operations:
This Connector's configuration is relatively simple. The Connector parses the incoming SOAP request, stores it (along with HTTP specific data) into the event Entry and then presents this Entry to the AssemblyLine for Attribute mapping. When the work Entry (now storing the Java representation of the SOAP response) is returned to the Connector in the Response phase, the Connector serializes the response and returns it to the Web Service client.
When this Connector receives a SOAP request, the connector parses it and sets the $operation attribute of the op-entry. The name of the operation is determined by the name of the element nested in the Body element of the SOAP envelope. For parsing the SOAP messages, a SAX parser is used, which compared to a DOM parser adds less performance overhead.
There are several types of SOAP messages:
The Axis Easy Web Service Server Connector provides the "wsdlRequested" Connector Attribute to the AssemblyLine.
If an HTTP request arrives and the requested HTTP resource ends with "?WSDL" then the Connector sets the value of the "wsdlRequested" Attribute to true and reads the contents of the file specified by the WSDL File parameter into the "soapResponse" Connector Attribute; otherwise the value of this Attribute is set to false.
This Attribute's value thus allows you to distinguish between pure SOAP requests and HTTP requests for the WSDL file. The AssemblyLine can use a Branch Component to execute only the appropriate piece of logic - (1) when a request for the WSDL file has been received, then the AssemblyLine could perform some optional logic or read a different WSDL file and send it back to the web service client, or just rely on default processing; (2) when a SOAP request has been received the AssemblyLine will handle the SOAP request. Alternatively, you could program the system.skipEntry(); call at an appropriate place (in a script component, in a hook in the first Connector in the AssemblyLine, etc.) to skip further processing and go directly to the Response channel processing.
It is the responsibility of the AssemblyLine to provide the necessary response to a SOAP request.
The Connector implements a public method:
public String readFile (String aFileName) throws IOException;
This method can be used from Tivoli Directory Integrator JavaScript in a script component to read the contents of a WSDL file on the local file system. The AssemblyLine can then return the contents of the WSDL in the "soapResponse" Attribute, and thus to the web service client in case a request for the WSDL was received.
Attribute | Value |
---|---|
host | Type is String. Contains the name of the host to which the request is sent. This parameter is set only if "wsdlRequested" is false. |
requestObjArray | The soapRequest represented as an array of objects; converts java.lang.String to Object[] with the perform method of SoapToJava function component. |
requestedResource | The requested HTTP resource. |
soapAction | The SOAP action HTTP header. This parameter is set only if "wsdlRequested" is false. |
soapFault | If a SOAP error occurs, an org.apache.axis.AxisFault is stored in this attribute. |
soapRequest | The SOAP request in txt/XML or DOMElement format. This parameter is set only if "wsdlRequested" is false. |
soapResponse | The SOAP response message. If wsdlRequested is true, then soapResponse is set to the contents of the WSDL file. |
wsdlRequested | This parameter is true if a WSDL file is requested and false otherwise. |
http.username | This attribute is used only when HTTP basic authentication is enabled. The value is the username of the client connected. |
http.password | This attribute is used only when HTTP basic authentication is enabled. The value is the password of the client connected. |
Attribute | Value |
---|---|
responseContentType | The response type. |
responseObjArray | The soapRequest represented as an array of objects; the soapResponse gets the value from here, using the JavaToSoap function component to convert Object[] to java.lang.String. |
soapFault | If a SOAP error occurs, an org.apache.axis.AxisFault is stored in this attribute. |
soapResponse | The SOAP response message. If wsdlRequested is true, then soapResponse is set to the contents of the WSDL file. |
wsdlRequested | This parameter is true if a WSDL file is requested and false otherwise. |
http.credentialsValid | This attribute is used only when HTTP basic authentication is enabled. Its syntax is boolean and if true client authentication is successful. It is responsibility of the AssemblyLine to set this parameter's value when HTTP basic authentication is used. |
The Generate WSDL button runs the WSDL generation utility.
The WSDL Generation utility takes as input the name of the WSDL file to generate and the URL of the provider of the web service (the web service location). This utility extracts the input and output parameters of the AssemblyLine in which the Connector is embedded and uses that information to generate the WSDL parts of the input and output WSDL messages. It is mandatory that for each Entry Attribute in the "Initial Work Entry" and "Result Entry" Schema the "Native Syntax" column be filled in with the Java type of the Attribute (for example, "java.lang.String"). The WSDL file generated by this utility can then be manually edited.
The operation style of the SOAP Operation defined in the generated WSDL is "rpc".
The WSDL generation utility cannot generate a <types...>...</types> section for complex types in the WSDL.
For an overview of the Axis Easy Web Service Server Connector Attributes, used to exchange information to and from the HTTP/SOAP request, see Schema.
This Connector parses the incoming SOAP request message and stores the Java representation of the SOAP request in the "requestObjArray" Connector Attribute. The Connector is capable of parsing both Document-style and RPC-style SOAP messages as well as generating (a) Document-style SOAP response messages, (b) RPC-style SOAP response messages and (c) SOAP Fault response messages. The style of the message generated is determined by the WSDL specified by the WSDL File Connector parameter.
The Connector is capable of parsing SOAP request messages and generating SOAP response messages which contain values of complex types which are defined in the <types> section of the WSDL document. In order to do that this Connector requires that (1) the Complex Types Connector parameter contains the names of all Java classes that implement the complex types used as request and response parameters to the SOAP operation and that (2) these Java classes' class files are located in the Java class path of Tivoli Directory Integrator.
If during parsing the SOAP request an Exception is thrown by the parsing code, then the Connector generates a SOAP Fault Object (org.apache.axis.AxisFault) and stores it in the "soapFault" Connector Attribute.
This Connector is capable of parsing and generating SOAP response messages encoded using both "literal" encoding and SOAP Section 5 encoding. The encoding of the SOAP response message generated is determined by the WSDL specified by the WSDL File Connector parameter.
At the end of AssemblyLine processing in the Response channel phase, this Connector requires the Java representation (Object[]) of the SOAP response message from the "responseObjArray" Attribute of the work Entry to be mapped out. The Connector then serializes the SOAP response message, wraps it into an HTTP response and returns it to the web service client.