List bindList = binding.getBindingOperations();
Map mimeTypes = new HashMap();
for (Iterator opIterator = bindList.iterator(); opIterator.hasNext();) {
BindingOperation bindOp = (BindingOperation) opIterator.next();
BindingInput bindingInput = bindOp.getBindingInput();
BindingOutput bindingOutput = bindOp.getBindingOutput();
String opName = bindOp.getName();
// First, make sure the binding operation matches a portType operation
String inputName = bindingInput == null ? null :
bindingInput.getName();
String outputName = bindingOutput == null ? null :
bindingOutput.getName();
if (binding.getPortType().getOperation(
opName, inputName, outputName) == null) {
throw new IOException(Messages.getMessage("unmatchedOp",
new String[] {opName, inputName, outputName}));
}
int inputBodyType = BindingEntry.USE_ENCODED;
int outputBodyType = BindingEntry.USE_ENCODED;
Map opMimeTypes = new HashMap();
mimeTypes.put(opName, opMimeTypes);
// input
if (bindingInput != null) {
if (bindingInput.getExtensibilityElements() != null) {
Iterator inIter = bindingInput.getExtensibilityElements().iterator();
for (; inIter.hasNext();) {
Object obj = inIter.next();
if (obj instanceof SOAPBody) {
String use = ((SOAPBody) obj).getUse();
if (use == null) {
throw new IOException(Messages.getMessage(
"noUse", opName));
}
if (use.equalsIgnoreCase("literal")) {
inputBodyType = BindingEntry.USE_LITERAL;
}
break;
}
else if (obj instanceof MIMEMultipartRelated) {
IntHolder holder = new IntHolder(inputBodyType);
opMimeTypes.putAll(collectMIMETypes(
(MIMEMultipartRelated) obj, holder, bindOp));
inputBodyType = holder.value;
}
}
}
}
// output
if (bindingOutput != null) {
if (bindingOutput.getExtensibilityElements() != null) {
Iterator outIter = bindingOutput.getExtensibilityElements().iterator();
for (; outIter.hasNext();) {
Object obj = outIter.next();
if (obj instanceof SOAPBody) {
String use = ((SOAPBody) obj).getUse();
if (use == null) {