Search in sources :

Example 1 with TWSDLExtension

use of com.sun.tools.ws.api.wsdl.TWSDLExtension in project metro-jax-ws by eclipse-ee4j.

the class JwsImplGenerator method getBindingType.

private String getBindingType(QName bName) {
    String value = null;
    // process the bindings in definitions of model.entity
    if (model.getEntity() instanceof Definitions) {
        Definitions definitions = (Definitions) model.getEntity();
        if (definitions != null) {
            Iterator bindings = definitions.bindings();
            if (bindings != null) {
                while (bindings.hasNext()) {
                    Binding binding = (Binding) bindings.next();
                    if (bName.getLocalPart().equals(binding.getName()) && bName.getNamespaceURI().equals(binding.getNamespaceURI())) {
                        List<TWSDLExtension> bindextends = (List<TWSDLExtension>) binding.extensions();
                        for (TWSDLExtension wsdlext : bindextends) {
                            value = resolveBindingValue(wsdlext);
                            if (value != null)
                                break;
                        }
                        break;
                    }
                }
            }
        }
    }
    // process the bindings in whole document
    if (value == null) {
        if (model.getEntity() instanceof Definitions) {
            Definitions definitions = (Definitions) model.getEntity();
            Binding b = (Binding) definitions.resolveBindings().get(bName);
            if (b != null) {
                List<TWSDLExtension> bindextends = (List<TWSDLExtension>) b.extensions();
                for (TWSDLExtension wsdlext : bindextends) {
                    value = resolveBindingValue(wsdlext);
                    if (value != null)
                        break;
                }
            }
        }
    }
    return value;
}
Also used : Binding(com.sun.tools.ws.wsdl.document.Binding) SOAPBinding(com.sun.tools.ws.wsdl.document.soap.SOAPBinding) SOAP12Binding(com.sun.tools.ws.wsdl.document.soap.SOAP12Binding) TWSDLExtension(com.sun.tools.ws.api.wsdl.TWSDLExtension) Definitions(com.sun.tools.ws.wsdl.document.Definitions) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with TWSDLExtension

use of com.sun.tools.ws.api.wsdl.TWSDLExtension 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)2 Binding (com.sun.tools.ws.wsdl.document.Binding)1 Definitions (com.sun.tools.ws.wsdl.document.Definitions)1 MIMEContent (com.sun.tools.ws.wsdl.document.mime.MIMEContent)1 MIMEPart (com.sun.tools.ws.wsdl.document.mime.MIMEPart)1 SOAP12Binding (com.sun.tools.ws.wsdl.document.soap.SOAP12Binding)1 SOAPBinding (com.sun.tools.ws.wsdl.document.soap.SOAPBinding)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1