3 Replies Latest reply on Apr 28, 2010 5:43 AM by yu2009

    SOAP WebService does not fire ResultEvent


      I´ve created quite a few application that consume .NET webservices, the way I´ve done it so far is to use the Flex WebService Creator (in the toolbar), with it I get the appropriate classes which I use with the AS code to register event handlers and call the methods. This has all worked without problem

      Now I have a requirement that the WSDL of the WS is passed in as a parameter to the Application. This has also worked rather well. I bind the WS to the string and away we go.

      Each method in the App works ... except one. The method itself, on the button click, is executed and run correctly on the web service. But there is NO result event fired. Nothing. There is no result of fault, so I can´t debug or see what is going on. The WS method has been tested both with the previous version as well as SOAPui so its not the WS.

      Why is Flex not firing a ResultEvent or FaultEvent?

      thanks for any reply
      Arnar (Iceland)
        • 1. Re: SOAP WebService does not fire ResultEvent
          bitwyse Level 1
          Hi Arnar ,

          I have been building a large Flex application that consumes many web services and have had the exact same problems. Very frustrating for sure, I feel for you. I have found two issues that have caused this problem. One has to do with a case sensitive issue with my WSDL not matching my value objects in my code. I use a Lotus Domino server to host my web services. On occasion I have had issues with the WSDL it generates sometimes changes the case of my variable definitions. Flex does not report an error it just doesn't fire the web service. The other common problem I have found especially since moving to Flex 3 has to do with loading the wsdl. You have to load it only one time.

          Hope this helps!

          public function GetKeywordDelegate( responder : IResponder )
          this.service = ServiceLocator.getInstance().getWebService( "wsGetKeyword" ) as WebService;
          if( !model.isKeywordWSDLLoaded )
          model.isKeywordWSDLLoaded = true;
          this.responder = responder;
          • 2. Re: SOAP WebService does not fire ResultEvent
            addigud Level 1
            Hi, thanks for the idea

            Its not exactly my solution, a bit more complex then I need I´m afraid. After a bit more testing I´ve found out that the result event is not being bound to the method correctly.

            This is my operation declaration in the WebService, the updateFirstSub never gets run
            <mx:operation name="GetSubChartUsageInfo" result="updateFirstSub(event)" />

            When I add this event listener to the method call it works, newFunc gets run when the result is returned
            ws.getSubChartInfo.addEventListener(ResultEvent.RESULT, newFunc);

            Any ideas why the MXML is not hooking up the result event ? Or what I am doing wrong ?

            thanks again

            • 3. Re: SOAP WebService does not fire ResultEvent
              yu2009 Level 1

              I got similar problems to Arnar's.  I created a webservice to fire 3 ResultEvents.  It worked fine and I could retrieve the data from the webservice.  For an unknown reason, the methods for firing ResultEvent are not called anymore.  Does anyone know how to fix it?  Thanks.