Escolar Documentos
Profissional Documentos
Cultura Documentos
Introduction-
CONFIDENTIAL
LCDS Feature:-
CONFIDENTIAL
Blaze-DS Feature in Red Box :-
CONFIDENTIAL
Blaze-DS is good because it uses AMF ?
What is AMF ??
It stands for “Action Message Format”.
CONFIDENTIAL
Blaze-DS is good because it uses AMF ?
What is AMF ??
It stands for “Action Message Format”.
CONFIDENTIAL
Services provided in Blaze-DS
CONFIDENTIAL
Remote procedure call (RPC) component
HTTP services .
Web services .
Java objects (remote object
services) .
CONFIDENTIAL
Steps in Creating RPC Clients-
CONFIDENTIAL
Parameter binding Example
CONFIDENTIAL
Explicit parameter passing Example :-
<mx:RemoteObject id="employeeRO"
destination="SalaryManager" result="empList=event.result"
fault="Alert.show(event.fault.faultString, 'Error');"/>
<mx:ComboBox id="dept" width="150">
<mx:dataProvider>
<mx:ArrayCollection>
<mx:source>
<mx:Object label="Engineering"
data="ENG"/> <mx:Object label="Product
Management" data="PM"/> <mx:Object
label="Marketing" data="MKT"/>
</mx:source>
</mx:ArrayCollection>
</mx:dataProvider>
</mx:ComboBox>
<mx:Button label="Get Employee List"
click="employeeRO.getList(dept.selectedItem.data);"/>
CONFIDENTIAL
Configuring RPC Services:-
Destination configuration .
CONFIDENTIAL
Destination configuration Example:-
<service id="remoting-service"
class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
</adapters>
<default-channels>
<channel ref="samples-amf"/>
</default-channels>
<destination id="SampleEmployeeRO">
<properties>
<source>samples.explorer.EmployeeManager</source>
<scope>application</scope>
</properties>
<security>
<security-constraint ref="privileged-users"/>
</security>
</destination>
</service>
CONFIDENTIAL
Configuring destination properties :-
CONFIDENTIAL
Serializing Data (AS to Java) :-
CONFIDENTIAL
Serializing Data ( Java to AS) :-
enum (JDK 1.5) -> String
java.lang.String -> String
java.lang.Boolean, boolean -> Boolean
java.lang.Integer, int -> int
java.lang.Short, short -> int
ava.lang.Byte, byte[] -> int
java.lang.Byte[] -> flash.utils.ByteArray
java.lang.Double, double -> Number
java.lang.Character, char -> String
java.util.Calendar -> Date
java.util.Date -> Date
java.util.Collection -> mx.collections.ArrayCollection
java.util.Map -> Object
org.w3c.dom.Document -> XML object
CONFIDENTIAL
Explicitly mapping ActionScript and Java objects
CONFIDENTIAL
Configuring Blaze-DS :-
Important Files :--
services-config.xml
The top-level Blaze-DS configuration file. This file usually contains
security constraint definitions, channel definitions, and logging
settings that each of the services can use. It can contain service
definitions inline or include them by reference. Generally, the services
are defined in the remoting-config.xml, proxy-config.xml, and
messaging-config.xml.
remoting-config.xml
The Remoting Service configuration file, which defines Remoting
Service destinations for working with remote objects.
proxy-config.xml
The Proxy Service configuration file, which defines Proxy Service
destinations for working with web services and HTTP services (REST
services).
messaging-config.xml
The Message Service configuration file, which defines Message Service
destinations for performing publish subscribe messaging.
CONFIDENTIAL
Securing destinations(Custom) :-
Custom
<service>
<destination id="roDest">
<security>
<security-constraint>
<auth-method>Custom</auth-method>
<roles><role> sampleuser r</role> </roles>
</security-constraint>
</security>
</destination>
</service>
tomcatUser.xml should contain the following entry:--
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="sampleuser"/>
<user username="tomcat" password=“facetime" roles=" sampleuser "/>
</tomcat-users>
CONFIDENTIAL
Passing credentials to a remote service:-
var employeeHTTP:HTTPService = new HTTPService();
employeeHTTP.destination = "secureJSP";
employeeHTTP.setRemoteCredentials
("myRemoteUserName", "myRemotePassword");
employeeHTTP.send({param1: 'foo'});
CONFIDENTIAL
Securing destinations(Basic) :-
Basic <security-constraint id="privileged-users">
<auth-method>Basic</auth-method>
<roles> <role>privilegedusers</role> </roles>
</security-constraint>
In Web.xml the following need to be set :-
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Channel</web-resource-
name>
<url-pattern>/messagebroker/amf</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>sampleusers</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role> <role-name>sampleusers</role-name> </security-role>
CONFIDENTIAL
Login adapters :-
CONFIDENTIAL
Monitoring and managing services :-
CONFIDENTIAL
Server-side service logging:-
We can set the logging level to one of the following available levels:
all ,debug ,info ,warn ,error ,none .
Example :-
<logging>
<target class="flex.messaging.log.ConsoleTarget"
level="Debug">
<properties>
<prefix>[Blaze-Ds-Test-By-Subrata]</prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>false</includeLevel>
<includeCategory>false</includeCategory>
</properties>
<filters>
<pattern>Endpoint</pattern>
</filters>
</target>
</logging>
CONFIDENTIAL
The End
PPT By- Subrata Saha
CONFIDENTIAL