CHAPTER 8
286
Fine-grained: For remoting destinations, you could create an include list by using multiple
include-method tags (or using the exclude-method tag). Such lists will ensure that only the
included methods are callable on the remote destinations. Calling any other method would
cause an error.
Authentication mechanisms can be custom or basic. This implies that you could leverage your existing
authentication systems using the custom route.
Following is an example of a destination-level configuration that uses custom authentication:
<destination id="ro">
<security>
<security-constraint>
<auth-method>Custom</auth-method>
<roles>
<role>roUser</role>
</roles>
</security-constraint>
</security>
</destination>
HTTPService, WebService, and RemoteObject support passing and invalidation of login credentials
using the setCredentials and the logout methods, respectively. You can also pass credentials to
remote services using setRemoteCredentials.
A simple example of setCredentials with RemoteObject is as follows:
var myRemoteObject:RemoteObject = new RemoteObject();
myRemoteObject.destination = "SecureDestination";
myRemoteObject.setCredentials("userName", "myPassword");
myRemoteObject.send({param1: 'param1Value'});
Implementing custom security and setting up fine-grained access control can be tedious, but with BlazeDS
you can utilize such constructs without adding any additional overhead.
Summary
This chapter rapidly covered a fair number of topics related to data services.
The chapter started with an overview of the data services architecture. Then you explored the steps
involved in installing data services and configuring it. Subsequently you built an example application and
saw data services in action.
The review of the features of data services topics included Java to Flex serialization, asynchronous
communication, support for additional data types, custom adapters, connection scalability, data push over
sockets, and transactions. Server-side proxy and its usage for HTTP-based calls as well as web services
were also illustrated.
Data services positions the Adobe Flex and AIR technologies as viable choices for some serious
applications for the present and the future. In the age of event-driven, real-time, responsive rich systems,
where the Web is transforming itself into a read-write media network, technologies as these are bound to
shine.

Get AdvancED Flex 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.