Using AMFPHP with Web Services

If you’d like to use AMFPHP to connect to pre-existing SOAP-based web services, you don’t have to write a single line of PHP. As long as your installation of AMFPHP is set up properly, connecting to web services with it is a breeze and is nearly identical to the process you would with ColdFusion (ColdFusion is the only other Remoting gateway that automatically supports connecting to external web services). See Chapter 10 for more information about web services with ColdFusion and .NET.

Not all web services work with AMFPHP. This is a limitation of the SOAP libraries that AMFPHP uses rather than a limitation of the AMFPHP library itself. If you want to test to make sure a particular web service is accessible before you start doing heavy development against it, download the CMX Remoting Testing Tool from http://www.communitymx.com/abstract.cfm?cid=E79F1303C1E096ED. The tool is a free extension that adds a new CMX Remoting Testing Tool panel to the Flash MX authoring environment and allows you to quickly execute remote methods and see the results.

To use a web service with AMFPHP, you first need to know the URL of that web service’s WSDL file. A WSDL file is an XML file that describes a web service, including its URL, the methods it supports, and the arguments and return types of those methods. You can, in fact, open a WSDL file in a text editor and read this information from it. Of course, you also need to know the URL of the gateway.php file up on ...

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.