Getting error while creating test set

Saturday, November 26, 2016 8:38:11 PM
Hi,

I am trying to create a testset using soap web services. I am using 5.0 version of soap services. Here goes the code which I am using to create the testset.

    RemoteTestSet testSet = new RemoteTestSet();
    testSet.setTestSetFolderId(316);
    testSet.setProjectId(11);
    testSet.setName("Test Set 26112016");
    testSet.setTestSetFolderId(9255);
    try {
      testSet = spira.testSet_Create(testSet);
      System.out.println("New TestSet created " + testSet.getTestSetId());
    }
    catch (RemoteException e) {
      e.printStackTrace();
    }

I am getting an exception saying "Nullable object must have a value."I am pasting the full stack trace 

AxisFault
 faultCode: {http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher}InternalServiceFault
 faultSubcode: 
 faultString: Nullable object must have a value.
 faultActor: 
 faultNode: 
 faultDetail: 
{http://schemas.datacontract.org/2004/07/System.ServiceModel}ExceptionDetail:<HelpLink i:nil="true"/><InnerException i:nil="true"/><Message>Nullable object must have a value.</Message><StackTrace>   at System.Nullable`1.get_Value()
   at Inflectra.SpiraTest.Web.Services.v5_0.SoapService.TestSet_Create(RemoteTestSet remoteTestSet)
   at SyncInvokeTestSet_Create(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace><Type>System.InvalidOperationException</Type>

Nullable object must have a value.
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:392)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.inflectra.www.SpiraTest.Services.v5_0.BasicHttpBinding_ISoapServiceStub.testSet_Create(BasicHttpBinding_ISoapServiceStub.java:12702)
at com.transcendsys.tools.ant.spira.TestArtifactRetrieval.testSet_Creation(TestArtifactRetrieval.java:129)
at com.transcendsys.tools.ant.spira.TestArtifactRetrieval.main(TestArtifactRetrieval.java:143)

Any help would be highly appreciated. 

Thanks,
Abhijit

2 Replies
Tuesday, November 29, 2016 2:58:18 PM
Avatar
re: abanerjee on Saturday, November 26, 2016 8:38:11 PM
Hi Abhijit

You most likely are missing some of the required fields, I believe you need to also add:
  • TestSetStatusId = (1 = Not Started)
  • TestRunTypeId = (1 = Manual, 2 = Automated)
Regards

Adam
Thursday, December 1, 2016 8:46:57 AM
Avatar
re: inflectra.adam on Tuesday, November 29, 2016
Thanks Adam.It's working fine now.
Statistics
  • Started: Saturday, November 26, 2016 8:38:11 PM
  • Last Reply: Thursday, December 1, 2016 8:46:57 AM
  • Replies: 2
  • Views: 303