| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Actually performs an XML_RPC request.
|
|
|
5 |
*
|
|
|
6 |
* PHP versions 4 and 5
|
|
|
7 |
*
|
|
|
8 |
* @category Web Services
|
|
|
9 |
* @package XML_RPC
|
|
|
10 |
* @author Daniel Convissor <danielc@php.net>
|
|
|
11 |
* @copyright 2005-2010 The PHP Group
|
|
|
12 |
* @license http://www.php.net/license/3_01.txt PHP License
|
|
|
13 |
* @version SVN: $Id: actual-request.php 657 2011-08-29 19:39:57Z tiefland $
|
|
|
14 |
* @link http://pear.php.net/package/XML_RPC
|
|
|
15 |
* @since File available since Release 1.5.3
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
/*
|
|
|
19 |
* If the package version number is found in the left hand
|
|
|
20 |
* portion of the if() expression below, that means this file has
|
|
|
21 |
* come from the PEAR installer. Therefore, let's test the
|
|
|
22 |
* installed version of XML_RPC which should be in the include path.
|
|
|
23 |
*
|
|
|
24 |
* If the version has not been substituted in the if() expression,
|
|
|
25 |
* this file has likely come from a SVN checkout or a .tar file.
|
|
|
26 |
* Therefore, we'll assume the tests should use the version of
|
|
|
27 |
* XML_RPC that has come from there as well.
|
|
|
28 |
*/
|
|
|
29 |
if ('1.5.5' == '@'.'package_version'.'@') {
|
|
|
30 |
ini_set('include_path', '../'
|
|
|
31 |
. PATH_SEPARATOR . '.' . PATH_SEPARATOR
|
|
|
32 |
. ini_get('include_path')
|
|
|
33 |
);
|
|
|
34 |
}
|
|
|
35 |
require_once 'XML/RPC/Dump.php';
|
|
|
36 |
|
|
|
37 |
|
|
|
38 |
$debug = 0;
|
|
|
39 |
|
|
|
40 |
$params = array(
|
|
|
41 |
new XML_RPC_Value('php.net', 'string'),
|
|
|
42 |
);
|
|
|
43 |
$msg = new XML_RPC_Message('domquery', $params);
|
|
|
44 |
$client = new XML_RPC_Client('/api/xmlrpc', 'www.adamsnames.com');
|
|
|
45 |
$client->setDebug($debug);
|
|
|
46 |
|
|
|
47 |
$resp = $client->send($msg);
|
|
|
48 |
if (!$resp) {
|
|
|
49 |
echo 'Communication error: ' . $client->errstr;
|
|
|
50 |
exit(1);
|
|
|
51 |
}
|
|
|
52 |
if ($resp->faultCode()) {
|
|
|
53 |
/*
|
|
|
54 |
* Display problems that have been gracefully cought and
|
|
|
55 |
* reported by the xmlrpc.php script
|
|
|
56 |
*/
|
|
|
57 |
echo 'Fault Code: ' . $resp->faultCode() . "\n";
|
|
|
58 |
echo 'Fault Reason: ' . $resp->faultString() . "\n";
|
|
|
59 |
exit(1);
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
$val = $resp->value();
|
|
|
63 |
XML_RPC_Dump($val);
|