WS Call RemoteCustomList.getValues returns null.

Thursday, June 9, 2011
Avatar
A.  I am new to webservice developement.
B.  I am try to get the associated values to a custom list.  Here is the practice code:

        try {
            exportLocator.setMaintainSession(true);
            proxy = (IImportExport) exportLocator.getPort(IImportExport.class);

            if (proxy.connection_Authenticate("user", "password")) {
                //System.out.println("Settings: " + proxy.system_GetSettings());

                if (proxy.connection_ConnectToProject(9)) {
                    RemoteTestCase testCases =  proxy.testCase_RetrieveById(105);

                    System.out.println("Test Case ID:  " + testCases.getTestCaseId());
                    System.out.println("Name:  " + testCases.getName());
                    System.out.println("Description:  " + testCases.getDescription());

                    RemoteTestStep[] testStep = testCases.getTestSteps();
                    System.out.println("No of Steps:  " + testStep.length);

                    for (int i = 0; i < testStep.length; i++) {
                        System.out.println("Step#:  " + testStep[i].getPosition());
                        System.out.println("Test Step ID:  " + testStep[i].getTestStepId());
                        System.out.println("Description:  " + testStep[i].getDescription());
                        System.out.println("Status:  " + testStep[i].getExecutionStatusId());
                        System.out.println("H+ändelse Date:  " + testStep[i].getText01());
                        System.out.println("H+ändelse Parms:  " + testStep[i].getText02());
                        System.out.println("Verifiera Parms:  " + testStep[i].getText03());

                        RemoteCustomList[] customLists = proxy.customProperty_RetrieveCustomLists();
                        System.out.println("how many:  " + customLists.length);


                        for (int l = 0;l < customLists.length; l++) {

                            System.out.println("daddy:  " + customLists[l].getName());
                            System.out.println("daddy's ID:  " + customLists[l].getCustomPropertyListId());
                            RemoteCustomListValue[] customListValues = customLists[l].getValues();

                            System.out.println("daddy's value count:  " + customListValues.length);

                        }

                        RemoteCustomList Handelse = proxy.customProperty_RetrieveCustomListById(testStep[i].getList01());
                        RemoteCustomList Verifiera = proxy.customProperty_RetrieveCustomListById(testStep[i].getList02());

                        System.out.println("H+ñndelse:  " + Handelse);
                        System.out.println("Verifiera:  " + Verifiera);
                    }
                }
            } else {
                System.out.println("Authentication failure!");
            }
            proxy.connection_Disconnect();
        } catch (ServiceFaultMessage e) {
            System.out.println(e);
        } catch (ServiceException e) {
            System.out.println(e);
        } catch (RemoteException e) {
            System.out.println(e);
        } finally {
            try {
                if (proxy != null) {
                    proxy.connection_Disconnect();
                }
            } catch (Exception e) {
                System.out.println("Disconnect failed: " + e);
            }
        }

*******THE RESULTS PRINTED ARE:

Username: Margaret Thomas
Email: mtha@amfpension.se
Test Case ID:  105
Name:  Logga in- Inca
Description:  N+ñr anv+ñndar firefox browser, logga in till Inca med giltig anv+ñndare.<br>


No of Steps:  1
Step#:  1
Test Step ID:  543
Description: 

Logga in to Inca<br>


Status:  3
H+ändelse Date:  01-06-2011
H+ändelse Parms:  mtha\EXIT30eden
Verifiera Parms:  Inca
how many:  2
daddy:  H+ñndelser
daddy's ID:  26
Exception in thread "main" java.lang.NullPointerException
    at se.amfpension.importexport.Main.getTestCases(Main.java:96)
    at se.amfpension.importexport.Main.main(Main.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)



******* Some characteristics:
--Using IntelliJ IDE
--Using org.apache.axis
--Here is what is included,
package se.amfpension.importexport;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.Collection;
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.*;
import com.inflectra.www.SpiraTest.Services.v3_0.IImportExport;
import com.inflectra.www.SpiraTest.Services.v3_0.ImportExportLocator;


Thanks, let me know what other information is required.

2 Replies
Thursday, June 9, 2011
Avatar
re: mtha Thursday, June 9, 2011
I think I am beginning to understand how to get the custom lists.  Everything is pretty much driven by an ID.  Now I am getting the list values.
Thursday, June 9, 2011
Avatar
re: mtha Thursday, June 9, 2011
OK, glad that it's now working.

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Thursday, June 9, 2011
  • Last Reply: Thursday, June 9, 2011
  • Replies: 2
  • Views: 2964