Chapter 5. Integrating Web Applications: XML-RPC in PHP

PHP is a popular open-source scripting language used to create web pages. Growing originally from a Perl application, PHP is now a fully fledged language that is most commonly used as a module for the Apache and IIS web servers, but is also available as a standalone interpreter. When PHP is embedded in a web server, standard HTML tags and PHP code can be mixed together freely in much same the way as other “server side include” technologies, such as Microsoft’s Active Server Pages or Allaire’s Cold Fusion can.

When a PHP-enabled web server serves a page, any PHP code found there is executed. The results of the PHP code and any HTML tags on that page are sent to the requesting browser. This arrangement can greatly simplify the lives of web designers and programmers. Once the programmers create PHP code that performs some required function, the web designers can make sure that the output of that code matches the rest of the web site. PHP has the capability to allow programs embedded in web pages to easily present data stored in databases, mail servers, and directory servers. With the addition of the XML-RPC library described in this chapter, PHP programmers can now participate in the emerging world of web services. The second half of this chapter presents a PHP application that uses XML-RPC to enhance an existing web service.

Although the examples in this chapter are largely self-explanatory, some small knowledge of PHP is expected ...

Get Programming Web Services with XML-RPC 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.