outputMsgName = (qn == null) ? "" : qn.getLocalPart();
}
}
// There must be an inputMessage.
WSIFMessage wsifInputMessage =
wsifOperation.createInputMessage(inputMsgName);
// There may not be an output message.
WSIFMessage wsifOutputMessage = null;
WSIFMessage wsifFaultMessage = null;
if (output != null) {
wsifOutputMessage = wsifOperation.createOutputMessage(inputMsgName);
wsifFaultMessage = wsifOperation.createFaultMessage(inputMsgName);
}
List inputParts = (inputMessage == null)
? new ArrayList()
: inputMessage.getOrderedParts(null);
if (args != null) {
if (inputParts.size() != args.length) {
unWrapIfWrappedDocLit(inputParts, operation.getName());
}
Iterator partIt = inputParts.iterator();
for (int argIndex = 0; partIt.hasNext(); argIndex++) {
Part part = (Part) partIt.next();
String partName;
if (isWrappedInContext()) {
QName qn = part.getElementName();
partName = (qn == null) ? "" : qn.getLocalPart();
} else {
partName = part.getName();
}
wsifInputMessage.setObjectPart(partName, args[argIndex]);
}
}
if (output == null)
wsifOperation.executeInputOnlyOperation(wsifInputMessage);
else {
boolean success =
wsifOperation.executeRequestResponseOperation(
wsifInputMessage,
wsifOutputMessage,
wsifFaultMessage);
if (!success) {
StringBuffer sb = new StringBuffer();
Iterator it = wsifFaultMessage.getPartNames();
while (it.hasNext()) {
String name = (String) it.next();
sb.append(name).append(":").append(
wsifFaultMessage.getObjectPart(name)).append(
" ");
}
throw new WSIFException(sb.toString());
}
}