5 Replies Latest reply on Dec 2, 2009 6:57 AM by TomDelorenzi

    asp project question

    TomDelorenzi Level 1

      My gui will have to talk to an .net server. Currently the existing html gui (that my flex app will replace) is standered generated html via asp. My question is, they did not plan out having flex in there from the begining, so the servers infastructure is designed such that there are no protocols exposed to the public. IE its designed to render to html and thats it. I was poking at the .net project that you can make in flex but I don't have the correct servers to get past the project creation wizards step that it asks for your server. I wanted to know what sort of magic behind the scenes integration this project type provides. Is it likely that the asp team(I know next to nothing about asp) will have to design a seperate "page" or something that I will have to talk to or is there some magic stuff that can happen here to make this much easier then it is sounding.

       

      Thanks.

        • 1. Re: asp project question
          SunilAdobe Adobe Employee

          Your gui can talk to a .net server using webservices and http services for which Flash Builder provides lot of tooling support through the Data menu. The asp.net project in Flash Builder will just help you set up the launch urls for your application for debug and run environments (that is after you give your server and web root details during project setup, an example of that would be http://localhost and c:\inetpub\www respectively)

           

          If you want to use AMF a binary way of exchanging data, you might have to use a third party solution like weborb or fluorine.

           

          Hope this helps.

           

          Thanks

          -Sunil

          • 2. Re: asp project question
            phi2265 Level 1

            import mx.rpc.http.mxml.HTTPService;

            -----------

             

            var srv:HTTPService = new HTTPService();
            srv.url = 'http://url.com/';
            srv.resultFormat = 'e4x';
            srv.method = 'POST';
            srv.useProxy = false;
            srv.showBusyCursor = true;
            srv.addEventListener(ResultEvent.RESULT, resultHandler);
            srv.addEventListener(FaultEvent.FAULT, faultHandler);
            srv.request.filename = file+'.txt';
            srv.request.contents = contents;
            srv.send();
                               
            function resultHandler(e:ResultEvent):void{
                trace(e.result);
            }
                               
            function faultHandler(e:FaultEvent):void{
                trace(e.fault);
                trace(e.message);

                trace(e.type);
            }

            • 3. Re: asp project question
              TomDelorenzi Level 1

              That will let me pull the generated html but I don't think thats really usefull as its going to contain a ton of junk that my app doesn't care about. Also from the sample I saw, asp is embedding the entire session in a ascii block in the html page. Parsing that would require some special library I guess.

              • 4. Re: asp project question
                SunilAdobe Adobe Employee

                You can try using the HTTPService Wizard and configure your URL.

                After that you can use the configure return type to analyze the response of the request there, it has basic support to parse the XML and set the return type.

                 

                Flash Builder also provides default deserializers to convert from XML / JSON to AS objects.

                 

                Try it out and let us know if you have any feedback on that.

                • 5. Re: asp project question
                  TomDelorenzi Level 1

                  Thanks for your feedback! Our asp team is going to meet with me to decide what sort of common interface we want to have so I can make some of these suggestions.