6 Replies Latest reply on Oct 22, 2009 7:09 AM by TerjeAB

    Are WebServices in Flash Builder 4 broken?

    TerjeAB

      I have a JBoss server running that exposes a wsdl interface. One of the WebMethods are defined as follows:

       

       

      public List<Stuff> getStuff( long stuffParameter ) { ... }

       

      When I import the WSDL I get what I expect, a method getStuff and a parameter GetStuff that has an arg0 of type Number

       

      I then have the following code in my project

       

       

      private var proxy:StuffWS = new StuffWS(); // this is my webservice that serves Stuff

       

      I do

       

       

      var stuff:Stuff = new Stuff();

      stuff.arg0 = 55;


      var tok:AsyncToken = proxy.getStuff( stuff );

      tok.addResponder( new mx.rpc.Responder(stuffResponseHandler,genericFaultHandler) );

       

       

      I would expec this to call my web service with the parameter of 55, it does in Flex 3 (as far as I can remember). Instead my webservice is called with a parameter of 0.
      Looking at the soap package that goes out, that is not strange, it reads (removed headers)

      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

           <SOAP-ENV:Body>

                <tns:getStuff xmlns:tns="http://package.package/appname/stuffws"/>

           </SOAP-ENV:Body>

      </SOAP-ENV:Envelope>

       

      In other words, my 55 is nowhere to be seen.

        • 1. Re: Are WebServices in Flash Builder 4 broken?
          TerjeAB Level 1

          I have now confirmed that this works fine in Flex 3, though the code is slightly different. I am assuming Adobe changed the code generator in Flash 4. In Flex 3 I do

           

          var stuff:Stuff = new Stuff();

          stuff.arg0 = 55;


          proxy.addgetStuffEventListener(stuffHandler);

          proxy.getStuff(stuff);

          On the JBoss layer my web method is now correctly called with the parameter of 55.

          • 2. Re: Are WebServices in Flash Builder 4 broken?
            Mayank (Adobe) Adobe Employee

            Please file a bug with the WSDL attached.

             

            -mayank

            • 3. Confirmed - WebServices in Flash 4 is not working
              TerjeAB Level 1

              Attached is the Microsoft Dynamics CRM WSDL file, I have modified it slightly (commented out a few complex types) to make it pass the Apache wsdl2java tool. In Flex Builder 3 this generates what I would expect, a number of different types of value objects etc (for example an Account object). None of those are generated in Flash Builder 4. I would have expected to see Account.as, Contact.as and a whole host of other objects.

               

              Also, most of the objects that are created are "half" created, and are thus useless. Example - to retrieve a set of business entities using this WebService, you would create a QueryBase, set it's EntityName to something useful and then populate a ColumnSet object with an array of columns you would like to have returned. The ColumnSet doesn't include any way to add this array however, since it is basically an "empty" object with no real parameters to set or get.

               

              Either Flash 4 generates this in a really "smart" way, making me unable to understand it at all, or Flash 4 wsdl2actionscript is badly broken. Given the fact that no objects that are defined in the WSDL were created, I tend to favor the latter possibility.

               

              I have included the WSDL as it is when edited by me, and as it was originally. There is no difference in the result.

               

              I hope we are a little ways away from release, because this is going to require some work...    :-)

              • 4. Re: Confirmed - WebServices in Flash 4 is not working
                Mayank (Adobe) Adobe Employee

                FB4's wsdl import generates entities in a slightly different way as compared to FB3. FB4 generates only entities referenced by the operations selected on the import WSDL wizard.

                 

                Having said that there may be some issue with the import, your WSDL doesn't seem to have come through. Can you try uploading it again after renaming it to .txt.

                 

                --

                Mayank Kumar

                Computer Scientist, Flash Builder

                • 5. Re: Confirmed - WebServices in Flash 4 is not working
                  TerjeAB Level 1

                  I was unable to attach the files, will file a bug.

                  • 6. Re: Confirmed - WebServices in Flash 4 is not working
                    TerjeAB Level 1

                    Ah, changing to .txt extension... trying now...