Search in sources :

Example 1 with MIMEPart

use of com.sun.tools.ws.wsdl.document.mime.MIMEPart in project metro-jax-ws by eclipse-ee4j.

the class WSDLModelerBase method validateMimeParts.

/**
 */
protected boolean validateMimeParts(Iterable<MIMEPart> mimeParts) {
    boolean gotRootPart = false;
    List<MIMEContent> mimeContents = new ArrayList<>();
    for (MIMEPart mPart : mimeParts) {
        for (TWSDLExtension obj : mPart.extensions()) {
            if (obj instanceof SOAPBody) {
                if (gotRootPart) {
                    warning(mPart, ModelerMessages.MIMEMODELER_INVALID_MIME_PART_MORE_THAN_ONE_SOAP_BODY(info.operation.getName().getLocalPart()));
                    return false;
                }
                gotRootPart = true;
            } else if (obj instanceof MIMEContent) {
                mimeContents.add((MIMEContent) obj);
            }
        }
        if (!validateMimeContentPartNames(mimeContents)) {
            return false;
        }
        if (mPart.getName() != null) {
            warning(mPart, ModelerMessages.MIMEMODELER_INVALID_MIME_PART_NAME_NOT_ALLOWED(info.portTypeOperation.getName()));
        }
    }
    return true;
}
Also used : MIMEContent(com.sun.tools.ws.wsdl.document.mime.MIMEContent) TWSDLExtension(com.sun.tools.ws.api.wsdl.TWSDLExtension) MIMEPart(com.sun.tools.ws.wsdl.document.mime.MIMEPart)

Aggregations

TWSDLExtension (com.sun.tools.ws.api.wsdl.TWSDLExtension)1 MIMEContent (com.sun.tools.ws.wsdl.document.mime.MIMEContent)1 MIMEPart (com.sun.tools.ws.wsdl.document.mime.MIMEPart)1