Esempio n. 1
0
<?php

require_once '../src/Hprose.php';
$test = new HproseHttpClient("http://127.0.0.1:8000");
$args = array("world");
var_dump($test->invoke("hello", $args, 0, HproseResultMode::Serialized, 0));
var_dump($test->invoke("hello", $args, 0, HproseResultMode::Raw, 0));
var_dump($test->invoke("hello", $args, 0, HproseResultMode::RawWithEndTag, 0));
try {
    $test->e();
} catch (Exception $e) {
    var_dump($e->getMessage());
}
try {
    $test->ee();
} catch (Exception $e) {
    var_dump($e->getMessage());
}
$test->hello('async world', function ($result, $args, $error) {
    echo "result: ";
    var_dump($result);
    echo "args: ";
    var_dump($args);
    echo "error: ";
    var_dump($error);
});
$test->hello("async world2", function ($result, $args, $error) {
    echo "result: ";
    var_dump($result);
    echo "args: ";
    var_dump($args);