Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function split() is deprecated in /home3/vvaswani/public_html/community/columns/trog/article.php on line 101

Deprecated: Function eregi_replace() is deprecated in /home3/vvaswani/sql.php on line 301

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home3/vvaswani/public_html/community/columns/trog/article.php on line 107

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home3/vvaswani/public_html/community/columns/trog/article.php on line 109

Deprecated: Function ereg_replace() is deprecated in /home3/vvaswani/public_html/community/columns/trog/article.php on line 124

Deprecated: Function ereg_replace() is deprecated in /home3/vvaswani/public_html/community/columns/trog/article.php on line 125

Deprecated: Function split() is deprecated in /home3/vvaswani/public_html/community/columns/trog/article.php on line 127

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174
The Melonfire Community - Trog
Logo         Community
  Trog
Services
The Company
Community
Columns
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"?>
<methodCall>
<methodName>getFlavourOfTheDay</methodName>
<params>
<param>
<value><string>Tuesday</string></value>
</param>
</params>
</methodCall>


And here's what the response might look like:


<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value><string>blueberry</string></value>
</param>
</params>
</methodResponse>


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
 
Search...
 
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
more...
 
In the hitg report...
Crime Scenes
Animal Attraction
Lord Of The Strings
more...
 
In boombox...
Patience - George Michael
Think Tank - Blur
My Private Nation - Train
more...
 
In colophon...
Hostage - Robert Crais
The Dead Heart - Douglas Kennedy
Right As Rain - George Pelecanos
more...
 
In cut!...
American Chai
The Core
Possession
more...
 
Find out how you can use this article on your own Web site!


Copyright © 1998-
Strict Standards: mktime(): You should be using the time() function instead in /home3/vvaswani/public_html/community/columns/trog/article.php on line 731
2017 Melonfire. All rights reserved
Terms and Conditions | Feedback