Class Ripcord_Client

Description

This class implements a simple RPC client, for XML-RPC, (simplified) SOAP 1.1 or Simple RPC. The client abstracts the entire RPC process behind native PHP methods. Any method defined by the rpc server can be called as if it was a native method of the rpc client.

E.g.

  1.   <?php
  2.     $client ripcord::client'http://www.moviemeter.nl/ws' );
  3.     $score $client->film->getScore'e3dee9d19a8c3af7c92f9067d2945b59'500 );
  4.   ?>

The client has a simple interface for the system.multiCall method:

  1.  <?php
  2.   $client ripcord::client'http://ripcord.muze.nl/ripcord.php' );
  3.   $client->system->multiCall()->start();
  4.   ripcord::bind$methods$client->system->listMethods() );
  5.   ripcord::bind$foo$client->getFoo() );
  6.   $client->system->multiCall()->execute();
  7.  ?>

The soap client can only handle the basic php types and doesn't understand xml namespaces. Use PHP's SoapClient for complex soap calls. This client cannot parse wsdl. If you want to skip the ripcord::client factory method, you _must_ provide a transport object explicitly.

Located in /ripcord_client.php (line 47)


	
			
Direct descendents
Class Description
Ripcord_Client_MultiCall This class provides the fetch interface for system.multiCall. It is returned
Variable Summary
Method Summary
Ripcord_Client __construct (string $url, [ $options = null], [ $transport = null], [object $rootClient = null])
void __call ( $name,  $args)
object A __get (string $name)
Variables
mixed $_autoDecode = true (line 117)

Whether or not to decode the XML-RPC datetime and base64 types to unix timestamp and binary string respectively.

  • access: public
mixed $_multiCall = false (line 91)

A flag to indicate if we are in a multiCall block. Start this with $client->system->multiCall()->start()

  • access: protected
mixed $_multiCallArgs = array() (line 96)

A list of deferred encoded calls.

  • access: protected
mixed $_request = '' (line 106)

The exact request from the client. For debugging purposes.

  • access: public
mixed $_response = '' (line 101)

The exact response from the rpc server. For debugging purposes.

  • access: public
mixed $_throwExceptions = false (line 111)

Whether or not to throw exceptions when an xml-rpc fault is returned by the server. Default is false.

  • access: public
Methods
Constructor __construct (line 126)

The constructor for the RPC client.

  • throws: Ripcord_ConfigurationException (ripcord::xmlrpcNotInstalled) when the xmlrpc extension is not available.
  • access: public
Ripcord_Client __construct (string $url, [ $options = null], [ $transport = null], [object $rootClient = null])
  • string $url: The url of the rpc server
  • array $options: Optional. A list of outputOptions. See Ripcord_Server::setOutputOption()
  • object $rootClient: Optional. Used internally when using namespaces.
  • $transport

Redefined in descendants as:
__call (line 165)

This method catches any native method called on the client and calls it on the rpc server instead. It automatically parses the resulting xml and returns native php type results.

  • throws: Ripcord_RemoteException when _throwExceptions is true and the server returns an XML-RPC Fault.
  • throws: Ripcord_InvalidArgumentException (ripcord::notRipcordCall) when handling a multiCall and the arguments passed do not have the correct method call information
  • access: public
void __call ( $name,  $args)
  • $name
  • $args
__get (line 283)

This method catches any reference to properties of the client and uses them as a namespace. The property is automatically created as a new instance of the rpc client, with the name of the property as a namespace.

  • return: Ripcord Client with the given namespace set.
  • access: public
object A __get (string $name)
  • string $name: The name of the namespace

Documentation generated on Tue, 16 Nov 2010 16:20:17 +0100 by phpDocumentor 1.4.3