String asyncCname = null;
for (JavaParameter param : method.getParameters()) {
if (convertOutToAsync) {
if (param.isHolder()) {
if (param.isINOUT()) {
JavaParameter p2 = new JavaParameter();
p2.setName(param.getName());
p2.setClassName(param.getHolderName());
p2.setStyle(JavaType.Style.IN);
callbackMethod.addParameter(p2);
for (String s : param.getAnnotationTags()) {
JAnnotation ann = param.getAnnotation(s);
p2.addAnnotation(s, ann);
}
} else if (!param.isHeader() && asyncCname == null) {
asyncCname = param.getClassName();
}
} else {
callbackMethod.addParameter(param);
}
} else {
callbackMethod.addParameter(param);
}
}
JavaParameter asyncHandler = new JavaParameter();
asyncHandler.setName("asyncHandler");
asyncHandler.setCallback(true);
asyncHandler.setClassName(getAsyncClassName(method,
"AsyncHandler",
asyncCname));
asyncHandler.setStyle(JavaType.Style.IN);
callbackMethod.addParameter(asyncHandler);
JAnnotation asyncHandlerAnnotation = new JAnnotation(WebParam.class);
asyncHandlerAnnotation.addElement(new JAnnotationElement("name", "asyncHandler"));
asyncHandlerAnnotation.addElement(new JAnnotationElement("targetNamespace", ""));
asyncHandler.addAnnotation("WebParam", asyncHandlerAnnotation);
method.getInterface().addImport("javax.jws.WebParam");
method.getInterface().addMethod(callbackMethod);
}