Web Services from PHP
Setting up AMFPHP for web services is covered in Chapter 9. There are two web service options for AMFPHP: nuSOAP and PEAR::SOAP. The examples should work with either. The AMFPHP gateway requires that web services be called with the arguments attached to an ActionScript object. The Whois web service described earlier requires these three named arguments:
-
SRLFile The name of the Service Request Language File (”
WHOIS.SRI" for domain checking).-
RequestName This should always be "
whois“.-
Key The domain name.
Other than that, the code can be used as-is from the ColdFusion MX example, substituting your own Flash Remoting gateway URL. The getWhois( ) function looks like this in the PHP example:
function getWhois ( ) {
myService.ProcessSRL({
SRLFile:"WHOIS.SRI",
RequestName:"whois",
Key:domain_txt.text});
}In the function, we are simply creating a generic object in the function call.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access