Forum Discussion

Elena_1's avatar
Elena_1
Occasional Contributor
14 years ago

Web Service data types are wrong

I downloaded TestComplete 8.0 Trial to try WebServices testing.


Unfortunally it doesn’t recognize data types correctly.


If I use Delphi it recognizes types of parameters correctly except string (I can see WideString)


If I use JScript language TestComplete shows Data Type DOWBLE instead of REAL.


In the 1st case I got result, but data type of result was DOWBLE instead of REAL.


In the 2nd situation I didn’t get a result at all (undefined)


Can you fix it?


  • Hi Elena,




    You are facing a JScript restriction - this language does not support our parameters. Try obtaining the response using code similar to the code below:




    function GetResponse(MethodName)


    {


      var WebServiceInfo = WebServices.CreateWebServiceInfoFromItem('Med');


      return WebServiceInfo.ParseResponse(MethodName, WebServices.Med.LastResponse);


    }




    function CallMethod()


    {


      WebServices.Med.getCalculateValues(4, 2);


      var response = GetResponse('getCalculateValues');


      var r = response.result;


      var error = response.errormessage;


      Log.Message(r);


      Log.Message(error);


    }

  • Hi Elena,





    If I use Delphi it recognizes types of parameters correctly except string (I can see WideString)


    This is expected behavior of TestComplete's WSDL parsing mechanism.





    If I use JScript language TestComplete shows Data Type DOWBLE instead of REAL.


    As the "Real Types" section of the "Simple Types" article on the Delphi vendor's site states:

    The generic type Real, in its current implementation, is equivalent to Double.






    In the 2nd situation I didn't get a result at all (undefined)


    We've tried to reproduce such an issue, but failed. So, can you provide us with a sample of the web service on which this issue can be reproduced? You can submit a separate support case using our Contact Support form, if needed.

  • Hi Elena,





    This web service is located in a private network, so we won't be able to access this service. Thus, could you please ask your system administrator to make the web service accessible over the Internet? Or, can you send us the source of a sample web service with which the issue can be reproduced?





    You can submit a separate support case, if needed.

  • Hi Elena,





    I've added your web service to a project as WebSrvice1 and tried executing the following routine:





    [DelphiScript]





    function test();

    var res, message;

    begin

      WebServices.WebService1.getCalculateValues(1, 1, res, message);

      Log.Message(res);

      Log.Message(message); 

    end;






    According to the execution log, the "res" variable's value was set to 2, and the "message" variable's value was not set at all. I suppose that this is the expected behavior of the function - the function successfully calculated the value and did not return any error messages (note that the last parameter's name is "errormessage").
  • Elena_1's avatar
    Elena_1
    Occasional Contributor
    Hi Alex,

    I tested my service using another tool soapUI and got correct result.

    I would remind you that I have no problems with Delphi.

    I suggest to execute the following JScript function



    function WebServiceTest()

    {

      var Value1 = 1.01;

      var Value2 = 2.02;

      var result1;

      var errormessage = "";

      WebServices.Med.getCalculateValues(Value1, Value2, result1, errormessage); 

    }

    Function returned result1="undefined".



    I got result1 = 3.03 using Delphi script and another tool.