Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
3520
PHP XML RPC Parse Method Descriptions
PHP Version: (PHP 4 >= 4.1.0, PHP 5)
Description
This function decodes the xml into a set of method
description.
This function decodes the
xml into a set of method description. The main objective of this function is to
convert the request xml into a list of method description so that you can call
appropriate method during server processing.
PHP
Code:
This is the server code:
<?php
//This method will be invoked
by the server.
function dummyresponse($method, $params) {
switch($params[0]) {
case 'test1':
$reply = 'Your request string
contains test1.';
break;
case 'test2':
$reply = 'Your request string
contains test2.';
break;
default:
$reply = 'You have requested with no
parameters';
}
return $reply;
}
//create a server
$server = xmlrpc_server_create();
//register the 'dummyserver' name as external name and then the 'dummyresponse' name is the actual
$query = "POST /default/php/xmlrpc_parse_method_descriptionsserve.php
HTTP/1.0\nUser_Agent: This is a Dummy Client\nHost:
".$host."\nContent-Type:
text/xml\nContent-Length: ".strlen($request)."\n\n".$request."\n";