Logo         Community
The Company
Your Account
Contact Us
Performing Remote Procedure Calls With PEAR XML_RPC
Learn to harness the power of XML-RPC in your PHP scripts

| Identity Crisis |

Before getting into the code, a few words about XML-RPC. According to the primer available on the official XML-RPC Web site (http://www.xmlrpc.com/), XML-RPC is "a spec and a set of implementations that allow software running on disparate operating systems, running in different environments to make procedure calls over the Internet...using HTTP as the transport and XML as the encoding".

If that was a little too geeky for you, allow me to simplify things. XML-RPC is a client-server paradigm which builds on existing Internet technologies to simplify the task of invoking procedures and accessing objects across a network. It uses XML to encode procedure invocations (and decode procedure responses) into a package suitable for transmission across a network, and HTTP to actually perform the transmission.

At one end of the connection, an XML-RPC server receives XML-RPC requests containing procedure calls, decodes them, invokes the named functions and packages the responses into XML-RPC response packets suitable for retransmission back to the requesting client. The client can then decode the response packets and use the results of the procedure invocation in whatever manner it chooses. The entire process is fairly streamlined and, because of its reliance on existing standards, relatively easy to understand and use.

Here's a quick example of what a XML-RPC request for the remote procedure getFlavourOfTheDay() might look like:

<?xml version="1.0"?>

And here's what the response might look like:

<?xml version="1.0"?>

In this case, XML is used to format a request for the remote procedure getFlavourOfTheDay(), and HTTP is used to transfer the request from the client to the server. At the server, the XML-formatted request is decoded, the procedure is executed with the given parameter, and the return value is re-encoded back into XML and transmitted to the client. The client then decodes the XML, extracts the return value and uses it as needed.

If you're new to XML-RPC, the information above should be sufficient to explain the basic concepts and ensure that you can follow the material that comes next; however, before proceeding, I'd recommend that you read the official XML-RPC specification, available at http://www.xmlrpc.com/spec.

How to do Everything with PHP & MySQL
How to do Everything with PHP & MySQL, the best-selling book by Melonfire, explains how to take full advantage of PHP's built-in support for MySQL and link the results of database queries to Web pages. You'll get full details on PHP programming and MySQL database development, and then you'll learn to use these two cutting-edge technologies together. Easy-to-follow sample applications include a PHP online shopping cart, a MySQL order tracking system, and a PHP/MySQL news publishing system.

Read more, or grab your copy now!

previous page more like this  print this article  next page
In trog...
Logging With PHP
Building A Quick-And-Dirty PHP/MySQL Publishing System
Output Buffering With PHP
Date/Time Processing With PHP
Creating Web Calendars With The PEAR Calendar Class
In the hitg report...
Crime Scenes
Animal Attraction
Lord Of The Strings
In boombox...
Patience - George Michael
Think Tank - Blur
My Private Nation - Train
In colophon...
Hostage - Robert Crais
The Dead Heart - Douglas Kennedy
Right As Rain - George Pelecanos
In cut!...
American Chai
The Core
Find out how you can use this article on your own Web site!

Copyright © 1998-2018 Melonfire. All rights reserved
Terms and Conditions | Feedback