TrackStudio Enterprise 3.5
Using SOAP from Web Browser

The following topic describes how to use TrackStudio SOAP API from an Web browser.

To use a browser to call TrackStudio SOAP API:

  1. Enable TrackStudio SOAP API
  2. Start TrackStudio Enterprise
  3. To get the WSDL description of the service open the following URL in the browser:
http://<host>:<port>/TrackStudio/services/<service>?wsdl

For example, to get the UserService description open the following URL:

http://localhost:8888/TrackStudio/services/User?wsdl
  1. To perform the authentication open the URL containing the service name, method name and parameters:
http://localhost:8888/TrackStudio/services/User?
     method=authenticate&login=root&password=root

When you do this, you will get the following response:

<soapenv:Envelope>
  <soapenv:Body>
    <authenticateResponse
         soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <authenticateReturn xsi:type="soapenc:string">
         4458443e969146a510b799a6164c68bd
      </authenticateReturn>
    </authenticateResponse>
  </soapenv:Body>
</soapenv:Envelope>
  1. Now we can use the received session ID and load the root task by ID
  • Request:
http://localhost:8888/TrackStudio/services/Find?
                          method=findTaskById&
                          sessionId=4458443e969146a510b799a6164c68bd&
                          taskId=1
  • Response:
<soapenv:Envelope>
  <soapenv:Body>
    <findTaskByIdResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <findTaskByIdReturn href="#id0"/>
    </findTaskByIdResponse>
    <multiRef id="id0" soapenc:root="0"
              soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
              xsi:type="ns1:TaskBean">
    <priorityId xsi:type="soapenc:string">2</priorityId>
    <workflowId xsi:type="soapenc:string">1</workflowId>
    <budget xsi:type="soapenc:double" xsi:nil="true"/>
    <submitdate href="#id1"/>
    <handlerId xsi:type="soapenc:string">1</handlerId>
    <abudget href="#id2"/>
    <childrenCount href="#id3"/>
    <id xsi:type="soapenc:string">1</id>
    <messageCount href="#id4"/>
    <closedate href="#id5"/>
    <name xsi:type="soapenc:string">Projects</name>
    <number xsi:type="soapenc:string">1</number>
    <submitterId xsi:type="soapenc:string">1</submitterId>
    <parentId xsi:type="soapenc:string" xsi:nil="true"/>
    <resolutionId xsi:type="soapenc:string" xsi:nil="true"/>
    <statusId xsi:type="soapenc:string">2</statusId>
    <deadline href="#id6"/>
    <updatedate href="#id7"/>
    <hasAttachments href="#id8"/>
    <description xsi:type="soapenc:string"/>
    <shortname xsi:type="soapenc:string" xsi:nil="true"/>
    <nameCutted xsi:type="soapenc:string">Projects</nameCutted>
    <categoryId xsi:type="soapenc:string">1</categoryId>
    <onSight href="#id9"/>
   </multiRef>

   <multiRef id="id2" soapenc:root="0"
             soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xsi:type="soapenc:double">0.0
   </multiRef>
   <multiRef id="id9" soapenc:root="0"
             soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xsi:type="xsd:boolean">true
   </multiRef>
   <multiRef id="id8" soapenc:root="0"
             soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xsi:type="xsd:boolean">false
   </multiRef>
   <multiRef id="id3" soapenc:root="0"
             soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xsi:type="xsd:int">1
   </multiRef>
   <multiRef id="id5" soapenc:root="0"
             soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xsi:type="xsd:long">-1
   </multiRef>
   <multiRef id="id7" soapenc:root="0"
             soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xsi:type="xsd:long">1099161350000
   </multiRef>
   <multiRef id="id6" soapenc:root="0"
             soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xsi:type="xsd:long">-1
   </multiRef>
   <multiRef id="id4" soapenc:root="0"
             soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xsi:type="xsd:int">0
   </multiRef>
   <multiRef id="id1" soapenc:root="0"
             soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xsi:type="xsd:long">1084368653000
   </multiRef>
  </soapenv:Body>
</soapenv:Envelope>
  1. In case of invalid parameters the Exception is generated:
  • Request:
http://localhost:8888/TrackStudio/services/Find?
                          method=findTaskById&
                          sessionId=4458443e969146a510b799a6164c68bd&
                          taskId=10
  • Response:
<soapenv:Envelope>
  <soapenv:Body>
    <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>
         gran.exception.TaskNotFoundException: Specified task not found.
      </faultstring>
      <detail>
        <ns1:stackTrace>
          gran.exception.TaskNotFoundException: Specified task not found.
             at com.trackstudio.tools.HibernateUtil.getObject(HibernateUtil.java:404)
        </ns1:stackTrace>
        <ns2:hostname>trackstu-server</ns2:hostname>
      </detail>
    </soapenv:Fault>
  </soapenv:Body>
</soapenv:Envelope>