if (nextMimePart instanceof MIMEPart) {
MIMEPart mimePart = (MIMEPart) nextMimePart;
if (!MIMEConstants
.NS_URI_MIME
.equals(mimePart.getElementType().getNamespaceURI()))
throw new WSIFException(
"A MIME part in binding operation "
+ bindingOperation.getName()
+ " did not have the correct namespace URI of "
+ MIMEConstants.NS_URI_MIME
+ ".");
boolean containsSoapBody = false;
boolean containsMimeContent = false;
List mimePartChildren = mimePart.getExtensibilityElements();
Iterator mimePartChildrenIt = mimePartChildren.iterator();
while (mimePartChildrenIt.hasNext()) {
Object nextChild = mimePartChildrenIt.next();
if (nextChild instanceof MIMEContent) {
MIMEContent mimeContent = (MIMEContent) nextChild;
if (!MIMEConstants
.NS_URI_MIME
.equals(
mimePart.getElementType().getNamespaceURI()))
throw new WSIFException(
"A MIME part in binding operation "
+ bindingOperation.getName()
+ " did not have the correct namespace URI of "
+ MIMEConstants.NS_URI_MIME
+ ".");
containsMimeContent = true;
if (containsSoapBody)
throw new WSIFException(
"A mime:part that contains a mime:content also "
+ "contains a soap:body. Operation="
+ getName());
String partName = mimeContent.getPart();
if (partName == null || partName.length() == 0)
throw new WSIFException(
"No part name for a mime:content. Operation="
+ getName());
if ((isInput && mapInParts.get(partName) == null)
|| (!isInput && mapOutParts.get(partName) == null))
throw new WSIFException(
"The part specified in a mime:content does "
+ "not exist in the operation. Operation="
+ getName()
+ " Part="
+ partName);
mimePartNames.add(partName);
} else if (nextChild instanceof SOAPBody) {
if (soapBody!=null) {
throw new WSIFException(
"Multiple soap:body tags found in a "
+ "mime:multipartRelated. Operation="
+ getName());
}
soapBody = (SOAPBody)nextChild;
containsSoapBody = true;
if (containsMimeContent)
throw new WSIFException(
"A mime:part that contains a mime:content also "
+ "contains a soap:body. Operation="
+ getName());
} else if (nextChild instanceof MIMEMultipartRelated) {
throw new WSIFException(
"WSIF does not support nesting mime:multipartRelated "
+ "inside a mime:part. Operation="
+ getName());
} else if (nextChild instanceof MIMEMimeXml) {
throw new WSIFException(
"WSIF does not support mime:mimeXml. Operation="
+ getName());
}
}
}