<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: Example code on how to use spira Team web services (Thread)</title><description>&#xD;
I have found the WSDL of the spira Team web services. I notice that it contains numerous get methods and two authentication methods. It  would be helpful to have a document to say how to use the web services in general.  Eg open a connection using either of these methods. Then call your methods to get your data then close the connection.  Specifically I want to get all the incident number, descriptions for the incidents fixed in a specific release so I can generate some release notes. So I need to do what? &#xD;
&#xD;
</description><language>en-US</language><copyright>(C) Copyright 2006-2026 Inflectra Corporation.</copyright><managingEditor>support@inflectra.com</managingEditor><category domain="http://www.dmoz.org">/Computers/Software/Project_Management/</category><category domain="http://www.dmoz.org">/Computers/Software/Quality_Assurance/</category><generator>KronoDesk</generator><a10:contributor><a10:email>support@inflectra.com</a10:email></a10:contributor><a10:id>http://www.inflectra.com/kronodesk/forums/threads</a10:id><ttl>120</ttl><link>/Support/Forum/spirateam/issues-questions/298.aspx</link><item><guid isPermaLink="false">threadId=298</guid><author>Alan Heath (alan.heath@edgeipk.com)</author><title>Example code on how to use spira Team web services</title><description>&#xD;
I have found the WSDL of the spira Team web services. I notice that it contains numerous get methods and two authentication methods. It  would be helpful to have a document to say how to use the web services in general.  Eg open a connection using either of these methods. Then call your methods to get your data then close the connection.  Specifically I want to get all the incident number, descriptions for the incidents fixed in a specific release so I can generate some release notes. So I need to do what? &#xD;
&#xD;
</description><pubDate>Wed, 04 Jul 2012 13:07:11 -0400</pubDate><a10:updated>2012-07-11T14:05:00-04:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/298.aspx</link></item><item><guid isPermaLink="false">messageId=581</guid><author>David J (adam.sandman+support@inflectra.com)</author><title> &#xD;
&#xD;
&#xD;
Hi Alan  We've typed up a quick KB article for you -  https://www.inflectra.com/Support/Knowl</title><description> &#xD;
&#xD;
&#xD;
Hi Alan  We've typed up a quick KB article for you -  https://www.inflectra.com/Support/KnowledgeBase/KB3.aspx   Let us know if you have any questions. </description><pubDate>Thu, 05 Jul 2012 18:22:46 -0400</pubDate><a10:updated>2012-07-05T18:22:46-04:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/298.aspx#reply581</link></item><item><guid isPermaLink="false">messageId=593</guid><author>Alan Heath (alan.heath@edgeipk.com)</author><title>&#xD;
Thanks Adam that was helpful. I have replicated your c# code in java. I used eclipse and axis to c</title><description>&#xD;
Thanks Adam that was helpful. I have replicated your c# code in java. I used eclipse and axis to convert the WSDL into java stubs then called those stubs as follows.  import java.rmi.RemoteException;  import javax.xml.rpc.ServiceException;  import org.datacontract.schemas._2004._07.Inflectra_SpiraTest_Web_Services_v3_0.ServiceFaultMessage; import org.datacontract.schemas._2004._07.Inflectra_SpiraTest_Web_Services_v3_0_DataObjects.RemoteFilter; import org.datacontract.schemas._2004._07.Inflectra_SpiraTest_Web_Services_v3_0_DataObjects.RemoteIncident; import org.datacontract.schemas._2004._07.Inflectra_SpiraTest_Web_Services_v3_0_DataObjects.RemoteRelease; import org.datacontract.schemas._2004._07.Inflectra_SpiraTest_Web_Services_v3_0_DataObjects.RemoteSort;  import com.inflectra.www.SpiraTest.Services.v3_0.IImportExport; import com.inflectra.www.SpiraTest.Services.v3_0.ImportExportLocator;  public class SpiraTeamClient {     /**      * Print the release notes for a particular release.      *       * @param p_projectId the project id, in SpiraTeam if a project is PR000062 then use 62       * @param p_releaseVersion the release Version, in spiraTeam is shown as Version #       * @param p_user user name used for authentication      * @param p_passwd password used for authentication      * @throws ServiceException      * @throws ServiceFaultMessage      * @throws RemoteException      */     private static void printReleaseNotes(int p_projectId, String p_releaseVersion, String p_user, String p_passwd) throws ServiceException, ServiceFaultMessage, RemoteException     {         int releaseId = 0; // spira team release id         IImportExport spiraImportExport = null;         try         {             ImportExportLocator spiraTeamLocator = new ImportExportLocator();             spiraTeamLocator.setMaintainSession(true); // enable cookies             spiraTeamLocator.setEndpointAddress(spiraTeamLocator.getBasicHttpBinding_IImportExportWSDDServiceName(), spiraTeamLocator.getBasicHttpBinding_IImportExportAddress());             spiraImportExport = spiraTeamLocator.getBasicHttpBinding_IImportExport();             spiraImportExport.connection_Authenticate(p_user, p_passwd);             spiraImportExport.connection_ConnectToProject(p_projectId);                          // get the release id             RemoteFilter[] releaseFilters = new RemoteFilter[1];             releaseFilters[0] = getStringFilter("VersionNumber", p_releaseVersion);             RemoteRelease[] releases = spiraImportExport.release_Retrieve2(releaseFilters, 1, 4);             if (releases.length != 1)             {                 System.err.println("Web service found " + releases.length + " releases for version: " + String.valueOf(p_releaseVersion));                 return;             }             releaseId = releases[0].getReleaseId();                          // only want incidents resolved in a single release             RemoteFilter[] incidentFilters = new RemoteFilter[1];             incidentFilters[0] = getIntFilter("ResolvedReleaseId", releaseId);                          // want the list of incidents sorted by Incident number, lowest             // incident number first             RemoteSort remoteSort = new RemoteSort();             remoteSort.setPropertyName("IncidentId");             remoteSort.setSortAscending(true);                          // make the web service call to get the incidents             RemoteIncident[] remoteIncidents = spiraImportExport.incident_Retrieve(incidentFilters, remoteSort, 1, 9999);                          // Loop through and display ID, and name             for (RemoteIncident remoteIncident : remoteIncidents)             {                 System.out.print(remoteIncident.getIncidentId().toString());                 System.out.print("  ");                 System.out.println(remoteIncident.getName().toString());             }         }         finally         {             if (spiraImportExport != null)             {                 spiraImportExport.connection_Disconnect(); // tidy up             }         }     }          private static RemoteFilter getStringFilter(String p_name, String p_value)     {         RemoteFilter filter = new RemoteFilter();         filter.setPropertyName(p_name);         filter.setStringValue(p_value);         return filter;     }          private static RemoteFilter getIntFilter(String p_name, int p_value)     {         RemoteFilter filter = new RemoteFilter();         filter.setPropertyName(p_name);         filter.setIntValue(p_value);         return filter;     }          public static void main(String[] args) throws Exception     {         int projectId = 28    // PR000028;           String user = "username";         String passwd = "password";         String releaseVersion = "2.1.0__13";  // Version #         if (args.length == 1)         {             releaseVersion = args[0];         }          printReleaseNotes(projectId, releaseVersion, user, passwd);     }           } &#xD;
&#xD;
</description><pubDate>Wed, 11 Jul 2012 14:05:00 -0400</pubDate><a10:updated>2012-07-11T14:05:00-04:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/298.aspx#reply593</link></item></channel></rss>