+ "'operationName:inputMessageName:outputMesssageName' to distinguish it");
}
found = true;
Input opInput = op.getInput();
inputName = (opInput.getName() == null) ? null : opInput.getName();
Output opOutput = op.getOutput();
outputName = (opOutput.getName() == null) ? null : opOutput.getName();
}
}
WSIFOperation operation =
port.createOperation(operationName, inputName, outputName);
WSIFMessage input = operation.createInputMessage();
WSIFMessage output = operation.createOutputMessage();
WSIFMessage fault = operation.createFaultMessage();
// retrieve list of names and types for input and names for output
List operationList = portType.getOperations();
// find portType operation to prepare in/oout message w/ parts
boolean found = false;
String[] outNames = new String[0];
Class[] outTypes = new Class[0];
for (Iterator i = operationList.iterator(); i.hasNext();) {
Operation op = (Operation) i.next();
String name = op.getName();
if (!name.equals(operationName)) {
continue;
}
if (found) {
throw new RuntimeException("overloaded operations are not supported in this sample");
}
found = true;
//System.err.println("op = "+op);
Input opInput = op.getInput();
// first determine list of arguments
String[] inNames = new String[0];
Class[] inTypes = new Class[0];
if (opInput != null) {
List parts = opInput.getMessage().getOrderedParts(null);
unWrapIfWrappedDocLit(parts, name, def);
int count = parts.size();
inNames = new String[count];
inTypes = new Class[count];
retrieveSignature(parts, inNames, inTypes);
}
// now prepare out parameters
for (int pos = 0; pos < inNames.length; ++pos) {
String arg = args[pos + argShift];
Object value = null;
Class c = inTypes[pos];
if (c.equals(String.class)) {
value = arg;
} else if (c.equals(Double.TYPE)) {
value = new Double(arg);
} else if (c.equals(Float.TYPE)) {
value = new Float(arg);
} else if (c.equals(Integer.TYPE)) {
value = new Integer(arg);
} else if (c.equals(Boolean.TYPE)) {
value = new Boolean(arg);
} else {
throw new RuntimeException("not know how to convert '" + arg + "' into " + c);
}
input.setObjectPart(inNames[pos], value);
}
Output opOutput = op.getOutput();
if (opOutput != null) {
List parts = opOutput.getMessage().getOrderedParts(null);
unWrapIfWrappedDocLit(parts, name+"Response", def);
int count = parts.size();
outNames = new String[count];
outTypes = new Class[count];
retrieveSignature(parts, outNames, outTypes);