Forum Discussion

giovanni's avatar
giovanni
Occasional Contributor
9 years ago

WebService Python

Hello, 

 

I ported my old Jscript project to Python. 

I'm experiencing issues with WebService. My script is like: 

 

ServiceInput = WebServices.Receiver.TypeFactory.acceptMessage1

ServiceInput.arg0 = req; #(this is a string)

Result = WebServices.Receiver.acceptMessage(ServiceInput);

 

This works with Jscript, but it doesn't with Python (server receives an empty request)

 

Any Idea?

  • Hi Giovanni,

     

    Could you please check if you see the same issue in TestComplete 11.3? This is the latest product version where some Python-related issues have been fixed.

     

    If the issue persists, please contact our TestComplete Support Team to try to resolve it. They need to reproduce the issue in our test lab.

  • Are you taking out the semicolons when running it as a python script? If you aren't I'm surprised it doesn't give a runtime error since it would be trying to assign the value of a variable named 'req;' instead of 'req'. Python doesn't use semicolons like JScript, I think a lot of the TestComplete documentation incorrectly has semicolons for some of the python examples they have.

     

    Other than that I can't really see any issues with your code.

    • giovanni's avatar
      giovanni
      Occasional Contributor

      Hi ghuff, 

       

      Originally I wrote the code without semicolons, then I tried to add semicolons because I saw some TestComplete documentation including these. 

      Anyway the behaviour is the same (and TestComplete does not return a runtime error using semicolons)

      • TanyaYatskovska's avatar
        TanyaYatskovska
        SmartBear Alumni (Retired)

        Hi Giovanni,

         

        Could you please check if you see the same issue in TestComplete 11.3? This is the latest product version where some Python-related issues have been fixed.

         

        If the issue persists, please contact our TestComplete Support Team to try to resolve it. They need to reproduce the issue in our test lab.