Code: Select all
Future<GetResultKmPerHourResponse> result = port.getResultKmPerHourAsync(r);
while (!result.isDone()) {
System.out.println(".");
}
GetResultKmPerHourResponse km = (GetResultKmPerHourResponse) result.get();
This gives a compile error which can be fixed like this: Future<GetResultKmPerHourResponse> asyncResult = (Future<GetResultKmPerHourResponse>) port.getResultKmPerHourAsync(r, callbackHandler);
I think it is correct, because Response implements Future
and about first (correct) answer:
Code: Select all
MyCallBackHandler<GetResultKmPerHourResponse> callbackHandler = new MyCallBackHandler<GetResultKmPerHourResponse>();
Future<?> asyncResult = port.getResultKmPerHourAsync(r, callbackHandler);
GetResultKmPerHourResponse res = callbackHandler.getOutput();