return;
}
WSIFOperation op = port.createOperation("getAddressFromName");
AsyncResponseHandler abHandler = new AsyncResponseHandler(1);
// 1 async call
WSIFMessage inMsg = op.createInputMessage();
inMsg.setObjectPart("name", "fred");
WSIFMessage outmsg = op.createOutputMessage();
WSIFMessage faultMsg = op.createFaultMessage();
WSIFMessage context = op.getContext();
context.setObjectPart(
WSIFConstants.CONTEXT_JMS_PREFIX + "JMSReplyTo",
TestUtilities.getWsifProperty("wsif.async.replytoq"));
if ("SOAPJMSPort2".equals(portName)
|| "NativeJmsPort2".equals(portName)) {
inMsg.setObjectPart("asyncTimeout", "" + spa2);
}
if ("SOAPJMSPort3".equals(portName)
|| "NativeJmsPort3".equals(portName)
|| "SOAPJMSPort6".equals(portName)
|| "NativeJmsPort6".equals(portName)) {
context.setObjectPart(
WSIFConstants.WSIF_PROP_ASYNC_TIMEOUT,
"" + spa3);
}
op.setContext(context);
WSIFCorrelationId id =
op.executeRequestResponseAsync(inMsg, abHandler);
assertTrue(
"null correlation id returned from async request!",
id != null);
int i = 30;
while (i-- > 0 && !abHandler.isDone()) {
System.out.println("waiting for async responses - " + i);
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
}