Forum Discussion

rrubio's avatar
rrubio
Contributor
16 years ago

unable to get result (datasets) when calling a web service

Hi all,



working with Web Services in TestComplete 8.0, I have noticed  that sometimes I can not get the result from a web service call (a dataset data type), but in some other web services, I do get.



Below, you can find the project web services definition (xml files):

- web service Sessions - method GetList  (this is working)

- web service Speciments - method GetList  (this is NOT working)



Here, I put the program wrote in VBasic.



 Set var1 = WebServices.login.GetList("raul3")

  Log.Message "Any.text vale (" & var1.Any.text & ")"  

  Log.Message "Any.xml vale (" & var1.Any.xml & ")"  

                                                                                                                                                                                                        ==> This is WORKING                                                                                                                                                                                                        

 Set  var2 = WebServices.muestras.GetList("raul3", 1, null)

 

==> This is NOT WORKING. See attached error screenshot (VBerror.png)

If I execute this web service in the internet browser, it does work



I attached two files with the web services definition in TestComplete.







Can anybody help me with this? Do you have any idea about why the first call is working and not the second one?





Regards,



Raul









====================================================================================



Sessions - GetList: Web Service definition file (return value)





- <Method name="GetList">





  <ClassMethod>1</ClassMethod>




  <FormalSpec>pstrSessionKey:%String</FormalSpec>




  <ReturnType>%XML.DataSet</ReturnType>




  <WebMethod>1</WebMethod>




- <Implementation>



- <![CDATA[
 New gobjSession
New objDataSet

Set $ETRAP = "GOTO GetListErrorHandler"

// validate session
Set gobjSession = ##class(co.sys.cSessions).CheckSession(pstrSessionKey)
If ($ZERROR = "")
{
// get session list
Set objDataSet = ##class(co.sys.cSessions).GetList()
if ($ZERROR = "")
{
// return dataset
Quit objDataSet
}
}
// error listing sessions
Do ..RaiseError($ZERROR)
Quit:$QUIT "" Quit

GetListErrorHandler
Do Err1^ErrRoutine
Do ..RaiseError($ZERROR)
Quit:$QUIT "" Quit

  ]]>


  </Implementation>



  </Method>








Specimens - GetList: Web Service definition file (return value)

 





- <Method name="GetList">





  <ClassMethod>1</ClassMethod>




- <FormalSpec>



- <![CDATA[
pstrSessionKey:%String,pintStatus:%Integer,&pstrList:%String=""

  ]]>


  </FormalSpec>





  <ReturnType>%XML.DataSet</ReturnType>




  <WebMethod>1</WebMethod>




- <Implementation>



- <![CDATA[
 New gobjSession
New objResult

Set $ETRAP = "GOTO GetListErrorHandler"

// validate session
Set gobjSession = ##class(co.sys.cSessions).CheckSession(pstrSessionKey)
If ($ZERROR = "")
{
// get specimens list
Set objResult = ##class(co.acb.cSpecimens).GetList(pintStatus, .pstrList)
If ($ZERROR = "")
{
// return dataset
Quit objResult
}
}

// error found
Do ..RaiseError($ZERROR)
Quit:$QUIT "" Quit

GetListErrorHandler
Do Err1^ErrRoutine
Do ..RaiseError($ZERROR)
Quit:$QUIT "" Quit

  ]]>


  </Implementation>



  </Method>







3 Replies

  • I think the problem I have posted is because the third parameter has to be passed by reference.

    Anyway, when doing the same action from the internet explorer version 6.0, I put nothing on this field and everything is working.



    Furthermore, I have captured an HTTP load testing and the event captured is:

    GET /csp/acb/ws.acb.wSpecimens.cls?soap_method=GetList&pstrSessionKey=raul3&pintStatus=-1&pstrList= HTTP/1.1The



    could anybody help about how to get the web service response? or how to get the information?



    thanks,



    raul
  • Hi Raul,


    I have suggested you a way to call the method in my e-mail message:


    ...

    Dim dataresult

    pstrList = ""

    Call WebServices.muestras.GetList("raul3", 1, pstrList, dataresult)

    ...


    Does this script work for you?

  • Hi,



    yes, it has worked fine.



    Thank you very much for that. It was a key point for my project.



    Best regards,



    Raul