protected void createMessageParts(InterfaceInfo intf, OperationInfo op, Method method) {
final Class<?>[] paramClasses = method.getParameterTypes();
// Setup the input message
op.setProperty(METHOD, method);
MessageInfo inMsg = op.createMessage(this.getInputMessageName(op, method), MessageInfo.Type.INPUT);
op.setInput(inMsg.getName().getLocalPart(), inMsg);
final Annotation[][] parAnnotations = method.getParameterAnnotations();
final Type[] genParTypes = method.getGenericParameterTypes();
for (int j = 0; j < paramClasses.length; j++) {
if (Exchange.class.equals(paramClasses[j])) {
continue;
}
if (isInParam(method, j)) {
QName q = getInParameterName(op, method, j);
QName partName = getInPartName(op, method, j);
if (!isRPC(method) && !isWrapped(method)
&& inMsg.getMessagePartsMap().containsKey(partName)) {
LOG.log(Level.WARNING, "INVALID_BARE_METHOD", getServiceClass() + "." + method.getName());
partName = new QName(partName.getNamespaceURI(), partName.getLocalPart() + j);
q = new QName(q.getNamespaceURI(), q.getLocalPart() + j);
}
MessagePartInfo part = inMsg.addMessagePart(partName);
initializeParameter(part, paramClasses[j], genParTypes[j]);
//TODO:remove method param annotations
part.setProperty(METHOD_PARAM_ANNOTATIONS, parAnnotations);
part.setProperty(PARAM_ANNOTATION, parAnnotations[j]);
if (getJaxbAnnoMap(part).size() > 0) {
op.setProperty(WRAPPERGEN_NEEDED, true);
}
if (!isWrapped(method) && !isRPC(method)) {
part.setProperty(ELEMENT_NAME, q);
}
if (isHeader(method, j)) {
part.setProperty(HEADER, Boolean.TRUE);
if (isRPC(method) || !isWrapped(method)) {
part.setElementQName(q);
} else {
part.setProperty(ELEMENT_NAME, q);
}
}
part.setIndex(j);
}
}
sendEvent(Event.OPERATIONINFO_IN_MESSAGE_SET, op, method, inMsg);
boolean hasOut = hasOutMessage(method);
if (hasOut) {
// Setup the output message
MessageInfo outMsg = op.createMessage(createOutputMessageName(op, method),
MessageInfo.Type.OUTPUT);
op.setOutput(outMsg.getName().getLocalPart(), outMsg);
final Class<?> returnType = method.getReturnType();
if (!returnType.isAssignableFrom(void.class)) {
final QName q = getOutPartName(op, method, -1);
final QName q2 = getOutParameterName(op, method, -1);
MessagePartInfo part = outMsg.addMessagePart(q);
initializeParameter(part, method.getReturnType(), method.getGenericReturnType());
if (!isRPC(method) && !isWrapped(method)) {
part.setProperty(ELEMENT_NAME, q2);
}
final Annotation[] annotations = method.getAnnotations();
part.setProperty(METHOD_ANNOTATIONS, annotations);
part.setProperty(PARAM_ANNOTATION, annotations);
if (isHeader(method, -1)) {
part.setProperty(HEADER, Boolean.TRUE);
if (isRPC(method) || !isWrapped(method)) {
part.setElementQName(q2);
} else {
part.setProperty(ELEMENT_NAME, q2);
}
}
part.setIndex(0);
}
for (int j = 0; j < paramClasses.length; j++) {
if (Exchange.class.equals(paramClasses[j])) {
continue;
}
if (isOutParam(method, j)) {
if (outMsg == null) {
outMsg = op.createMessage(createOutputMessageName(op, method),
MessageInfo.Type.OUTPUT);
}
QName q = getOutPartName(op, method, j);
QName q2 = getOutParameterName(op, method, j);
if (isInParam(method, j)) {
q = op.getInput().getMessagePartByIndex(j).getName();
q2 = (QName)op.getInput().getMessagePartByIndex(j).getProperty(ELEMENT_NAME);
if (q2 == null) {
q2 = op.getInput().getMessagePartByIndex(j).getElementQName();
}
}
MessagePartInfo part = outMsg.addMessagePart(q);
part.setProperty(METHOD_PARAM_ANNOTATIONS, parAnnotations);
part.setProperty(PARAM_ANNOTATION, parAnnotations[j]);
initializeParameter(part, paramClasses[j], genParTypes[j]);
part.setIndex(j + 1);