XOG WSDL

Each XOG service includes a Web Service Description Language (WSDL) file that is downloadable from the installation. The WSDL describes the available XOG services and how to communicate with them.
ccppmop142
Each XOG service includes a Web Service Description Language (WSDL) file that is downloadable from the installation. The WSDL describes the available XOG services and how to communicate with them.
Contents
Access the WSDL
You can access the XOG WSDL on the 
CA PPM
application server at the following URL:
http://<servername:port>/niku/wsdl
The WSDL page is an HTML page with a list of XOG service categories. The XOG services that are listed on the WSDL page are included in the InvokeAction, Query, and Object categories. You can display a list of all included services by clicking a category link. For example, if you click InvokeAction, you see the FlushCache and Process services. Each service includes these links:
  • Service name
    . Enables an HTML page that contains the WSDL to display.
  • Save As
    . Enables the WSDL to download as an XML file so that you can save it to disk.
This figure shows the links for the services that are available under InvokeAction:
This figure illustrates the links for the services available under InvokeAction.
WSDL Viewers
Many tools exist that you can use to improve the readability and display of the WSDL. For example, there are stand-alone viewers and Enterprise Application Integration (EAI) software that map data from one system to another. For more information about web services and WSDL, see the W3C website.
WDSL Emitter Tools
A client program connecting to the XOG can read the WSDL to determine what functions are available on the server. Any special data types that are used are embedded in the WSDL file in the form of XML Schema. The XOG WSDL has been validated against these platforms:
  • Apache AXIS 1.3
  • Microsoft Visual Studio 2005 (.NET)
These emitter tools can interpret the XOG WSDL to enable communication with 
CA PPM
 as a web service. Because the XOG WSDL is compatible with AXIS and .NET, these emitter tools generate an accurate and usable proxy API from the XOG WSDL. This facilitates interaction with the XOG services within the context of AXIS or .NET.
Access the Object WSDL
Follow these steps:
  1. Use this URL to go to the Server page that lists the XOG Object services:
    http://<servername:port>/niku/wsdl/Object
  2. Click an object link such as Project to access the Project WSDL. Click the
     
    All Objects link to access the WSDL for all objects from a single page.
Access the InvokeAction WSDL Service Category
Follow these steps:
  1. Use this URL to go to the Server page that lists the XOG InvokeAction services:
    http://<servername:port>/niku/wsdl/InvokeAction
  2. Click FlushCache or Process to access the corresponding WSDL.
Example: Process WSDL
This example illustrates the WSDL for the Process service:
<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.niku.com/xog/InvokeAction" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" name="InvokeActionProcess" targetNamespace="http://www.niku.com/xog/InvokeAction"> <types> <xsd:schema elementFormDefault="qualified" targetNamespace="http://www.niku.com/xog/InvokeAction"> <xsd:complexType name="Process"> <xsd:sequence> <xsd:element name="code" type="xsd:string" minOccurs="1" maxOccurs="1"/> <xsd:element name="request" minOccurs="0" maxOccurs="1"> <xsd:complexType> <xsd:sequence> <xsd:any/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:element name="Process" type="tns:Process"/> <xsd:element name="Auth"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="0" name="SessionID" type="xsd:string"/> <xsd:element minOccurs="0" name="Username" type="xsd:string"/> <xsd:element minOccurs="0" name="Password" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="Login"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="1" name="Username" type="xsd:string"/> <xsd:element minOccurs="0" name="Password" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="SessionID" type="xsd:string"/> <xsd:element name="Logout"> <xsd:complexType> <xsd:sequence> <xsd:element maxOccurs="1" minOccurs="0" name="SessionID" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </types> <message name="Process"> <part element="tns:Process" name="body"/> <part element="tns:Auth" name="header"/> </message> <message name="Auth"> <part element="tns:Auth" name="header"/> </message> <message name="Login"> <part element="tns:Login" name="parameters"/> </message> <message name="LoginResponse"> <part element="tns:SessionID" name="body"/> </message> <message name="Logout"> <part element="tns:Logout" name="parameters"/> </message> <portType name="ProcessPort"> <operation name="Process"> <input message="tns:Process"/> </operation> <operation name="Login"> <input message="tns:Login"/> <output message="tns:LoginResponse"/> </operation> <operation name="Logout"> <input message="tns:Logout"/> </operation> </portType> <binding name="ProcessSoapBinding" type="tns:ProcessPort"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="Process"> <soap:operation soapAction="http://www.niku.com/xog/InvokeAction/Process" style="document"/> <input> <soap:body parts="body" use="literal"/> <soap:header message="tns:Auth" part="header" use="literal"/> </input> </operation> <operation name="Login"> <soap:operation soapAction="http://www.niku.com/xog/InvokeAction/Login" style="document"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> <operation name="Logout"> <soap:operation soapAction="http://www.niku.com/xog/InvokeAction/Logout" style="document"/> <input> <soap:body use="literal"/> </input> </operation> </binding> <service name="ProcessService"> <documentation>Invoke Action Process Service </documentation> <port binding="tns:ProcessSoapBinding" name="ProcessService"> <soap:address location="http://<servername:port>//xog"/> </port> </service> </definitions>
 <xsd any> and Process WSDL
