Book Image

PHP Ajax Cookbook

Book Image

PHP Ajax Cookbook

Overview of this book

Table of Contents (16 chapters)
PHP Ajax Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

XML-RPC


XML-Remote Procedure call is another way of providing and consuming web services. XML-RPC uses XML to encode the request and response of the services and HTTP as a transport medium for them.

XML-RPC is a very simple protocol for using and consuming web services. It has a definite set of XML formats for defining the procedure, the data type, and commands. XML-RPC is designed to be as simple as possible. It allows complex data structures to be transmitted, processed, and returned using its procedures. Let's look at an XML request format for calling a remote procedure using XML-RPC and then look at the response returned by the server in XML-RPC format.

<?xml version="1.0"?>
<methodCall>
  <methodName>examples.getProductName</methodName>
  <params>
    <param>
        <value><int>10</int></value>
    </param>
  </params>
</methodCall>

As you can see, XML format for sending requests is fairly simple and even the...