<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: Unable to retrieve testcase steps via SOAP (Thread)</title><description>Hi,   i'm trying to create a custom export for our testcases in spiratest 4.0. However, when trying to retrieve the teststeps from a testcase using soap, I get a null value instead of the actual step.  Does anyone have a clue (or even better, a solution) on what's going wrong here?  Thank you! Johan Laebens   I'm using the following code:   import java.net.MalformedURLException; import java.net.URL; import java.util.List; import java.util.Map;  import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; import javax.xml.ws.BindingProvider;  import com.inflectra.spirateam.mylyn.core.internal.services.soap.ArrayOfRemoteTestCase; import com.inflectra.spirateam.mylyn.core.internal.services.soap.IImportExport; import com.inflectra.spirateam.mylyn.core.internal.services.soap.IImportExportConnectionAuthenticateServiceFaultMessageFaultFaultMessage; import com.inflectra.spirateam.mylyn.core.internal.services.soap.IImportExportConnectionConnectToProjectServiceFaultMessageFaultFaultMessage; import com.inflectra.spirateam.mylyn.core.internal.services.soap.IImportExportConnectionDisconnectServiceFaultMessageFaultFaultMessage; import com.inflectra.spirateam.mylyn.core.internal.services.soap.IImportExportTestCaseRetrieveByFolderServiceFaultMessageFaultFaultMessage; import com.inflectra.spirateam.mylyn.core.internal.services.soap.ImportExport; import com.inflectra.spirateam.mylyn.core.internal.services.soap.RemoteTestCase; import com.inflectra.spirateam.mylyn.core.internal.services.soap.RemoteTestStep;  public class SpiraTest {      private static final String WEB_SERVICE_SUFFIX = "/Services/v4_0/ImportExport.svc"; //$NON-NLS-1$     private static final String WEB_SERVICE_NAMESPACE = "{https://www.inflectra.com/SpiraTest/Services/v4.0/}ImportExport"; //$NON-NLS-1$     private static final String WEB_SERVICE_NAMESPACE_DATA_OBJECTS = "http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v4_0.DataObjects"; //$NON-NLS-1$       /**      * @param args      * @throws MalformedURLException       * @throws IImportExportConnectionAuthenticateServiceFaultMessageFaultFaultMessage       */     public static void main(String[] args) throws MalformedURLException, IImportExportConnectionAuthenticateServiceFaultMessageFaultFaultMessage {         String baseUrl = "THE_CORRECT_URL";         URL serviceUrl = new URL(baseUrl  + WEB_SERVICE_SUFFIX);         ImportExport service = new ImportExport(serviceUrl, QName.valueOf(WEB_SERVICE_NAMESPACE));         IImportExport soap = service.getBasicHttpBindingIImportExport();          Map  requestContext = ((BindingProvider)soap).getRequestContext();         requestContext.put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);          boolean success = soap.connectionAuthenticate("CORRECT_USERNAME", "CORRECT_PASSWORD");                  System.out.println(success); // returns true                  try {             boolean connectedToProject = soap.connectionConnectToProject(18); // certain project which does exist             System.out.println(connectedToProject);                          ArrayOfRemoteTestCase testcases = new ArrayOfRemoteTestCase();             testcases = soap.testCaseRetrieveByFolder(8271); // folder exists             List  remoteTestcases = testcases.getRemoteTestCase();             for (int i=0;i  getTestCaseId = remoteTestcases.get(i).getTestCaseId();                 System.out.println(getTestCaseId.getValue()); // I can see all the testcasenames &gt;&gt; OK                  // This should work but somehow, the getTestSteps() is null                 List  allesInEen = remoteTestcases.get(i).getTestSteps().getValue().getRemoteTestStep();                 for (int j=0;j &gt; " + allesInEen.get(j).getDescription());                     System.out.println("&gt;&gt; " + allesInEen.get(j).getExpectedResult());                     System.out.println("&gt;&gt; " + allesInEen.get(j).getSampleData());                 }             }                       } catch (IImportExportTestCaseRetrieveByFolderServiceFaultMessageFaultFaultMessage e) {             e.printStackTrace();         } // http://spiratest.hq.ebit.be/SpiraTest/18/TestCase/8270.aspx         catch (IImportExportConnectionConnectToProjectServiceFaultMessageFaultFaultMessage e) {             e.printStackTrace();         }         finally         {             try {                 soap.connectionDisconnect();             } catch (IImportExportConnectionDisconnectServiceFaultMessageFaultFaultMessage e) {                 e.printStackTrace();             }         }     } }    

