Building Flash-based websites using Adobe Flex - Lesson 6/10

989 views

Published on

Building Flash-based websites using Flex
Lesson 6 – Remote Server Communication

by Alex goh, associate trainer @ LAB School ( http://lab.edu.sg/ ), Adobe Authorized Training Centre, Singapore

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
989
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Building Flash-based websites using Adobe Flex - Lesson 6/10

  1. 1. Building Flash-based websites using Flex Lesson 6 – Remote Server Communication Alex Goh info@alekkus.com
  2. 2. Agenda ● Remote data communication ● Real-time communication ● Asynchronous communication ● HTTP Get/Post ● Flash remoting
  3. 3. Remote Data Communication ● Flex offers many ways to communicate data to and from a remote server. ● The first step is to determine whether a real-time (synchronous) communication or a “request-response” (asynchronous) communication is needed.
  4. 4. Real-time Communication ● Real-time communication is harder to implement. ● Need to use sockets to establish permanent connection. Many companies block socket connection as part of their system security measures. ● In Flex, real-time communication requires Adobe's Real Time Messaging Protocol (RTMP). ● To use RTMP, requires Adobe's LiveCycle ES (requires licensing) or BlazeDS (open source), both implemented on the J2EE platform. ●Used mostly in video conferencing app, or instant messaging. e.g. Yahoo Web Messenger was done in Flex
  5. 5. Asynchronous Communication ● Make use of the HTTP/HTTPS protocol ●Connection to a remote server is achieved either thru the REST or SOAP method. ● REST method: ● HTTP Get/Post – HTTPService class ● Flash remoting – RemoteObject class ● SOAP method: ● Web service – WebService class
  6. 6. HTTP Get/Post ● Use the HTTPService class. ● Simplest. ● Most web APIs use the HTTP Get/Post method
  7. 7. Flash Remoting ● More secured. ● Convenient the Flex application can simply call a function on the server side, known as Remote Procedure Call (RPC) or Remote Method Invocation (RMI). ● Adobe came out with a format to support binary data transfer to be used in conjunction with Flash Remoting, called the Action Message Format (AMF). ● Both LiveCycle ES and BlazeDS support AMF, but that means the server needs to run J2EE. ● For other types of application server (ASP, PHP, Ruby...etc), need to use third party software. ● WebOrb (free, pay for support) - http://www.themidnightcoders.com/

×