Talking to a webservice twice at once...?

javascript United Kingdom
  • 12 years ago

    Hi,

    I have my new webservice and I can talk to it in my client side javascript but when I call a seperate function asyncronously it seems to use a new instance of the webservice... not what I want...

    In the webservice the DoStuff function takes a minute or so but while it runs it is keeping a webservice global variable up to date with a progress percentage. I am then calling another function GetProgress to get this progress - the idea being to display this to the client to get an idea of server side progress...

    I am trying something along the following lines but getting 0 returned always (as if it is a new instance of the webservice class)....

    var TT;

    function Dothings(){
     TT = new TomTest; //Get new instance of the webservice class.
     TT.DoLots(onComplete);
     getmethodprogess();
    }

    function getmethodprogess(){
     TT.GetProgress(UpdateProgress);
     t=setTimeout('getmethodprogess()',1000);
    }

    function UpdateProgress(arg){
     document.getElementById('DIVpro2').innerHTML = arg + '% complete..';
    }

    function onComplete(arg){
     alert(arg); //Show the FINISHED! text alert...
    }

    Any words of wisdom?
    Thanks in advance

    Tom.

     

  • 12 years ago
    Not to worry. I worked this out. Damn stateless webservices.....

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Engineers are all basically high-functioning autistics who have no idea how normal people do stuff.” - Cory Doctorow