6 Replies Latest reply on Sep 29, 2009 7:07 AM by jay_viz

    Flex-based Web Service for serving static image

    jay_viz

      Hello,

       

      We have a flex application that generates a thematic map, and we were wondering whether there is a way to generate a .jpg image of the thematic map by making a remote call to our flex application.

       

      For example, if we were to embed an image tag linking to the Flex application, such as one shown below, in a HTML page, we want it to render the image on our webpage.

      <img src="http://flex-app-location/thematic_map.swf?country=US&state=FL" />

        • 1. Re: Flex-based Web Service for serving static image
          paul.williams Level 4

          A swf isn't a web-service, it is an application that runs inside the flash player which in turn runs inside a web browser. You cannot make a remote call to a swf from a web-page in the way you are proposing because a swf does not execute on the server. You download swfs and run them locally within the browser.

           

          Why not just embed the swf inside your web-page?

          • 2. Re: Flex-based Web Service for serving static image
            jay_viz Level 1

            Thank you for the quick response.


            It is understood that SWF and its content is intended to be rendered client-side. However, we were wondering if anyone has had any success with wrapping flash-player (such as Adobe AIR) around a SWF in such a way that the player could be called by a script server-side to generate graphs/images, which are then saved to disk and returned via a regular web service.

             

            I gave embedding the image on the HTML page, but the specific use we are most interested in is embedding the static thematic map into a report in the Word document format.  Since much of our content can already be accessed interactively using a browser and a flash-plugin, we are investigating methods of leveraging our SWFs to generate images server-side for the purposes of automated report generation.

            • 3. Re: Flex-based Web Service for serving static image
              paul.williams Level 4

              I've heard chatter about doing this kind of thing server-side either by running the Flash player on the server or using AIR, but I don't know whether anyone has had any success in this area.You would certainly have to wrap the player in a web-service or similar.

               

              If your primary interest is automated report generation, then perhaps you could consider embedding your swf inside a PDF?

              1 person found this helpful
              • 4. Re: Flex-based Web Service for serving static image
                jay_viz Level 1

                Thank you for the response.  It is good to know someone else has been working on it as well.

                Unfortunately, our end-user have specifically requested Word as the document format, so the PDF solution will not work for us.

                • 5. Re: Flex-based Web Service for serving static image
                  Ansury Level 3

                  I guess in theory this would be possible if you had an AIR/Flex app that is always running in the background on the server which is subscribed to a messaging service.  The way I picture it: A Java server running a web service would send out a request to the AIR app via messaging, to which the AIR/Flex app responds with whatever it did to the passed parameter data, and then the web service would hand off the image from there.  Not sure if there's an easier way; this doesn't really sound like a trivial thing to do but I suppose it's possible, more or less depending on what form your data has to be in.

                  1 person found this helpful
                  • 6. Re: Flex-based Web Service for serving static image
                    jay_viz Level 1

                    This does sound promising, and we will investigate further.  Thank you.