String inputName = (input == null) ? null : input.getName();
String outputName = (output == null) ? null : output.getName();
Message inputMessage = (input == null) ? null : input.getMessage();
Message outputMessage = (output == null) ? null : output.getMessage();
WSIFOperation wsifOperation =
wsifport.createOperation(method.getName(), inputName, outputName);
// make the msg names for compiled msgs xxxAnt ask Mark why diff from inputName
String inputMsgName = "";
if (input != null) {
Message m = input.getMessage();
if (m != null) {
QName qn = m.getQName();
inputMsgName = (qn == null) ? "" : qn.getLocalPart();
}
}
String outputMsgName = "";
if (output != null) {
Message m = output.getMessage();
if (m != null) {
QName qn = m.getQName();
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();