Tips for client creation

You can create client stubs in IBM TRIRIGA Application Platform with the Apache CXF or Axis2 Wsdl2Java stub generation tool.

Apache CXF Wsdl2Java Stub Generation Tool

Errors can occur when client stubs are generated in Apache CXF versions before 2.6.4. You can avoid these errors by using the Apache CXF 2.6.x wsdl2java.bat tool version 2.6.4 or later. For more information, see Apache CXF issues.

You can avoid the following WSDLToJava error by setting the -autoNameResolution flag in the Apache CXF wsdl2java.bat stub-creation tool.
WSDLToJava Error: Parameter: content already exists for method delete but of type com.tririga.ws.dto.content.Content instead of com.tririga.ws.dto.content.Response. Use a JAXWS/JAXB binding customization to rename the parameter.

When the Wsdl2Java command is run, a .../java/Lang directory is automatically created in the output directory where the client stub code is generated. You can remove this directory from the class path of your Java™ project.

After you generate the com.tririga.ws.Exception class, add @XmlType(name = "Exception", namespace = "http://ws.tririga.com") at the beginning of the class. For example:
@WebFault(name = "Exception", targetNamespace = "http://ws.tririga.com")
@XmlType(name = "Exception", namespace = "http://ws.tririga.com")
public class Exception extends java.lang.Exception {
After you generate the com.tririga.ws.TririgaWSPortType interface, remove the occurrence of java.lang.ObjectFactory from the @XMLSeeAlso annotation. For example:
@WebService(targetNamespace = "http://ws.tririga.com", name = "TririgaWSPortType")
@XmlSeeAlso({com.tririga.ws.dto.gui.ObjectFactory.class, 
ObjectFactory.class, com.tririga.ws.dto.ObjectFactory.class, 
com.tririga.ws.errors.ObjectFactory.class, java.lang.ObjectFactory.class, 
com.tririga.ws.dto.content.ObjectFactory.class})

public interface TririgaWSPortType {

Axis2 Wsdl2Java Stub Generation Tool

If you are using the Axis2 Wsdl2Java stub generation tool, the WSDL starting with IBM TRIRIGA Application Platform version 3.3.1 is different from previous platform versions. Apache CXF adds a ComplexType name on each IBM TRIRIGA Connector for Business Applications operation in the WSDL. This change in the WSDL does not affect Axis2 client code for stubs that were generated in versions of IBM TRIRIGA Application Platform before 3.3.1.
<xsd:element name="runNamedQuery" type="tns:runNamedQuery" /> 
        - <xsd:complexType name="runNamedQuery">
          - <xsd:sequence>
              <xsd:element minOccurs="0" name="projectName" nillable="true" type="xsd:string" /> 
              <xsd:element minOccurs="0" name="moduleName" type="xsd:string" /> 
              <xsd:element minOccurs="0" name="objectTypeName" type="xsd:string" /> 
              <xsd:element minOccurs="0" name="queryName" type="xsd:string" /> 
              <xsd:element name="filters" nillable="true" type="ns0:ArrayOfFilter" /> 
              <xsd:element name="start" type="xsd:int" /> 
              <xsd:element name="maximumResultCount" type="xsd:int" /> 
            </xsd:sequence>
          </xsd:complexType>
            <xsd:element name="runNamedQueryResponse" type="tns:runNamedQueryResponse" /> 
          - <xsd:complexType name="runNamedQueryResponse">
            - <xsd:sequence>
                <xsd:element minOccurs="0" name="out" type="ns0:QueryResult" /> 
            </xsd:sequence>
          </xsd:complexType>
The addition of the ComplexType name on each IBM TRIRIGA Connector for Business Applications operation in the WSDL causes the Axis2 Wsdl2Java stub generation tool to generate stubs in expanded mode. A SoapStruct class and an Element class is created for each IBM TRIRIGA Connector for Business Applications operation. The Element class is appended with the letter E. The following code is an example of client code for generated stubs on Axis2.
//Element class instance.
           com.tririga.ws.TririgaWSStub.RunNamedQueryE runNamedQueryE = 
        	   new com.tririga.ws.TririgaWSStub.RunNamedQueryE(); 

           //SoapStruct bean instance
           com.tririga.ws.TririgaWSStub.RunNamedQuery runNamedQuery =
        	   new com.tririga.ws.TririgaWSStub.RunNamedQuery();

           //Set parameters to SoapStruct bean
           runNamedQuery.setModuleName("Location");
	   runNamedQuery.setQueryName("Location - Find - All Active Building and Floors");

	   //Set the SoapStruct bean to the element class instance.
	   runNamedQueryE.setRunNamedQuery(runNamedQuery);

	   //run stub method
	   stub.runNamedQuery(runNamedQueryE);

Known issues with the Axis2 client code for stubs generated in versions of IBM TRIRIGA Application Platform before 3.3.1

Due to limitations in Apache XFire regarding Java inheritance, the WSDL generated by IBM TRIRIGA Application Platform version 3.3.1 or later is different from previous versions when the Apache CXF framework is used. Starting with IBM TRIRIGA Application Platform version 3.3.1, the WSDL contains an extension element for classes that extend a parent class. The following example from the WSDL includes the extension element.
<xsd:complexType name="QueryResult">
        <xsd:complexContent>
          <xsd:extension base="tns:AbstractQueryResult">
            <xsd:sequence>
              <xsd:element minOccurs="0" name="queryResponseHelpers" nillable="true" type="tns:ArrayOfQueryResponseHelper" /> 
            </xsd:sequence>
          </xsd:extension>
        </xsd:complexContent>
  </xsd:complexType>
The inclusion of this extension element can cause a SubElement error on client calls from a WSDL before IBM TRIRIGA Application Platform version 3.3.1. You can either modify your Axis2 client code or regenerate your Axis2 stubs. The following IBM TRIRIGA Connector for Business Applications class elements can have this issue.
  • Association.
  • ChildRecord.
  • HierarchyObjectType.
  • ObjectType.
  • QueryMultiBoResult.
  • QueryMultBoResponsColumn.
  • QueryResponseHelper.
  • QueryResult.
  • QueryMultiBoResponseHelper.
  • RecordSection.
  • Response.