XML_RPC2
[ class tree: XML_RPC2 ] [ index: XML_RPC2 ] [ all elements ]

Class: XML_RPC2_Client

Source Location: /XML_RPC2-1.0.5/XML/RPC2/Client.php

Class Overview


XML_RPC client class. Use this class to access remote methods.


Author(s):

Copyright:

  • 2004-2006 Sergio Carvalho

Variables

Methods


Child classes:

XML_RPC2_Backend_Xmlrpcext_Client
XML_RPC client backend class. This backend class uses the XMLRPCext extension to execute the call.
XML_RPC2_Backend_Php_Client
XML_RPC client backend class. This is the default, all-php XML_RPC client backend.

Inherited Variables

Inherited Methods


Class Details

[line 72]
XML_RPC client class. Use this class to access remote methods.

To use this class, construct it providing the server URL and method prefix. Then, call remote methods on the new instance as if they were local.

Example:

  1.   require_once 'XML_RPC2/Client.php';
  2.  
  3.   $client XML_RPC2_Client('http://xmlrpc.example.com/1.0/''example.');
  4.   $result $client->hello('Sergio');
  5.   print($result);

The above example will call the example.hello method on the xmlrpc.example.com server, under the /1.0/ URI.



[ Top ]


Class Variables

$debug =  false

[line 103]

Holds the debug flag
  • Access: protected

Type:   boolean


[ Top ]

$encoding =  'iso-8859-1'

[line 110]

Hold the encoding of the client request
  • Access: protected

Type:   string


[ Top ]

$prefix =  null

[line 96]

Holds the prefix to prepend to method names
  • Access: protected

Type:   string


[ Top ]

$proxy =  null

[line 89]

proxy Field (holds the proxy server data)
  • Access: protected

Type:   string


[ Top ]

$sslverify =  true

[line 117]

Hold the SSL verify flag
  • Access: protected

Type:   boolean


[ Top ]

$uglyStructHack =  true

[line 127]

ugly hack flag to avoid http://bugs.php.net/bug.php?id=21949

see XML_RPC2_Backend_Xmlrpcext_Value::createFromNative() from more infos

  • Access: protected

Type:   mixed


[ Top ]

$uri =  null

[line 82]

uri Field (holds the uri for the XML_RPC server)
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 153]

XML_RPC2_Client __construct( string $uri, [array $options = array()])

Construct a new XML_RPC2_Client.

To create a new XML_RPC2_Client, a URI must be provided (e.g. http://xmlrpc.example.com/1.0/). Optionally, some options may be set as an associative array. Accepted keys are : 'prefix', 'proxy', 'debug' => see correspondant property to get more informations

  • Access: protected

Overridden in child classes as:

XML_RPC2_Backend_Xmlrpcext_Client::__construct()
Construct a new XML_RPC2_Client PHP Backend.
XML_RPC2_Backend_Php_Client::__construct()
Construct a new XML_RPC2_Client PHP Backend.

Parameters:

string   $uri   —  URI for the XML-RPC server
array   $options   —  (optional) Associative array of options

[ Top ]

create   [line 205]

void create( string $uri, [array $options = array()])

Factory method to select, create and return a XML_RPC2_Client backend

To create a new XML_RPC2_Client, a URI must be provided (e.g. http://xmlrpc.example.com/1.0/).

Optionally, some options may be set.

  • Access: public

Parameters:

string   $uri   —  URI for the XML-RPC server
array   $options   —  (optional) associative array of options (see constructor)

[ Top ]

displayDebugInformations2___   [line 270]

void displayDebugInformations2___( mixed $result)

Display debug informations (part 2)

NB : The '___' at the end of the method name is to avoid collisions with XMLRPC __call()

  • Access: protected

Parameters:

mixed   $result   —  decoded server response

[ Top ]

displayDebugInformations___   [line 248]

void displayDebugInformations___( string $request, string $body)

Display debug informations

NB : The '___' at the end of the method name is to avoid collisions with XMLRPC __call()

  • Access: protected

Parameters:

string   $request   —  XML client request
string   $body   —  XML server response

[ Top ]

remoteCall___   [line 138]

void remoteCall___( string $methodName, array $parameters)

remoteCall executes the XML-RPC call, and returns the result

NB : The '___' at the end of the method name is to avoid collisions with XMLRPC __call()

  • Abstract:
  • Access: public

Overridden in child classes as:

XML_RPC2_Backend_Xmlrpcext_Client::remoteCall___()
remoteCall executes the XML-RPC call, and returns the result
XML_RPC2_Backend_Php_Client::remoteCall___()
remoteCall executes the XML-RPC call, and returns the result

Parameters:

string   $methodName   —  Method name
array   $parameters   —  Parameters

[ Top ]

testMethodName___   [line 290]

boolean testMethodName___( string $methodName)

Return true is the given method name is ok with XML/RPC spec.

NB : The '___' at the end of the method name is to avoid collisions with XMLRPC __call()

  • Return: true if ok
  • Access: protected

Parameters:

string   $methodName   —  method name

[ Top ]

__call   [line 230]

mixed __call( string $methodName, array $parameters)

__call Catchall. This method catches remote method calls and provides for remote forwarding.

If the parameters are native types, this method will use XML_RPC_Value::createFromNative to convert it into an XML-RPC type. Whenever a parameter is already an instance of XML_RPC_Value it will be used as provided. It follows that, in situations when XML_RPC_Value::createFromNative proves inacurate -- as when encoding DateTime values -- you should present an instance of XML_RPC_Value in lieu of the native parameter.

  • Return: The call result, already decoded into native types
  • Access: public

Parameters:

string   $methodName   —  Method name
array   $parameters   —  Parameters

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:25:26 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.