User Guide
Table Of Contents
- Contents
- About Flash Remoting
- Getting Started
- Using Flash Remoting ActionScript
- Using the RemotingConnector component (Flash Professional only)
- Using Flash Remoting Data in ActionScript
- About Flash Remoting and data types
- Understanding Action Message Format
- Converting from ActionScript to application server data types
- Converting from application server data types to ActionScript
- ColdFusion to ActionScript data conversion issues
- About working with objects
- About working with RecordSet objects
- About working with XML
- The NetConnection Debugger
- Using Flash Remoting with ColdFusion MX
- Using Flash Remoting for Java
- About Flash Remoting for Java
- Calling Java classes or JavaBeans from ActionScript
- Calling Enterprise JavaBeans (EJBs) from Flash
- Calling servlets and JSPs from Flash
- Calling JMX MBeans from Flash (JRun only)
- Calling server-side ActionScript from Flash (JRun only)
- Handling function results in ActionScript
- Using Flash Remoting with JRun security
- Passing XML objects between Flash and Java
- Viewing Flash Remoting log entries
- Using Flash Remoting for Microsoft .NET
- Flash Remoting for Microsoft .NET
- Calling ASP.NET pages from Flash
- Making an ASP.NET page available to Flash Remoting
- Getting a reference to an ASPX-based service in ActionScript
- Invoking ASPX pages in ActionScript
- Using the Flash Remoting custom server control in ASPX pages
- Using the Flash Remoting namespace in code-behind files
- Using ASP.NET state management with Flash Remoting
- Using ASP.NET exception handling
- Using ADO.NET objects with Flash Remoting
- Displaying a RecordSet object in Flash with ActionScript
- Calling web services from Flash
- Calling ASP.NET assemblies from Flash
- Viewing Flash Remoting log entries
- Using NetServices and Connection Classes
- Index

Calling web services from Flash Remoting 115
Calling web services from Flash Remoting
Using Flash Remoting with ColdFusion, you can interact with web services directly from your
Flash applications without having to build a ColdFusion page or component. You write the code
to reference a web service in your Flash application and use ColdFusion only to perform the
access.
Web services are remote applications that expose their functions and associated parameters using
the Web Services Description Language (WSDL). WSDL files describe the functionality of a web
service, including available functions, parameters, and results. You use a Simple Object Access
Protocol (SOAP) proxy to parse the WSDL and make the remote service functions available in
your application.
ColdFusion MX contains a built-in SOAP proxy for interacting with web services. The
ColdFusion Flash Remoting service also includes a web service adapter, which employs the
ColdFusion SOAP proxy for calling methods, passing parameters, and returning results from web
services. Using the ColdFusion SOAP proxy, much of the complexity associated with
programming web services is removed.
Invoking web service methods using Flash Remoting
The following example shows an example of a Service constructor for accessing a web service:
import mx.remoting.Service;
//…
var myWebService:Service = new Service(
"http://localhost/flashservices/gateway",
null,
"URL_to_WSDL",
null,
null);
The Service constructor specifies the Flash Remoting service URL in ColdFusion and creates a
reference to the web service. No connection to ColdFusion is made until you make the service
function call.
The following example Service constructor references a petmarket web service, located at http://
examples.macromedia.com/flashservices/gateway, which returns a list of categories to display in a
DataGrid component:
var petMarketService:Service = new Service(
"http://examples.macromedia.com/flashservices/gateway",
new Log(),
"petmarket.api.catalogservice",
null,
null);
After you establish the gateway, you can call methods of the web service.
The petmarket web service contains a method named
getCategories(). This method takes a
string that specifies a language and returns a RecordSet object containing categories.
var temp_pc:PendingCall = petMarketService.getCategories("en_US");
temp_pc:responder = new
RelayResponder(this,"getCategories_Result","getCategories_Fault");