Forum Discussion

nirajsha89's avatar
nirajsha89
Occasional Contributor
16 years ago

Testing Issue

Hi .
I am trying do a webservice  testing . I am trying to access the response values and use it for the subsequent request but when trying to access the Response elements I am getting null pointer exception.
The structure of soapresponse xml is as follows:



21
            123
           

In my groovy script I am using the following code:

def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context )
  log.info(groovyUtils.projectPath)
  def holder = groovyUtils.getXmlHolder("TestRequest1#Response")
  log.info(holder["//ns0:GetAppointedRepForFirmPagination/queryID[1]"])
  def TransID1=holder.getNodeValue("//queryID[1]")
  System.out.println("Neeraj::::::TransID:::::::::"+TransID1)

Please help me what could be the problem and help me in solving the issue
  • Hi!

    You need to specify the namespace prefix also for the queryID element (ie "ns0:queryID")..

    Does that help?

    regards!

    /Ole
    eviware.com