1 Reply Latest reply on Sep 14, 2010 3:10 PM by flash_user2

    ActionScript 3: WebService calls - Detecting lost connection

    Level 7
      Hi guys,

      I am currently developing an application that calls a server side webservice
      to do the authentication. The code for it is fairly easy and works great.
      However, if the connection to the server gets lost the "fault" function is
      not called. Is there a way to detect this kind of error? I remember that I
      had the same problem with Flash Remoting in AS2 and it was quite difficult
      to solve that. How can I do that in Flex 2/AS3 with the class
      mx.rpc.soap.WebService?

      Thanks in advance for your help!

      Roger

      Code (Flex 2 / ActionScript 3):
      var ws:WebService = new WebService();
      ws.useProxy = false;
      ws.wsdl = " http://localhost:8080/axis2/services/Authenticator?wsdl";
      ws.authenticate.addEventListener("result",onAuthenticationDone);
      ws.authenticate.addEventListener("fault",onAuthenticationError);
      ws.loadWSDL();
      ws.authenticate(credentials);


        • 1. Re: ActionScript 3: WebService calls - Detecting lost connection
          flash_user2

          Hi Roger,

           

          I am experiencing a similar situation where a flash CS3/AS3 application using a similar code is calling a server side web service to retrieve/update data in the database. For some reason either a connection to the server gets lost or the web service call isn't successful and thus the fault function isn't called. Since you have asked this question a while back, I just wanted to know if you were able to resolve this issue?

           

          Adnan