Overview  Package  Tree HessianPHP

HessianPHP.Client

Class HessianClient

HessianPHP.Client.HessianClient

class HessianClient

Proxy that allows RPC method calls to a remote Hessian compatible web-service It requires the url of the Hessian service.

Tested against Java and PHP services. It uses the overload extension of PHP 4 to execute the remote calls. PHP 5 supports overloading natively. If your PHP installation doesn't support overload, you can use direct calls to the __call() method using the arguments as detailed in http://us3.php.net/manual/en/ref.overload.php or in the documentation of this class
Sample usage:

$testurl = 'http://www.caucho.com/hessian/test/basic';
$proxy = &new HessianClient($testurl);
echo $proxy->hello();

WARNING: As in PHP 4.3.x, all method name metadata (get_class_methods(), overload extension __call()) is internally lower-cased so if you call a camel case remote method name, like 'getUsers', the call will result into a no such method fault because PHP will interpret the method name as 'getusers'. This is especially bad when calling Java services where many method names are camel cased. Sad but true.

To counterfeit this, use remoteMethod in the proxy object to tell Hessian how to call the method with the right name before executing the call. PHP 5 doesn't seem to be affected by this behavior.

TODO:

Author:
Manolo Gómez
Version:
1.0

Field Summary
Method Summary
public voidHessianClient

Constructor, requires the url of the remote Hessian service

public mixed__call

PHP magic function used to execute a remote call to a remote Hessian service.

Method Detail

HessianClient()

public void HessianClient(string url,
                          var $options = false)

Constructor, requires the url of the remote Hessian service

Parameters:
url - Url of the remote service
$options

__call()

public mixed __call(string method,
                    array params,
                    mixed return)

PHP magic function used to execute a remote call to a remote Hessian service.

Parameters:
method - Method name
params - Arguments
return - Returned value
Returns:
True if PHP 4, return value of the function otherwise

Overview  Package  Tree HessianPHP