Chapter 6. PHP and XML-Based Remote Procedure Calls (RPC)

I l @ ve RuBoard

graphics/chic01.gif

"Any sufficiently advanced technology is indistinguishable from magic."

”Arthur C. Clarke

It's quite likely, if you're coming at this from a non-C/C++ background, that you've never heard of Remote Procedure Calls (RPC). This is a shame, because not only has RPC been around for a while, it's also a fairly interesting idea that opens the door to a whole new generation of cutting-edge, network-based services.

Stripped down to its bare bones, RPC defines a client-server framework for distributed computing, allowing procedures on a server to be remotely executed by a client. The existing network layer is used for communication between the client and server; this implies that the client invoking the procedure may be on either the same physical machine or a completely different machine on the network (hence the term remote procedure call ).

Now, the Internet is the biggest, baddest network of them all; and when it comes to implementing RPC over the web, it makes sense to use HTTP as the transport layer and XML as the encoding toolkit. All that's required is a formal specification to handle the nitty-gritty details: the format of RPC requests and responses, data types, error handling, and so on. And so we have XML-RPC, a specification for encoding remote procedure calls in XML; and Simple Object Access Protocol (SOAP), an emerging W3C standard for encoding and packaging data for distribution across a peer-to-peer network. Both are XML-based technologies, both are fairly simple to use, and both are supported in PHP 4.1.0.

In the preceding chapter, you saw how potent the XML/PHP combination can be, and how much it simplifies information exchange over the web. This chapter takes things a step further by examining, through examples and code listings, how PHP's implementation of XML-based RPC can be used to enable new types of distributed, web-based applications and services.

I l @ ve RuBoard


XML and PHP
XML and PHP
ISBN: 0735712271
EAN: 2147483647
Year: 2002
Pages: 84

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net