use of org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WrapperAnnotator in project cxf by apache.
the class OperationProcessor method processMethod.
void processMethod(JavaMethod method, OperationInfo operation) throws ToolException {
if (isAsyncMethod(method)) {
return;
}
MessageInfo inputMessage = operation.getInput();
MessageInfo outputMessage = operation.getOutput();
if (inputMessage == null) {
LOG.log(Level.WARNING, "NO_INPUT_MESSAGE", new Object[] { operation.getName() });
org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message("INVALID_MEP", LOG, new Object[] { operation.getName() });
throw new ToolException(msg);
}
ParameterProcessor paramProcessor = new ParameterProcessor(context);
method.clear();
JAXWSBinding opBinding = operation.getExtensor(JAXWSBinding.class);
JAXWSBinding ptBinding = operation.getInterface().getExtensor(JAXWSBinding.class);
JAXWSBinding defBinding = operation.getInterface().getService().getDescription().getExtensor(JAXWSBinding.class);
boolean enableAsync = false;
boolean enableMime = false;
boolean enableWrapper = method.isWrapperStyle();
if (defBinding != null) {
if (defBinding.isSetEnableMime()) {
enableMime = defBinding.isEnableMime();
}
if (defBinding.isSetEnableAsyncMapping()) {
enableAsync = defBinding.isEnableAsyncMapping();
}
if (defBinding.isSetEnableWrapperStyle()) {
enableWrapper = defBinding.isEnableWrapperStyle();
}
}
if (ptBinding != null) {
if (ptBinding.isSetEnableMime()) {
enableMime = ptBinding.isEnableMime();
}
if (ptBinding.isSetEnableAsyncMapping()) {
enableAsync = ptBinding.isEnableAsyncMapping();
}
if (ptBinding.isSetEnableWrapperStyle()) {
enableWrapper = ptBinding.isEnableWrapperStyle();
}
}
if (opBinding != null) {
if (opBinding.isSetEnableMime()) {
enableMime = opBinding.isEnableMime();
}
if (opBinding.isSetEnableAsyncMapping()) {
enableAsync = opBinding.isEnableAsyncMapping();
}
if (opBinding.isSetEnableWrapperStyle()) {
enableWrapper = opBinding.isEnableWrapperStyle();
}
}
enableWrapper = checkEnableWrapper(enableWrapper, method);
enableAsync = checkEnableAsync(enableAsync, method);
enableMime = checkEnableMime(enableMime, method);
method.setWrapperStyle(enableWrapper && method.isWrapperStyle());
paramProcessor.process(method, inputMessage, outputMessage, operation.getParameterOrdering());
if (method.isWrapperStyle()) {
setWrapper(operation);
method.annotate(new WrapperAnnotator(wrapperRequest, wrapperResponse));
}
method.annotate(new WebMethodAnnotator());
method.annotate(new WebResultAnnotator());
if (!method.isOneWay() && enableAsync && !isAddedAsycMethod(method)) {
addAsyncMethod(method);
}
if (enableMime) {
method.setMimeEnable(true);
}
}
Aggregations