Service Lookup
This section describes the process for identifying, locating, and invoking services through the Remoting gateway.
When multiple services methods are invoked in a single frame of a Flash movie, Remoting on the Flash client aggregates multiple service method calls in a single HTTP request. On the server, The Remoting gateway handles each service method call individually. The following discussion applies to both individual and aggregated service method calls.
Identifying Services
When a Flash client connects
to a service using NetConnection.getService( ),
the gateway tries to locate the named service that is passed as the
first argument. For JavaBean and Java class services, the service
name (or, more formally, the service identifier)
is the full class name, including the package, of the service
implementation class. This ActionScript example creates a service
reference to a Java class service with class name
"com.oreilly.frdg.java.JavaClassService
“:
var service = gatewayConnection.getService( "com.oreilly.frdg.java.JavaClassService", this);
For EJBs, the service name is the JNDI name of the EJB as it is
accessed from within the servlet container. The following
ActionScript example creates a service reference to an EJB service
with JNDI name "java:comp/env/ejb/EjbService
“.
var service = gatewayConnection.getService( "java:comp/env/ejb/EjbService", this);
For servlets, the service name is the web application context name (i.e., the URL prefix that identifies your web application). ...
Get Flash Remoting: The Definitive Guide 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.