Accessibility

Table of Contents

Getting a Handle on Web Services in Macromedia Flash MX Professional 2004

Differences Between the WebServiceConnector, WebServices API, and Flash Remoting

You may be thinking: How do I choose between the different methods of connecting to a web service? Below are some quick guidelines for each type and their strengths and weaknesses.

WebServiceConnector: The WebServiceConnector component is great for RAD (Rapid Application Development) because it allows developers to quickly prototype an application using the Web Service panel and data binding. It is also good for beginners and designers, as it doesn't require any ActionScript. But its methods and properties are accessible through ActionScript if you so choose.

WebServiceClasses: The WebService API comprises the ActionScript classes that drive the WebServiceConnector component, made available for direct access to developers. It has better, more flexible debugging capabilities than the WebServiceConnector, as you can specify BRIEF, VERBOSE, and DEBUG error log levels.

The WebService API also results in smaller file sizes than the WebServiceConnector component since no component overhead is involved. Finally, as explained above, the WebService API can handle web services the WebServiceConnector component can't, such as web services with more than one port or more than one service.

Macromedia Flash Remoting: An advantage of Remoting is that it is much faster than either the WebServiceConnector component or the WebService API thanks to its use of the binary Action Message Format (AMF). The WebServiceConnnector component and WebService API are both based on ActionScript classes and XML, which aren't as efficient. Due to its superior speed, you should use Flash Remoting when handling and sending large amounts of data through web services.

Another advantage is that Remoting bypasses the need for placing a cross-domain policy file on the remote server. Both the WebServiceConnector component and the WebService API require such a policy file when working with remote web services. For more information on Flash Player security and the policy file, please see Deneb Meketa's article, Security Changes in Macromedia Flash Player 7.