Forum Discussion

vinodtc's avatar
vinodtc
Contributor
14 years ago

Not getting proper response from webservice method

HI,


I am calling webservice method along with all the parameter. I am using vbscript to write the script with the below code. I am getting as error as "There was error reflecting _retun". Please help me to how to handle and get the correct data.  In webservice parameter are in long datatype, but vb script does not support long data type. is this the problem?


code:



function fun1

   mid1=12940998

   tmp1="testtest"

   slave=0  

   crn=128958833

   ec=162814



   set surfer1 = webservices.TMI_orignal1.getCustomerStatusByCRN(mid1,tmp1,slave,crn,ec)

   msgbox surfer1.status



end function




screens shots attached for clear understanding. Please 


1.Webservice_Methods.jpg


2.Error.jpg


3. ReturnObject_Class_under_Types.jpg


I have used different tool (Soap UI pro) to test the same webservice and working correctly. There is no problem with the webservice


This is most required. Please help me.



Regards,


Vinod


7 Replies

  • Hi Vinod,



    I've reproduced the issue and forwarded it to our developers for a detailed investigation. I'll write back here when there're results on this.

    Sorry for the inconvenience.
  • Hi Vinod,



    I've got an explanation from developers regarding the issue.



    It looks like you're using TestComplete on a computer with .NET Framework 3.5 or 4. In this case, TestComplete uses the .NET WCF API to interact with web services. The issue happens, because your tested web service sends back a SOAP fault message and .NET can't parse this message.



    To avoid the issue, you can use TestComplete on a computer that doesn't have .NET Framework 3.5 and 4.0. In this case, TestComplete will use a native web service API that parses SOAP fault messages properly.



    If using a computer without the .NET Framework isn't an option, you can do this:

    - download and unzip the attached archive containing the Global.aqview file;

    - copy this file to the following folders:

    C:\Program Files\Automated QA\TestComplete 8\Views\

    C:\Users\<username>\AppData\Local\AutomatedQA\TestComplete\8.0\ (if you use Windows 7 or Vista)

    C:\Documents and Settings\<username>\Local Settings\Application Data\AutomatedQA\TestComplete\8.0\ (if you use Windows XP)

    - launch TestComplete and go to Tools | Options | Engines | Web Services;

    - unselect the Use managed code to invoke web service methods option and click OK.



    Please note that since SOAP fault is essentially an exception, you'll need to handle it using On Error Resume Next and Err object. For example:

    On Error Resume Next

    Set surfer1 = webservices.TMI_orignal1.getCustomerStatusByCRN(mid1,tmp1,slave,crn,ec)

    If Err = 0 Then

      MsgBox surfer1.status

    Else

      Log.Error "The web service has returned an error.", Err.Description

    End If


    Let me know how it works for you.
  • Hi,



    Unfortunately we have installed .NET Framework 3.5 in my system for specific purpose. To work with your solution, I did not find the "Use managed code to invoke web service methods" option from Tools | Options | Engines | Web Services. Prsently I am using Testcomplete8.7. Is this the option of Testcomplete 9.0?  If this is the case, we will update the version of Testcomplete to 9.0 and try your solution.



    regards,

    Vinod


  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1
    Hi Helen,



    Thank you for the useful explanation of one more area in TC and the file provided.

    I tried it with TC9.0.1069.7 and it seems to work. But its size is quite smaller than the size of the Global.aqview file on my drive and their contents differs significantly. So I'd like to wonder if this is because some of my personal settings were lost (and this is not a problem) or because the file provided by you modifies some other areas of TC except exposing the "Use managed code to invoke web service methods" option?
  • Vinod: It's a hidden option of TestComplete 8.70 that is only visible using the Global.aqview file from the archive attached to my previous post. Did you install this file as I explained?

    Also, please make sure to use the appropriate system paths. For example, if you use a 64-bit Windows version, put the Global.aqview file to C:\Program Files (x86)\Automated QA\TestComplete 8\Views\ rather than C:\Program Files\Automated QA\TestComplete 8\Views\.





    Alex: The Global.aqview file partially controls the TestComplete GUI layout. However, the file I attached is for TestComplete 8.70, and it is not intended for use with TestComplete 9. So, yes, it might be the cause of the settings' being lost. If you, for some reason, need a TestComplete 9-specific file, please contact our Support and refer to this forum thread.
  • Thanks Helen,



    After replacing the Global.aqview at specified folders, I got option Use managed code to invoke web service methods. This was unchecked and executed  my web service. Now I am not getting the above specified error.



    Thank you very much for your support once again.



    Regards,

    Vinod