if (empty($payloadType)) { $out->writeObject($payload); } else { $clazz = Classes::classOf($payloadType); $out->writeValue($clazz, $payload); } $sink->accept($command); } public static function streamResponseForFailure(ClientOracle $clientOracle, OutputStream $out, Exception $payload) { $sink = $clientOracle->createCommandSink($out); self::streamResponse($clientOracle, $payload, $sink, true); $sink->finish(); } } RPC::init(); class RpcRequest { public $service; public $method; public $parameters; public function __construct($service, $method, $parameters) { $this->service = $service; $this->method = $method; $this->parameters = $parameters; } } /** @gwtname com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException */ class IncompatibleRemoteServiceException extends Exception {