The request and response types of the Object WSDL are defined as <xsd:any> as illustrated in the Process WSDL example. However, the schema of these request/response types must  be consistent with the corresponding XOG Object schema (as seen in the .xsd file). This example shows the SOAP representation of the Project object WSDL for the ReadProject operation. The
bolded DataBus document
shows the correct representation of the DataBus <xsd:any> type.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<Auth xmlns="http://www.niku.com/xog/Object">
<SessionID>5000156__171120a:10a241ff830:-7f711143139816999</SessionID>
</Auth>
</soap:Header>
<soap:Body>
<ReadProject xmlns="http://www.niku.com/xog/Object">
<DataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/xog_read.xsd" xmlns="">
<Header version="12.0.0.5028" externalSource="NIKU" />
<Query>
<Filter name="subject" criteria="EQUALS">admin</Filter>
</Query>
</DataBus>
</ReadProject>
</soap:Body>
</soap:Envelope>
Access the Query WSDL
The WSDL for queries is not prepackaged. A WSDL for a query only exists if you created an NSQL query in Studio. Depending on the number of NSQL queries already defined in Studio, you will see the corresponding numbers of WSDLs.
Follow these steps:
  1. Use the following URL to go to the Server page that lists the XOG Query services:
    http://<servername:port>/niku/wsdl/Query
  2. Click a query type link to access the corresponding WSDL.
