Data Communications

50 %
50 %
Information about Data Communications

Published on November 28, 2007

Author: Fenwick


Flex Data Communications:  Flex Data Communications Nick Kwiatkowski, Michigan State University Data Communications:  Data Communications Why communicate? Your Flex applications most likely want to have fresh data from a database or other webservice You may need to send current data to your end-users Three-Tiered applications Data -> View -> Controller Your data tier doesn't have to be local! Data Communication Basics:  Data Communication Basics Flex currently supports three types of data communications with external sources : XML via HTTP Requests SOAP Web-Services AMF / Remote Objects With this combination, you can virtually talk to any back-end server HTTPService:  HTTPService The HTTPService MXML tag allows for the most basic communication level between you and a web server Mostly used for legacy middleware applications and static XML documents Any application that can generate proper XML on the fly can talk to your Flex app using this tag HTTPService:  HTTPService How it is used: Place the HTTPService tag at the application or component level (root level) of your current MXML document. HTTPService:  HTTPService Common Parameters: id – Used to name the component url – The full URL to the component result – The event function that will be fired when the result came back successfully The XML document will be stored in the event.result object fault – The event function that will be fired when the result did not come back correctly. Web-Services:  Web-Services SOAP or Web-Services can easily be called using the <mx:WebService> component. Web Services allow you to communicate data back to the web-server, and retrieve typed objects (strings, numbers, arrays, queries) Because it is based on XML, it is very verbose, and often slow for large sets of data. Web-Services:  Web-Services How it is used: Place the <mx:WebService> tag at the root level of the document (application or component) that you are working on. Web-Services:  Web-Services Common Parameters: id – Used to name the object wsdl – Points to the WSDL (Web Service Descriptor) file. This file is different for each language showBusyCursor – Changes the current pointer to a rotating clock to let the user know something is happening Web-Services:  Web-Services Passing parameters: You can pass parameters to web-services by naming operations (methods or functions). The operation tag allows for result or fault functions Web-Services:  Web-Services Passing Parameters: You CAN use binding statements within your parameters (to bind to user’s input, for example) Webservices are Case Sensitive, so make sure that your parameters match case Some application servers, such as ColdFusion don’t care about case-sensitivity Watch out with ColdFusion, because it transforms all cases to Uppercase when transmitting data! AMF:  AMF AMF, or Remote Objects are the most efficient way to transmit data between your application server and your Flex Application Data is transmitted in Binary, so it is fairly compressed Objects will stay in their native form when transmitted Very easy to use** AMF:  AMF So, why NOT use AMF? Only ColdFusion, ActionScript and Java are supported by Adobe. PHP has an open source solution, however. Fairly hard to setup your environment Requires files to be copied down from your development / deployment environment Makes a lot of assumptions that can hurt you your first time through. AMF:  AMF What your need: You need to get a copy of services-config.xml from your environment. ColdFusion this is your <webroot>/WEB-INF/flex/ JRun this is <webroot>/<ear file>/WEB-INF/flex/ If you do not develop your applications locally, you need to modify this file. Copy the ColdFusion destination section and my-cfamf sections to meet your needs. AMF:  AMF Services-Config? This file is compiled into your project and will convert the “destination” portion of your RemoteObject call to the tcp/ip hostname and port numbers Depending on how this file looks, your application can be very portable, or not portable at all. AMF:  AMF How it is used: Just the same as WebService, but instead of the WSDL parameter, you use the destination and source parameters Destination = Destination from the services-config.xml file Source = If using ColdFusion, this the path to the CFC, in dot notation Advanced Communication:  Advanced Communication By customizing the services-config.xml file, you can also enable some advanced communication By using the <mx:Producer> and <mx:Consumer> tags, you can “produce” content to other applications or Coldfusion Event Gateways. This allows for Many-to-One or Many-To-Many applications with little or no work. ColdFusion Demo:  ColdFusion Demo What is it, and how is it used with Flex. ASP.NET Demo:  ASP.NET Demo What is it, and how is it used with Flex? PHP Demo:  PHP Demo What is it, and how is it used with Flex? ColdFusion and Flex:  ColdFusion and Flex When using ColdFusion with Flex Builder, there are certain wizards available to the developer which helps make data communications quicker. These need to be installed manually with Flex Builder; follow the directions in the readme. You also need to configure the Data Sources within ColdFusion before you can begin. ColdFusion and Flex:  ColdFusion and Flex Within the Preferences dialog box, go to the RDS configuration to setup your connection with ColdFusion Context Root and User Name are un-used unless you are using the Multi-Server version of ColdFusion ColdFusion and Flex:  ColdFusion and Flex Open the “RDS Dataview” tab by going to Window -> Show View -> Other -> Coldfusion -> RDS Dataview You will then be shown all the Data Sources available to Coldfusion. You can browse the data, too! Double-Click to launch the query browser. ColdFusion and Flex:  ColdFusion and Flex Right click on a table to template out CFCs for your Flex apps Demo! Where to find more info:  Where to find more info AMF-PHP Project Adobe DevNet Adobe LiveDocs Community Flex Project Where to find more info:  Where to find more info Adobe Flex 2: Training from the source Jeff Tapper, et al Questions?:  Questions?

Add a comment

Related presentations

Related pages

Data Communication

22/3/2016 Έργο Microsoft Dynamics CRM στην Maritech από την Data Communication : 22/2/2016 DC Hotel: η πρόταση της Data ...
Read more

Data transmission - Wikipedia, the free encyclopedia

Data transmission, digital transmission or digital communications is the physical transfer of data (a digital bit stream or a digitized analog signal [1 ...
Read more

Data communications | Article about data communications by ...

data communications, application of telecommunications technology to the problem of transmitting data, especially to, from, or between computers computer,
Read more

Data Communications Basics - Cable & Harness Testers ...

DATA COMMUNICATIONS BASICS. A One-Page Introduction for Each Importan Feature
Read more

Data communication - definition of data communication by ...

Telenet provides high-speed data communication and internet access services on both a wired and wireless basis, primarily to commercial and institutional ...
Read more

Unified Communications and Collaboration - Dimension Data

Unified communications and collaboration Je besser Ihre Leute zusammenarbeiten, desto besser geht es auch Ihrem Unternehmen!
Read more

SMT Data Communications GmbH - Startseite

SMT Data Communications GmbH - Service für IT und EDV
Read more

Data Communication & Computer Network - Tutorials for ...

Data communications refers to the transmission of this digital data between two or more computers and a computer network or data network is a ...
Read more

Next Generation Data Communications - Wikipedia, the free ...

Next Generation (NextGen) Data Communications (Nexcom or DataComm), an element of the Next Generation Air Transportation System, will significantly reduce ...
Read more

Accurate Business Information and Company Profiles from ...

Do you need better customer data and intelligence inside Salesforce? Learn More. Do you need instant access to complete business contact and company profiles?
Read more