0 Replies Latest reply on Dec 7, 2006 6:52 AM by dankokozar

    Problems with Flex consuming two different web services

    dankokozar Level 1
      Hi everyone,
      here's my problem:

      I have two different web services (two different URLs and WSDLs) which are hosted by ASP.NET.
      The first one is used only for loging in, and the second one is accessible by authenticated users only.

      Their declarations are:

      <mx:WebService id="publicWebService"
      <mx:operation name="Login" result="loginResponseHandler(event)" fault="webServiceFaultHandler(event)" />

      <mx:WebService id="protectedWebService"
      <mx:operation name="HelloWorld2" result="protectedWSResponseHandler(event)" fault="webServiceFaultHandler(event)" />

      By the way, publicWebServiceUrl and protectedWebServiceUrl are variables filled with URLs

      Here is the result event from calling the first WS:

      // publicWebService calls this handler after loading resource collection
      private function loginResponseHandler(event:ResultEvent):void {

      var res:LoginResponse = new LoginResponse(event.result);

      if (res.Success){
      mx.controls.Alert.show('Login successfull!', 'Info');
      // connect to a protected web service
      // test it

      } else {
      mx.controls.Alert.show('Login not successfull!', 'Info');

      The problem is that a call to a second WS raises the error: the method "HelloWorld2" seems to not exist!
      I doublechecked everything and cannot find out why.
      Seting the breakpoint just after the "protectedWebService.HelloWorld2();" I've seen that protectedWebService object has methods of both publicWebService and protectedWebService (???), and it deffinitely HAS a "HelloWorld2" method.

      Thanks in advance!!