0 Replies Latest reply on Aug 4, 2008 4:26 AM by sarbx

    Flex Web Services/Basic Authentication


      I'm trying to invoke a Web service using Client stubs generated using the Flex Builder 3 'WS Introspection tool'. The web services are protected by BASIC authenticaion on the server.
      I have attached 'result' and 'fault' handlers on the call,

      var token:AsyncToken = service.doSomething();
      token.addEventListener("result", doSomething);
      token.addEventListener("fault", fault);

      When this is called without setting the Basic auth HTTP headers, the browser (IE) shows the standard 'Basic Auth dialog'. Only after hitting cancel on that dialog does the control go to the fault method. Is there any way to prevent the Browser from popping up the dialog, but instead go the fault handler directly where appropriate application logic can be peformed.

      Another question related to the above is the setting of HTTP Headers when invoking the web service. The setCredentials method on the auto generated Base..Service does not work. Only solution seems to be modifying the 'call' method as mentioned in the article at http://www.flexlive.net/?p=79 works. Is there a way I can set the authentication header without modifying the autogenerated class.