Example: Demand for Resource Query WSDL
This example illustrates the WSDL for the Demand for Resource query service:
<definitions xmlns:tns="http://www.niku.com/xog/Query" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" name="DemandforResourceQuery" targetNamespace="http://www.niku.com/xog/Query"> <types> <xsd:schema elementFormDefault="qualified" targetNamespace="http://www.niku.com/xog/Query"> <xsd:complexType name="DemandforResourceFilter"> <xsd:sequence> <xsd:element maxOccurs="1" minOccurs="0" name="actual_hours" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="actual_hours_from" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="actual_hours_to" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="allocated_hours" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="allocated_hours_from" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="allocated_hours_to" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="estimated_effort" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="estimated_effort_from" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="estimated_effort_to" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="resource_name" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="resource_name_from" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="resource_name_to" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="resource_name_wildcard" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="resource_id" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="resource_id_from" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="resource_id_to" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="calendar_time_key" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="calendar_time_key_from" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="calendar_time_key_to" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="calendar_time_key_wildcard" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="calendar_time_level" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="calendar_time_level_from" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="calendar_time_level_to" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="calendar_time_level_wildcard" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="calendar_time_label" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="calendar_time_label_from" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="calendar_time_label_to" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="calendar_time_label_wildcard" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="DemandforResourceQuery"> <xsd:sequence> <xsd:element maxOccurs="1" minOccurs="1" name="Code" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="Filter" type="tns:DemandforResourceFilter"/> </xsd:sequence> </xsd:complexType> <xsd:element name="Query" type="tns:DemandforResourceQuery"/> <xsd:complexType name="DemandforResourceRecord"> <xsd:sequence> <xsd:element maxOccurs="1" minOccurs="1" name="actual_hours" type="xsd:decimal"/> <xsd:element maxOccurs="1" minOccurs="1" name="allocated_hours" type="xsd:decimal"/> <xsd:element maxOccurs="1" minOccurs="1" name="estimated_effort" type="xsd:decimal"/> <xsd:element maxOccurs="1" minOccurs="1" name="resource_name" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="1" name="resource_id" type="xsd:long"/> <xsd:element maxOccurs="1" minOccurs="1" name="calendar_time_key" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="1" name="calendar_time_level" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="1" name="calendar_time_label" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="DemandforResourceRecords"> <xsd:sequence> <xsd:element maxOccurs="unbounded" minOccurs="0" name="Record" type="tns:DemandforResourceRecord"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="DemandforResourceQueryResult"> <xsd:sequence> <xsd:element maxOccurs="1" minOccurs="1" name="Code" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="1" name="Records" type="tns:DemandforResourceRecords"/> </xsd:sequence> </xsd:complexType> <xsd:element name="QueryResult" type="tns:DemandforResourceQueryResult"/> <xsd:element name="Auth"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="0" name="SessionID" type="xsd:string"/> <xsd:element minOccurs="0" name="Username" type="xsd:string"/> <xsd:element minOccurs="0" name="Password" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="Login"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="1" name="Username" type="xsd:string"/> <xsd:element minOccurs="0" name="Password" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="SessionID" type="xsd:string"/> <xsd:element name="Logout"> <xsd:complexType> <xsd:sequence> <xsd:element maxOccurs="1" minOccurs="0" name="SessionID" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </types> <message name="Query"> <part element="tns:Query" name="body"/> <part element="tns:Auth" name="header"/> </message> <message name="QueryResult"> <part element="tns:QueryResult" name="body"/> </message> <message name="Auth"> <part element="tns:Auth" name="header"/> </message> <message name="Login"> <part element="tns:Login" name="parameters"/> </message> <message name="LoginResult"> <part element="tns:SessionID" name="body"/> </message> <message name="Logout"> <part element="tns:Logout" name="parameters"/> </message> <portType name="DemandforResourceQueryPort"> <operation name="Query"> <input message="tns:Query"/> <output message="tns:QueryResult"/> </operation> <operation name="Login"> <input message="tns:Login"/> <output message="tns:LoginResult"/> </operation> <operation name="Logout"> <input message="tns:Logout"/> </operation> </portType> <binding name="DemandforResourceQuerySoapBinding" type="tns:DemandforResourceQueryPort"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="Query"> <soap:operation soapAction="http://www.niku.com/xog/Query/DemandforResource" style="document"/> <input> <soap:body parts="body" use="literal"/> <soap:header message="tns:Auth" part="header" use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> <operation name="Login"> <soap:operation soapAction="http://www.niku.com/xog/Query/Login" style="document"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> <operation name="Logout"> <soap:operation soapAction="http://www.niku.com/xog/Query/Logout" style="document"/> <input> <soap:body use="literal"/> </input> </operation> </binding> <service name="DemandforResourceQueryService"> <documentation>Demand for Resource Query Service </documentation> <port binding="tns:DemandforResourceQuerySoapBinding" name="DemandforResourceQueryService"> <soap:address location="http://<servername:port>//xog"/> </port> </service> </definitions>
Example: Microsoft Visual Studio (.NET)
This example is a client-side Windows Form that is written in .NET Visual Basic that uses the ClarityDotNetXOG API to invoke the FlushCache XOG service on a Button Click event:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim xog As ClarityDotNetXOG xog = New ClarityDotNetXOG xog.Username = "admin" xog.Password = "admin" Dim ids(0 To 1) As String Dim groups(0 To 1) As String ids(0) = "ConfigurationProperties" groups(0) = "Resources" xog.FlushCache(ids, groups) MessageBox.Show("Flush Cache Complete") End Sub
Generate Supporting API
Both Apache AXIS and Microsoft Visual Studio have emitter tools that generate proxy classes that are based on service descriptions that conform to the WSDL.
Generate a Proxy API from Axis
The emitter tool that is packaged with Apache AXIS is WSDL2Java. This example shows how to initiate this tool from the command line against the All Objects XOG WSDL.
java -cp lib\wsdl4j-1.5.1.jar;lib\commons-discovery-0.2.jar;lib\axis.jar;lib\log4j-1.2.8.jar;lib\commons-logging-1.0.4.jar;lib\jaxrpc.jar org.apache.axis.wsdl.WSDL2Java -W [url]
You must include the -W flag when generating the proxy API from the XOG WSDL definitions. This flag indicates that the WSDL is the document/literal style. If you do not include the -W flag, it is assumed that the WSDL is the wrapped/literal style, which is incorrect. If you do not include this flag, an error is thrown in the proxy generation but the resulting API will cause runtime errors when trying to communicate with the XOG interfaces.
The default output location of the proxy files follows the namespace convention that is defined in the WSDL. Because the targetNamespace that is defined in the All Object WSDL is
http://www.niku.com/xog/Object
, the resulting proxy classes from the command-line request reside in D:\axis\com\niku\www\xog\Object.
Add a Web Reference from Microsoft Visual Studio
The emitter tool that is packaged with Microsoft Visual Studio is implemented as a web reference. The reference is developed from within a project that is within the Microsoft Visual Studio user interface.
Follow these steps:
  1. From Project, select Add Web Reference.
  2. In URL, enter the desired XOG WSDL URL and click Go.
    The WSDL is located.
  3. In Web Reference Name, enter a name for the service and click Add Reference.
    The generated proxy API for the
    All Objects
    Web Reference is on the left side of the page. This enables a developer to communicate programmatically with the services that are defined in the
    All Objects
    Web Reference.