|By Ryan Moore||
|August 11, 2003 12:00 AM EDT||
As the Internet evolves, the demand for a Web interface that rivals the functionality of desktop applications has become evident. The solution is the "executable Internet," a rich-client technology boasting a client-side browser plug-in capable of making the user's experience of a Web page much more interactive and powerful. The combination of ASP.NET and Macromedia's Flash Remoting is one of the most compelling rich-client interfaces available to overcome today's development limitations.
In order to fully leverage the immense power of the .NET Framework on the Web, an interactive, responsive, and effective desktop-like user interface is required. Limited by the restrictions of HTML and alternative technologies such as DHTML, developers are forced to conform to browser standards when building their user interface and their application's functionality. These limitations cause Web applications to be much less interactive and powerful than their desktop counterparts.
Enter the Rich Client
Rich Internet applications offer many of the same possibilities as desktop applications, with the communication power of a Web browser. Rich-client applications have the ability to immediately react to a user's input and then display, process, or validate data based on that input while the user is either on- or offline.
By executing client-side scripts, rich-client applications also make use of the processing power available on the client computer rather than relying only on the Web-hosting server. This feature allows a much more efficient use of bandwidth and processing power than strictly server-side processing.
Rich Internet applications also make the client/server communications taking place in an application nearly invisible. This is accomplished by using an asynchronous, event-driven callback model instead of the traditional Web model. This asynchronous model can also decrease the amount of Web traffic needed to communicate between client and server, and increase the interactivity of the application by allowing the client to retain control of a Web Form while a call is being made to a remote server object.
Macromedia's Flash Player technology is the most widely distributed rich Internet application on the market today. Macromedia Flash Player is currently installed on more than 400 million client devices, including platforms such as Windows, Macintosh, Linux, Sun Solaris, Microsoft TV, Pocket PC, and others. It is estimated that a version of Flash Player is available to over 98% of Web users. Flash is supported on essentially all version 4.0+ browsers, eliminating the client interface compatibility problems encountered with other HTML-based technologies such as DHTML and Cascading Style Sheets. Because Flash is supported in both browsers and devices, Flash applications can be deployed consistently across Internet-connected platforms. Flash Player also has a vast array of multimedia capabilities, including support for motion graphics, video, audio, two-way communications, and complex forms.
Flash Remoting .NET
The component essential to the success of rich-client interfaces is the ability to quickly access server-side data. Macromedia's Flash Remoting for .NET provides an interface for communicating between Flash Player and .NET application servers.
Flash Remoting exposes .NET technologies such as Web services, ASP.NET pages, and .NET assemblies as remote services to Flash, allowing them to be called as if they were local ActionScript objects. Flash Remoting MX is used in .NET applications as a custom server control in ASP.NET pages or as a namespace in .NET assemblies, code-behind class files, and Web services. This gives the .NET developer the flexibility to build server-side logic in a variety of formats, all of which are accessible to the client.
Flash Remoting provides transparent conversions between Flash data types and the server-side .NET data types. These conversions take much of the work out of the hands of both the client and server-side developers, allowing focus to reside on the business logic and client interactivity instead of the object communication.
Flash Remoting for .NET communicates between the Flash client and the .NET server using a message format called AMF (Action Message Format), which is delivered over HTTP and modeled on SOAP. AMF is a binary message format, the likes of which have been found to reduce network traffic up to 50% compared to SOAP-formatted communication. Because it is delivered over HTTP, AMF is also securable via HTTPS and is firewall safe.
The Flash Remoting .NET environment consists of two layers: (1) the netservices layer, residing in the client Flash Player (available on all Flash Players version 6.40+); and (2) the remoting gateway, residing on the .NET Web server. The netservices layer is composed of a Flash include file containing all of the ActionScript classes necessary to send and receive communications on the Flash side. The remoting gateway consists of a .NET DLL that acts as controller on the .NET runtime that, among other things, handles the conversion of data types between ActionScript and the .NET Common Language Runtime. When this controller receives a request, the request passes through a series of filters that handle serializing, logging, and security before arriving at a service adapter that handles the appropriate invocation type.
Make It Happen
In order to demonstrate how to use .NET Flash Remoting, as well as introduce some ActionScript, I have created a .NET Remoting application available for download from www.sys-con.com/dotnet/sourcec.cfm. In my example I'll demonstrate how to pass DataTables from an ASP.NET page to a Flash object and bind that data to Flash user controls. In this example, you will see how an event-driven, asynchronous model is used to retrieve data from a Web server while allowing a client to retain control of the Web page.
Download and install the Flash MX authoring environment 30-day trial from www.macromedia.com/software/flash, and the Flash Remoting 30-day trial from www.macromedia.com/software/flashremoting. When installed, Flash Remoting will reside in a directory under c:\inetpub\wwwroot\flashremoting (in a typical IIS install).
Next, create a directory anywhere on your system for the application files. This directory will need to be enabled for Web sharing. In my example, I have shared the folder as netJournalFlash. Create a "bin" directory with write permissions within this directory to function as the local assembly cache. Now we copy a couple of files from the flashremoting directory to the new application directory. Copy the flashremoting/bin directory and the flashgateway.dll file, which is the server-side remoting gateway, to the bin directory of the new application. Also copy the Web.config file to the directory root.
The Web.config file contains one of the essential server-side requirements for Flash Remoting, a reference to the Flash Remoting assembly:
If the server receives a Web request containing AMF, it forwards this request to the Flash remoting assembly.
The ASP.NET code in this example consists of two pages, productList.aspx and productData.aspx. To access data from an ASP.NET file and pass data to and from Flash files, a Flash Remoting custom server control must be used within the page. First, register the Flash gateway:
<%@ Register TagPrefix="MM" Namespace="FlashGateway"
The Flash control is added to the page with the following statement:
The Flash Remoting custom server controls contain three properties used to access variables passed to and from Flash:
The Flash.Params property is an array of parameters passed from Flash to the .NET application. The Flash.Result property is used to return data to Flash after the server-side processing has occurred. The Flash.DataSource property is used to bind .NET DataSets to Flash Remoting controls.
Let's take a look at the example files. When productList.aspx is invoked, a connection is made to a local Access database and a DataSet is retrieved consisting of the product ID and name for each product in the database. This DataTable is then bound to the Flash control using the control's DataSource property and DataBind() method.
myFlash.DataSource = myDataSet.Tables;
ProductData.aspx is very similar to productList.aspx, except that it requires a parameter to be passed to it from the Flash client and returns the detailed listing for that single product. In this file, we first check to make sure that a parameter has been passed through the Flash Control, then make the connection to the datasource. The SQL query is then built, using the passed parameter to determine which product to select further data for:
string sqlQuery="SELECT description, location, price
WHERE pid=" + myFlash.Params.ToString();
And the resulting DataTable is bound to the Flash control as shown in productList.aspx, one of the source files.
Time for Some Action(Script)
Now that we've constructed our server-side .NET code, it's time to tackle the front-end Flash. Flash files are constructed on a timeline consisting of a number of layers. In our file, the top layer (as seen in the "Timeline" window) is titled "functions". When the first frame of this layer is selected, the code for this frame appears in the "Actions" panel. This frame is where all of our ActionScript code will reside. More information about programming in Flash can be found at: www.macromedia.com/support/flash. As mentioned earlier, the netservices layer is the client portion of the Flash Remoting model. The netservices layer is initiated in ActionScript with the following call:
gatewayConnnection = NetServices.createGatewayConnection();
defaultService = "netJournalFlash";
The gateway.aspx file is a blank ASP.NET file used only when developing in the Flash Authoring Environment. In production, the setDefaultGatewayURL is removed, and the gateway is supplied through a parameter in the HTML that embeds the SWF file in the Web page.
Once this connection is made, the remote .NET service methods may be accessed as if they were local Flash ActionScript resources. The service function we will use will reside inside the netJournalFlash application (or whatever you named your app), so we set our default service to netJournalFlash. To make a call to an ASP.NET page containing a remoting object we would like to invoke, a call to the service function is made, with the name of the ASP.NET page being the name of the method being called:
This function calls the productList.aspx page and waits for a response. When a response is received, Flash automatically forwards this response to a function with the name of the call followed by "_Result", in this case:
When the result is successfully received, this data is then bound to the Flash comboBox with the instance name "myCombo" using the Flash DataGlue ActionScript object, also included with Flash Remoting:
(myCombo, result, "#title#", "#pid#");
with the line:
The comboBox has been set to execute the loadImageData function when an item has been selected.
In the function loadImageData, we call the productData.aspx page, passing the value of the product we would like to retrieve the data for:
When the response is received by the productData.aspx page, it is automatically handled by the productData_result function. In this function, we set the price and description text fields to their respective values, as well as load the image associated with this product with the line:
theImage = "images/"+result.getItemAt(0).location;
Line one creates a string variable named "theImage" and sets it to the images directory, followed by the first result's location column. Line two then loads this image into the imgHolder movieClip on the stage, and our Flash is complete!
As the demand for a more and more interactive Web user experience increases, the need for rich-client interfaces has increased exponentially. As you have seen in the example, the combination of .NET objects, Macromedia Flash Remoting, and Macromedia's Flash Player create a powerful rich-client interface capable of producing desktop-like applications in a Web browser interface.
|Eric Ball 03/17/05 01:30:13 PM EST|
I am running thru your tutorial 'The Executable Internet'...this is what i have been looking for to shed some light on the FlashRemoting subject.
Do you have the products.mdb for download so that i can complete the tutorial and get a better understanding of how this works?
SYS-CON Events announced today that Micron Technology, Inc., a global leader in advanced semiconductor systems, will exhibit at the 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Micron’s broad portfolio of high-performance memory technologies – including DRAM, NAND and NOR Flash – is the basis for solid state drives, modules, multichip packages and other system solutions. Backed by more than 35 years of technology leadership, Micron's memory solutions enable the world's most innovative computing, consumer,...
Sep. 2, 2015 05:30 PM EDT Reads: 257
SYS-CON Events announced today the Containers & Microservices Bootcamp, being held November 3-4, 2015, in conjunction with 17th Cloud Expo, @ThingsExpo, and @DevOpsSummit at the Santa Clara Convention Center in Santa Clara, CA. This is your chance to get started with the latest technology in the industry. Combined with real-world scenarios and use cases, the Containers and Microservices Bootcamp, led by Janakiram MSV, a Microsoft Regional Director, will include presentations as well as hands-on demos and comprehensive walkthroughs.
Sep. 2, 2015 04:45 PM EDT Reads: 387
In his session at @ThingsExpo, Lee Williams, a producer of the first smartphones and tablets, will talk about how he is now applying his experience in mobile technology to the design and development of the next generation of Environmental and Sustainability Services at ETwater. He will explain how M2M controllers work through wirelessly connected remote controls; and specifically delve into a retrofit option that reverse-engineers control codes of existing conventional controller systems so they don't have to be replaced and are instantly converted to become smart, connected devices.
Sep. 2, 2015 04:15 PM EDT Reads: 207
SYS-CON Events announced today that Pythian, a global IT services company specializing in helping companies leverage disruptive technologies to optimize revenue-generating systems, has been named “Bronze Sponsor” of SYS-CON's 17th Cloud Expo, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Founded in 1997, Pythian is a global IT services company that helps companies compete by adopting disruptive technologies such as cloud, Big Data, advanced analytics, and DevOps to advance innovation and increase agility. Specializing in designing, imple...
Sep. 2, 2015 04:15 PM EDT Reads: 347
Akana has announced the availability of the new Akana Healthcare Solution. The API-driven solution helps healthcare organizations accelerate their transition to being secure, digitally interoperable businesses. It leverages the Health Level Seven International Fast Healthcare Interoperability Resources (HL7 FHIR) standard to enable broader business use of medical data. Akana developed the Healthcare Solution in response to healthcare businesses that want to increase electronic, multi-device access to health records while reducing operating costs and complying with government regulations.
Sep. 2, 2015 04:00 PM EDT Reads: 276
17th Cloud Expo, taking place Nov 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy. Meanwhile, 94% of enterprises are using some form of XaaS – software, platform, and infrastructure as a service.
Sep. 2, 2015 04:00 PM EDT Reads: 1,577
With the Apple Watch making its way onto wrists all over the world, it’s only a matter of time before it becomes a staple in the workplace. In fact, Forrester reported that 68 percent of technology and business decision-makers characterize wearables as a top priority for 2015. Recognizing their business value early on, FinancialForce.com was the first to bring ERP to wearables, helping streamline communication across front and back office functions. In his session at @ThingsExpo, Kevin Roberts, GM of Platform at FinancialForce.com, will discuss the value of business applications on wearable ...
Sep. 2, 2015 04:00 PM EDT
The 3rd International WebRTC Summit, to be held Nov. 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA, announces that its Call for Papers is now open. Topics include all aspects of improving IT delivery by eliminating waste through automated business models leveraging cloud technologies. WebRTC Summit is co-located with 15th International Cloud Expo, 6th International Big Data Expo, 3rd International DevOps Summit and 2nd Internet of @ThingsExpo. WebRTC (Web-based Real-Time Communication) is an open source project supported by Google, Mozilla and Opera that aims to enable bro...
Sep. 2, 2015 03:45 PM EDT Reads: 1,559
The 17th International Cloud Expo has announced that its Call for Papers is open. 17th International Cloud Expo, to be held November 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, APM, APIs, Microservices, Security, Big Data, Internet of Things, DevOps and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportunity. Submit your speaking proposal today!
Sep. 2, 2015 03:30 PM EDT Reads: 1,640
SYS-CON Events announced today that the "Second Containers & Microservices Expo" will take place November 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Containers and microservices have become topics of intense interest throughout the cloud developer and enterprise IT communities.
Sep. 2, 2015 03:15 PM EDT Reads: 623
WebRTC services have already permeated corporate communications in the form of videoconferencing solutions. However, WebRTC has the potential of going beyond and catalyzing a new class of services providing more than calls with capabilities such as mass-scale real-time media broadcasting, enriched and augmented video, person-to-machine and machine-to-machine communications. In his session at @ThingsExpo, Luis Lopez, CEO of Kurento, will introduce the technologies required for implementing these ideas and some early experiments performed in the Kurento open source software community in areas ...
Sep. 2, 2015 02:15 PM EDT
Consumer IoT applications provide data about the user that just doesn’t exist in traditional PC or mobile web applications. This rich data, or “context,” enables the highly personalized consumer experiences that characterize many consumer IoT apps. This same data is also providing brands with unprecedented insight into how their connected products are being used, while, at the same time, powering highly targeted engagement and marketing opportunities. In his session at @ThingsExpo, Nathan Treloar, President and COO of Bebaio, will explore examples of brands transforming their businesses by t...
Sep. 2, 2015 02:00 PM EDT Reads: 264
SYS-CON Events announced today that HPM Networks will exhibit at the 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. For 20 years, HPM Networks has been integrating technology solutions that solve complex business challenges. HPM Networks has designed solutions for both SMB and enterprise customers throughout the San Francisco Bay Area.
Sep. 2, 2015 01:30 PM EDT Reads: 938
While many app developers are comfortable building apps for the smartphone, there is a whole new world out there. In his session at @ThingsExpo, Narayan Sainaney, Co-founder and CTO of Mojio, will discuss how the business case for connected car apps is growing and, with open platform companies having already done the heavy lifting, there really is no barrier to entry.
Sep. 2, 2015 12:45 PM EDT Reads: 194
Too often with compelling new technologies market participants become overly enamored with that attractiveness of the technology and neglect underlying business drivers. This tendency, what some call the “newest shiny object syndrome,” is understandable given that virtually all of us are heavily engaged in technology. But it is also mistaken. Without concrete business cases driving its deployment, IoT, like many other technologies before it, will fade into obscurity.
Sep. 2, 2015 12:15 PM EDT Reads: 414
With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo in Silicon Valley. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be! Internet of @ThingsExpo, taking place Nov 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 17th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal an...
Sep. 2, 2015 11:30 AM EDT Reads: 1,997
As more intelligent IoT applications shift into gear, they’re merging into the ever-increasing traffic flow of the Internet. It won’t be long before we experience bottlenecks, as IoT traffic peaks during rush hours. Organizations that are unprepared will find themselves by the side of the road unable to cross back into the fast lane. As billions of new devices begin to communicate and exchange data – will your infrastructure be scalable enough to handle this new interconnected world?
Sep. 2, 2015 11:15 AM EDT Reads: 185
With the proliferation of connected devices underpinning new Internet of Things systems, Brandon Schulz, Director of Luxoft IoT – Retail, will be looking at the transformation of the retail customer experience in brick and mortar stores in his session at @ThingsExpo. Questions he will address include: Will beacons drop to the wayside like QR codes, or be a proximity-based profit driver? How will the customer experience change in stores of all types when everything can be instrumented and analyzed? As an area of investment, how might a retail company move towards an innovation methodolo...
Sep. 2, 2015 11:15 AM EDT Reads: 494
The Internet of Things is in the early stages of mainstream deployment but it promises to unlock value and rapidly transform how organizations manage, operationalize, and monetize their assets. IoT is a complex structure of hardware, sensors, applications, analytics and devices that need to be able to communicate geographically and across all functions. Once the data is collected from numerous endpoints, the challenge then becomes converting it into actionable insight.
Sep. 2, 2015 09:00 AM EDT
Contrary to mainstream media attention, the multiple possibilities of how consumer IoT will transform our everyday lives aren’t the only angle of this headline-gaining trend. There’s a huge opportunity for “industrial IoT” and “Smart Cities” to impact the world in the same capacity – especially during critical situations. For example, a community water dam that needs to release water can leverage embedded critical communications logic to alert the appropriate individuals, on the right device, as soon as they are needed to take action.
Sep. 2, 2015 08:45 AM EDT