Tips for client creation
You can create client stubs in IBM® Maximo® Real Estate and Facilities 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, Apache CXF adds a ComplexType name on
each IBM
Maximo Real Estate and Facilities Connector for Business
Applications operation in the WSDL.
<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
Maximo Real Estate and Facilities 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
Maximo Real Estate and Facilities 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);