
This is the Title of the Book, eMatter Edition
Copyright © 2003 O’Reilly & Associates, Inc. All rights reserved.
Hello World
|
31
If you see only a blank screen, view the page’s source in your browser (using View ➝
Source in Internet Explorer, for example). If you receive an error, correct any errors
identified by the error message and try again. Like any URL, the web service URL
may be cached depending on the browser settings, so you should reload/refresh the
page to make sure the browser isn’t using the cached version. This web service can
also be seen at the author’s site at:
http://www.flash-remoting.com/oreilly/com/helloworld.cfc?wsdl
Switch to Flash and change the
myServicePath variable to point to the web service’s
WSDL file. If you are using the CFC to create the web service, the path will be:
var myServicePath = "http://yourservername/com/oreilly/frdg/HelloWorld.cfc?wsdl";
Test your movie, and you should see the output from the sayHello( ) method of the
web service. Although our web service is on the same server as the Flash Remoting
gateway, Flash Remoting is simply acting as a gateway when accessing an XML-
based (SOAP-compliant) web service. The web service can be on any computer
accessible via the network or the Internet.
When working with Flash Remoting and web services, you are not limited to ASP.NET,
ColdFusion, PHP, and J2EE. Web services can be implemented in:
• Python or Perl
• C or C++
• Any other language that has a SOAP library implementation
More information on web services can be found at:
http://www.xml.com/webservices
Overview
The Hello World example, while simple, illustrates the power of using Flash Remot-
ing. The core client-side ActionScript code is the same, regardless of the language or
server model that the remote service is written in. At most, only the path to the Flash
Remoting gateway or remote service is different.
Furthermore, none of the server-side code is Flash-specific. This means that you can
create libraries of functions that work from the server-side languages, for use with-
out Flash, which can also be called directly from Flash. In many cases, you will be
able to integrate a Flash front end with existing server-side code and libraries with lit-
tle or no changes on the server. (Details and exceptions are covered throughout the
rest of the book.)
Isolation between server-side and client-side code allows for a clean division of labor.
Server-side developers need not worry about what is calling their code; if there is a
well-defined API on the server, Flash developers can seamlessly hook into the server-
side code. Similarly, the Flash developer need not worry about the details of the
Kommentare zu diesen Handbüchern