![]() |
|
|
SOAP interface to FITAbout this DocumentThis document is aimed at developers. It explains the WSDL/SOAP interface to FIT. Using the calls defined in this document, a developer can quickly query, create and update issues within the FIT system. This document assumes some familiarity with XML and SOAP. You should also be at lease somewhat familiar with FIT, and the data stored within. Setting up Perl/SOAP-Lite on Windows...
Configure FBT to enable SOAP InterfaceAdmin Menu WSDL ExplainedWSDL: WSDL stands for Web Service Description Language, and it defines all of the web service requests and responses that can be made to FBT. There are 4 basic opertions that can be performed through the web interface:
Before executing any examples in this document, or using any soap functionality, you must enable SOAP within FIT (it is disabled by default). Enable SOAP from "Admin Menu", "SOAP Functions" and check "Enable SOAP" checkbox and press the submit button. NOTE: FIT will dynamically generate a custom .wsdl file based on how your instance of FIT is configured (ie. If you have custom fields, they will be added to your wsdl file. All of our examples in this document assume the stock FIT installation. You can view the .wsdl file by going to http://localhost:10000/FIT.wsdl (assuming you are on the same machine as FIT is running on... Replace localhost with the name of the machine running FIT. General ConventionsField names within FIT are prefixed with "m", and "camelcase" is used for field naming conventions (capitalize the beginning of each word). Example: the Id field is mId, the Date Last Modified field is mDateLastModified. Viewing the source HTML of pages such as the ViewBug and Filter pages allows you to look up a specific field name. All of the examples provided are using Perl and SOAP::Lite (a Perl module). We're using this for our examples because: Perl and SOAP::Lite are available for just about every operating system, and they're free. While we're using Perl, most modern programming languages have web service modules / libraries that should work fine with FIT. Customers with any questions about compatibility and/or would like examples for platforms can email fit@alceatech.com for additional information. getIdDescriptionThis function is similar to the filter function - returning the data that you would see on the MainMenu. Sample Perl CodeThe following Perl code retrieves the details of bug 10 from the system. We turn full debug on, to display both the raw data that we send to FIT, and display the raw data received in response.
#!/usr/bin/perl
use SOAP::Lite;
print SOAP::Lite
->service("http://localhost:10000/FIT.wsdl")
-> on_debug(sub{print@_})
-> getId(SOAP::Data->name("mId" => "10"));
InputWe can see that the following SOAP message is sent to FIT:
POST http://localhost:10000
Accept: text/xml
Accept: multipart/*
Content-Length: 448
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://localhost:10000/getId"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<getId xmlns="">
<mId xsi:type="xsd:int">10</mId>
</getId>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
OutputThe details of the bug are returned. The contents are contained in a bugStruct element, which in turn contains all of the current (non-history) fields, plus bugEntry structures for each update to the bug. Each bugEntry contains the values that were provided in those updates. Sample output from the perl call:
HTTP/1.1 200 OK
Content-Length: 1919
Content-Type: text/xml; charset=utf-8
Client-Date: Tue, 21 Oct 2003 02:38:11 GMT
Client-Peer: 127.0.0.1:10000
Client-Response-Num: 1
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<bugStruct>
<mId>10</mId>
<mSubject>performance @ Aktiom ... Server timing ...</mSubject>
<mDateEntered>Tue Sep 16 00:13:23 EDT 2003</mDateEntered>
<mCurrentStatus>Closed</mCurrentStatus>
<mCurrentAssignedTo>cjustus</mCurrentAssignedTo>
<mLastModifiedBy>cjustus</mLastModifiedBy>
<mDateLastModified>Mon Sep 22 21:55:12 EDT 2003</mDateLastModified>
<mEnteredBy>cjustus</mEnteredBy>
<mPriority>3</mPriority>
<mProject>Aktiom</mProject>
<mArea>area</mArea>
<mVersion></mVersion>
<mEnvironment></mEnvironment>
<mParent>0</mParent>
<mRequestedDueDate>null</mRequestedDueDate>
<mActualCompletionDate>null</mActualCompletionDate>
<mEstimatedHours>0.0</mEstimatedHours>
<mActualHours>0.0</mActualHours>
<mPercentComplete>0.0</mPercentComplete>
<bugHistory>
<bugEntry>
<mAssignedTo>cjustus</mAssignedTo>
<mWho>cjustus</mWho>
<mStatus>Open</mStatus>
<mWhen>Tue Sep 16 00:13:23 EDT 2003</mWhen>
<mDescription></mDescription>
</bugEntry>
<bugEntry>
<mAssignedTo>cjustus</mAssignedTo>
<mWho>cjustus</mWho>
<mStatus>Closed</mStatus>
<mWhen>Mon Sep 22 21:55:12 EDT 2003</mWhen>
<mDescription>istop issue...</mDescription>
</bugEntry>
</bugHistory>
</bugStruct>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
getBugListDescriptionThis function is the SOAP call equivalent to running a filter. Critera submitted via the soap call will return a filtered list of issues. Sample Perl CodeThe following Perl code shows how to enter filter criteria with SOAP. Take note of the method in which custom fields are entered. The custom field ID numbers can be found on the Admin Menu -> Custom Field page.
#!/usr/bin/perl
use SOAP::Lite;
print SOAP::Lite
->service("http://localhost:10000/FIT.wsdl")
-> on_debug(sub{print@_})
-> getBugList(SOAP::Data->name("mPriority" => "1"),
SOAP::Data->name("mPriorityOp" => "="),
SOAP::Data->name("mPriorityAndOr" => "OR"),
SOAP::Data->name("mPriority2" => "2"),
SOAP::Data->name("mPriority2Op" => "="));
SOAP::Data->name("filterCustomFields" =>
\SOAP::Data->value(SOAP::Data->name("filterCustomField" =>
\SOAP::Data->value(SOAP::Data->name("Id" => "5"),
SOAP::Data->name("Op" => ">="),
SOAP::Data->name("Value" => "2005/05/5"),
SOAP::Data->name("AndOr" => "and"),
SOAP::Data->name("Op2" => "<="),
SOAP::Data->name("Value2" => "2005/05/15"))))));
InputWe can see that the following SOAP message is sent to FIT:
POST http://localhost:10000
Accept: text/xml
Accept: multipart/*
Content-Length: 766
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://localhost:10000/newBug"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<getBugList xmlns="">
<mPriority xsi:type="xsd:int">1</mPriority>
<mPriorityOp xsi:type="xsd:string">=</mPriorityOp>
<mPriorityAndOr xsi:type="xsd:string">OR</mPriorityAndOr>
<mPriority2 xsi:type="xsd:int">2</mPriority2>
<mPriority2Op xsi:type="xsd:string">=</mPriority2Op>
<filterCustomFields>
<filterCustomField>
<Id xsi:type="xsd:int">5</Id>
<Op xsi:type="xsd:string">>=</Op>
<Value xsi:type="xsd:string">2005/05/5</Value>
<AndOr xsi:type="xsd:string">and</AndOr>
<Op2 xsi:type="xsd:string"><=</Op2>
<Value2 xsi:type="xsd:string">2005/05/15</Value2>
</filterCustomField>
</filterCustomFields>
</getBugList>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
OutputA list of filtered bugs are returned. The results are a set of bugStruct elements contained in a bugList element. Sample output from the perl call:
HTTP/1.1 200 OK
Content-Length: 1919
Content-Type: text/xml; charset=utf-8
Client-Date: Tue, 21 Oct 2003 02:38:11 GMT
Client-Peer: 127.0.0.1:10000
Client-Response-Num: 1
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<bugList>
<bugStruct>
<mId>13</mId>
<mSubject>test</mSubject>
<mCurrentAssignedTo>birdman</mCurrentAssignedTo>
<mDateLastModified>Fri May 13 16:10:00 EDT 2005</mDateLastModified>
<mCurrentStatus>Open</mCurrentStatus>
<mPriority>1</mPriority>
<mDateEntered>Fri May 13 16:10:00 EDT 2005</mDateEntered>
<mEnteredBy>jsimpson</mEnteredBy>
<mProject>SYSTEM</mProject>
<mArea></mArea>
<mVersion></mVersion>
<mEnvironment></mEnvironment>
<mRequestedDueDate></mRequestedDueDate>
<mActualCompletionDate></mActualCompletionDate>
<mEstimatedHours>0.0</mEstimatedHours>
<mActualHours>0.0</mActualHours>
<mPercentComplete>0.0</mPercentComplete>
<mParent>0</mParent>
<mLastModifiedBy>jsimpson</mLastModifiedBy>
<mElapsedTime>0</mElapsedTime>
<mNotifyList></mNotifyList>
<mRejectedCount>0</mRejectedCount>
<mRankCache>0.0</mRankCache>
<bugHistory>
<bugEntry>
<mAssignedTo>birdman</mAssignedTo>
<mWho>jsimpson</mWho>
<mStatus>Open</mStatus>
<mWhen>Fri May 13 16:10:00 EDT 2005</mWhen>
<mDescription>Test bug</mDescription>
</bugEntry>
</bugHistory>
</bugStruct>
</bugList>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
newBugDescriptionThis function mirrors the functionality of the New Issue screen. A new bug will be created using the data from any field values submitted via the SOAP call. The new bug's ID is returned. Sample Perl CodeThe following Perl code shows how to enter a new bug with SOAP. Fields that are not included will be set to empty in the newly created bug. Take note of the method in which custom fields are entered. The custom field ID numbers can be found on the Admin Menu -> Custom Field page.
#!/usr/bin/perl
use SOAP::Lite;
print SOAP::Lite
->service("http://localhost:10000/FIT.wsdl")
-> on_debug(sub{print@_})
-> newBug(SOAP::Data->name("mSubject" => "Testing SOAP: newBug call"),
SOAP::Data->name("mDescription" => "This will enter a new bug into the system."),
SOAP::Data->name("mAssignedTo" => "admin"),
SOAP::Data->name("customFields" =>
\SOAP::Data->value(SOAP::Data->name("customField" =>
\SOAP::Data->value(SOAP::Data->name("Id" => "3"),
SOAP::Data->name("Value" => "SOAP UPDATE")))),
SOAP::Data->value(SOAP::Data->name("customField" =>
\SOAP::Data->value(SOAP::Data->name("Id" => "4"),
SOAP::Data->name("Value" => "SOAP UPDATE"))))));
InputWe can see that the following SOAP message is sent to FIT:
POST http://localhost:10000
Accept: text/xml
Accept: multipart/*
Content-Length: 766
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://localhost:10000/newBug"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<newBug xmlns="">
<mSubject xsi:type="xsd:string">Testing SOAP: newBug call</mSubject>
<mDescription xsi:type="xsd:string">
OutputThe new bug's ID is returned in a FITMessage element. Sample output from the perl call:
HTTP/1.1 200 OK
Content-Length: 1919
Content-Type: text/xml; charset=utf-8
Client-Date: Tue, 21 Oct 2003 02:38:11 GMT
Client-Peer: 127.0.0.1:10000
Client-Response-Num: 1
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<FBTmessage>Bug 13 has been created.</FBTmessage>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
updateBugDescriptionThis function works the same as the newBug call. In addition to other fields, the mId field is set to the ID of the bug that will be updated. Fields that are not set in the SOAP call will remain unchanged.
|
SYSTEM INFO
INSTALLATION GUIDE USER GUIDE
ADMIN GUIDE |
|
© 1997-2007| ALCEA TECHNOLOGIES INC. - All Rights Reserved For more information inquire here or email us at fit@alceatech.com. 1-877-321-4463 Head Office |