|< Day Day Up >|
Web Services are a great way to access server application functionality within Flash. The primary advantage of Web Services is that they utilize accepted standards valid across the Internet. Web Services return structured data in such a way that it does not matter in what language the web service was written or on which platform the web service runs. There are multiple public Web Services available on the Internet, and of course, it is possible to build Web Services to create our own application functionality.
The two standards that make Web Services possible are WSDL and SOAP. The WSDL standard is a description of the web service that shows the developer the methods that can be called as well as any parameters that these methods may require. The second standard is the SOAP protocol. The SOAP protocol is just raw XML text that is sent down to the Flash player; the XML text contains unique SOAP formatting. The Flash Player is responsible for decoding this XML and converting it into useable ActionScript 2.0 objects.
Developers do not have to write code to parse the XML themselves in Flash MX 2004. There are two components created for this task: the Web Services Connector component and the Web Services classes.
The Web Services Connector component offers a way to process the XML data without having to use any ActionScript 2.0 code at all. The connector enables easy connection to other components through visual data binding.
The Web Services classes enables us to access all web-based services in code, which lends itself to more efficient coding practices.
Web Services is a very viable option, especially for smaller chunks of data. However, because all the XML is converted to ActionScript objects within the Flash Player, it can slow down performance, especially when dealing with larger chunks of data. In addition, when accessing XML data in the Flash Player, we are subject to the security sandbox restriction.
XML is the root of the host web server. For these reasons, in some cases, Flash Remoting may be a viable alternative to using the Web Services classes. Flash Remoting does the actual XML translation on the server, and then sends the native ActionScript object to the Flash Player. Therefore, with Flash Remoting, there are minimal performance issues and no security issues.
|< Day Day Up >|