</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/spiratest/issues-questions/826.aspx</link><item><guid isPermaLink="false">threadId=826</guid><author>Johan Laebens (johan.laebens@ebit.be)</author><category domain="http://www.inflectra.com/kronodesk/thread/tag">soap</category><category domain="http://www.inflectra.com/kronodesk/thread/tag"> api</category><category domain="http://www.inflectra.com/kronodesk/thread/tag"> test steps</category><title>Unable to retrieve testcase steps via SOAP</title><description>Hi,   i'm trying to create a custom export for our testcases in spiratest 4.0. However, when trying to retrieve the teststeps from a testcase using soap, I get a null value instead of the actual step.  Does anyone have a clue (or even better, a solution) on what's going wrong here?  Thank you! Johan Laebens   I'm using the following code:   import java.net.MalformedURLException; import java.net.URL; import java.util.List; import java.util.Map;  import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; import javax.xml.ws.BindingProvider;  import com.inflectra.spirateam.mylyn.core.internal.services.soap.ArrayOfRemoteTestCase; import com.inflectra.spirateam.mylyn.core.internal.services.soap.IImportExport; import com.inflectra.spirateam.mylyn.core.internal.services.soap.IImportExportConnectionAuthenticateServiceFaultMessageFaultFaultMessage; import com.inflectra.spirateam.mylyn.core.internal.services.soap.IImportExportConnectionConnectToProjectServiceFaultMessageFaultFaultMessage; import com.inflectra.spirateam.mylyn.core.internal.services.soap.IImportExportConnectionDisconnectServiceFaultMessageFaultFaultMessage; import com.inflectra.spirateam.mylyn.core.internal.services.soap.IImportExportTestCaseRetrieveByFolderServiceFaultMessageFaultFaultMessage; import com.inflectra.spirateam.mylyn.core.internal.services.soap.ImportExport; import com.inflectra.spirateam.mylyn.core.internal.services.soap.RemoteTestCase; import com.inflectra.spirateam.mylyn.core.internal.services.soap.RemoteTestStep;  public class SpiraTest {      private static final String WEB_SERVICE_SUFFIX = "/Services/v4_0/ImportExport.svc"; //$NON-NLS-1$     private static final String WEB_SERVICE_NAMESPACE = "{https://www.inflectra.com/SpiraTest/Services/v4.0/}ImportExport"; //$NON-NLS-1$     private static final String WEB_SERVICE_NAMESPACE_DATA_OBJECTS = "http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v4_0.DataObjects"; //$NON-NLS-1$       /**      * @param args      * @throws MalformedURLException       * @throws IImportExportConnectionAuthenticateServiceFaultMessageFaultFaultMessage       */     public static void main(String[] args) throws MalformedURLException, IImportExportConnectionAuthenticateServiceFaultMessageFaultFaultMessage {         String baseUrl = "THE_CORRECT_URL";         URL serviceUrl = new URL(baseUrl  + WEB_SERVICE_SUFFIX);         ImportExport service = new ImportExport(serviceUrl, QName.valueOf(WEB_SERVICE_NAMESPACE));         IImportExport soap = service.getBasicHttpBindingIImportExport();          Map  requestContext = ((BindingProvider)soap).getRequestContext();         requestContext.put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);          boolean success = soap.connectionAuthenticate("CORRECT_USERNAME", "CORRECT_PASSWORD");                  System.out.println(success); // returns true                  try {             boolean connectedToProject = soap.connectionConnectToProject(18); // certain project which does exist             System.out.println(connectedToProject);                          ArrayOfRemoteTestCase testcases = new ArrayOfRemoteTestCase();             testcases = soap.testCaseRetrieveByFolder(8271); // folder exists             List  remoteTestcases = testcases.getRemoteTestCase();             for (int i=0;i  getTestCaseId = remoteTestcases.get(i).getTestCaseId();                 System.out.println(getTestCaseId.getValue()); // I can see all the testcasenames &gt;&gt; OK                  // This should work but somehow, the getTestSteps() is null                 List  allesInEen = remoteTestcases.get(i).getTestSteps().getValue().getRemoteTestStep();                 for (int j=0;j &gt; " + allesInEen.get(j).getDescription());                     System.out.println("&gt;&gt; " + allesInEen.get(j).getExpectedResult());                     System.out.println("&gt;&gt; " + allesInEen.get(j).getSampleData());                 }             }                       } catch (IImportExportTestCaseRetrieveByFolderServiceFaultMessageFaultFaultMessage e) {             e.printStackTrace();         } // http://spiratest.hq.ebit.be/SpiraTest/18/TestCase/8270.aspx         catch (IImportExportConnectionConnectToProjectServiceFaultMessageFaultFaultMessage e) {             e.printStackTrace();         }         finally         {             try {                 soap.connectionDisconnect();             } catch (IImportExportConnectionDisconnectServiceFaultMessageFaultFaultMessage e) {                 e.printStackTrace();             }         }     } }    

</description><pubDate>Thu, 13 Feb 2014 08:46:51 -0500</pubDate><a10:updated>2014-02-14T07:30:26-05:00</a10:updated><link>/Support/Forum/spiratest/issues-questions/826.aspx</link></item><item><guid isPermaLink="false">messageId=1514</guid><author>Inflectra Sarah (donotreply6@kronodesk.net)</author><title>&#xD;
Hi Johan&#xD;
&#xD;
    For performance reasons we don't include the test steps when you retrieve a list o</title><description>&#xD;
Hi Johan&#xD;
&#xD;
    For performance reasons we don't include the test steps when you retrieve a list of test cases by folder.     For each test case, you will need to call the web service again using the TestCase_RetrieveById(...) function to get the test case and its associated test steps.     Regards     Sarah. </description><pubDate>Thu, 13 Feb 2014 15:00:03 -0500</pubDate><a10:updated>2014-02-13T15:00:03-05:00</a10:updated><link>/Support/Forum/spiratest/issues-questions/826.aspx#reply1514</link></item><item><guid isPermaLink="false">messageId=1522</guid><author>Johan Laebens (johan.laebens@ebit.be)</author><title>&#xD;
Hello,  Thanks for the info, I'm now indeed able (with the testcase ID) to retrieve it's steps!!  </title><description>&#xD;
Hello,  Thanks for the info, I'm now indeed able (with the testcase ID) to retrieve it's steps!!  Johan &#xD;
&#xD;
</description><pubDate>Fri, 14 Feb 2014 07:30:26 -0500</pubDate><a10:updated>2014-02-14T07:30:26-05:00</a10:updated><link>/Support/Forum/spiratest/issues-questions/826.aspx#reply1522</link></item></channel></rss>