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:
- SSL support
- gzip compression?
- Enhance error handling and test, test, test...
public void | HessianClient 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. |