*
* @param o
* @param method
*/
protected boolean initializeClassInfo(OperationInfo o, Method method, List<String> paramOrder) {
OperationInfo origOp = o;
if (isWrapped(method)) {
if (o.getUnwrappedOperation() == null) {
//the "normal" algorithm didn't allow for unwrapping,
//but the annotations say unwrap this. We'll need to
//make it.
WSDLServiceBuilder.checkForWrapped(o, true);
}
if (o.getUnwrappedOperation() != null) {
if (o.hasInput()) {
MessageInfo input = o.getInput();
MessagePartInfo part = input.getMessageParts().get(0);
part.setTypeClass(getRequestWrapper(method));
part.setProperty("REQUEST.WRAPPER.CLASSNAME", getRequestWrapperClassName(method));
part.setIndex(0);
}
if (o.hasOutput()) {
MessageInfo input = o.getOutput();
MessagePartInfo part = input.getMessageParts().get(0);
part.setTypeClass(getResponseWrapper(method));
part.setProperty("RESPONSE.WRAPPER.CLASSNAME", getResponseWrapperClassName(method));
part.setIndex(0);
}
setFaultClassInfo(o, method);
o = o.getUnwrappedOperation();
} else {
LOG.warning(new Message("COULD_NOT_UNWRAP", LOG, o.getName(), method).toString());
setFaultClassInfo(o, method);
}
} else if (o.isUnwrappedCapable()) {
// remove the unwrapped operation because it will break the
// the WrapperClassOutInterceptor, and in general makes
// life more confusing
o.setUnwrappedOperation(null);
setFaultClassInfo(o, method);
}
o.setProperty(METHOD_PARAM_ANNOTATIONS, method.getParameterAnnotations());
o.setProperty(METHOD_ANNOTATIONS, method.getAnnotations());
Class<?>[] paramTypes = method.getParameterTypes();
Type[] genericTypes = method.getGenericParameterTypes();
for (int i = 0; i < paramTypes.length; i++) {
if (Exchange.class.equals(paramTypes[i])) {
continue;
}
Class<?> paramType = paramTypes[i];
Type genericType = genericTypes[i];
if (!initializeParameter(o, method, i, paramType, genericType)) {
return false;
}
}
sendEvent(Event.OPERATIONINFO_IN_MESSAGE_SET, origOp, method, origOp.getInput());
// Initialize return type
if (o.hasOutput()
&& !initializeParameter(o, method, -1, method.getReturnType(), method.getGenericReturnType())) {
return false;
}
if (origOp.hasOutput()) {
sendEvent(Event.OPERATIONINFO_OUT_MESSAGE_SET, origOp, method, origOp.getOutput());
}
setFaultClassInfo(o, method);
return true;
}