void main (string[] args) {
	try {
		var main_loop = new MainLoop ();
		Bus.own_name (BusType.SESSION, "org.vala.Test", BusNameOwnerFlags.NONE,
			(connection) => {
				try {
					connection.register_object ("/org/vala/test", new Server ());
					do_test.begin (() => main_loop.quit ());
				} catch (IOError e) {
					critical ("Could not register service");
				}
			});
		main_loop.run ();
	} catch (IOError err) {
		critical (err.message);
	}
}

async void do_test () {
	try {
		var client = yield Bus.get_proxy<Client> (BusType.SESSION,
			"org.vala.Test", "/org/vala/test");
		yield client.test ();
	} catch (IOError err) {
		critical (err.message);
	}
}

[DBus (name = "org.vala.Test")]
interface Client : Object {
	[DBus (timeout = 30000)]
	public abstract async void test () throws IOError;
}

[DBus (name = "org.vala.Test")]
class Server : Object {
	public async void test () {
		message ("client called test");
	}
}