com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds Java Examples

The following examples show how to use com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WSDLModeler.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param part
 * @return Returns a JAXBType object
 */
private JAXBType getJAXBType(MessagePart part) {
    JAXBType type;
    QName name = part.getDescriptor();
    if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) {
        type = getJAXBModelBuilder().getJAXBType(name);
        if(type == null){
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
    } else {
        S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
        TypeAndAnnotation typeAnno = jaxbModel.getJavaType(name);
        if (typeAnno == null) {
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
        type = new JAXBType(new QName("", part.getName()), javaType);
    }
    return type;
}
 
Example #2
Source File: WSDLModelerBase.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * For Document/Lit the wsdl:part should only have element attribute and
 * for RPC/Lit or RPC/Encoded the wsdl:part should only have type attribute
 * inside wsdl:message.
 */
protected boolean isStyleAndPartMatch(
    SOAPOperation soapOperation,
    MessagePart part) {

    // style attribute on soap:operation takes precedence over the
    // style attribute on soap:binding

    if ((soapOperation != null) && (soapOperation.getStyle() != null)) {
        if ((soapOperation.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (soapOperation.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    } else {
        if ((info.soapBinding.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (info.soapBinding.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    }

    return true;
}
 
Example #3
Source File: WSDLModeler.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param part
 * @return Returns a JAXBType object
 */
private JAXBType getJAXBType(MessagePart part) {
    JAXBType type;
    QName name = part.getDescriptor();
    if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) {
        type = getJAXBModelBuilder().getJAXBType(name);
        if(type == null){
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
    } else {
        S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
        TypeAndAnnotation typeAnno = jaxbModel.getJavaType(name);
        if (typeAnno == null) {
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
        type = new JAXBType(new QName("", part.getName()), javaType);
    }
    return type;
}
 
Example #4
Source File: SOAPEntityReferenceValidator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public boolean isValid(Kind kind, QName name) {

        // just let all "xml:" QNames through
        if (name.getNamespaceURI().equals(Constants.NS_XML))
            return true;

        if (kind == SchemaKinds.XSD_TYPE) {
            return _validTypes.contains(name);
        } else if (kind == SchemaKinds.XSD_ELEMENT) {
            return _validElements.contains(name);
        } else if (kind == SchemaKinds.XSD_ATTRIBUTE) {
            return _validAttributes.contains(name);
        } else {
            // no luck
            return false;
        }
    }
 
Example #5
Source File: SOAPEntityReferenceValidator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public boolean isValid(Kind kind, QName name) {

        // just let all "xml:" QNames through
        if (name.getNamespaceURI().equals(Constants.NS_XML))
            return true;

        if (kind == SchemaKinds.XSD_TYPE) {
            return _validTypes.contains(name);
        } else if (kind == SchemaKinds.XSD_ELEMENT) {
            return _validElements.contains(name);
        } else if (kind == SchemaKinds.XSD_ATTRIBUTE) {
            return _validAttributes.contains(name);
        } else {
            // no luck
            return false;
        }
    }
 
Example #6
Source File: WSDLModelerBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * For Document/Lit the wsdl:part should only have element attribute and
 * for RPC/Lit or RPC/Encoded the wsdl:part should only have type attribute
 * inside wsdl:message.
 */
protected boolean isStyleAndPartMatch(
    SOAPOperation soapOperation,
    MessagePart part) {

    // style attribute on soap:operation takes precedence over the
    // style attribute on soap:binding

    if ((soapOperation != null) && (soapOperation.getStyle() != null)) {
        if ((soapOperation.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (soapOperation.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    } else {
        if ((info.soapBinding.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (info.soapBinding.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    }

    return true;
}
 
Example #7
Source File: WSDLModeler.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param part
 * @return Returns a JAXBType object
 */
private JAXBType getJAXBType(MessagePart part) {
    JAXBType type;
    QName name = part.getDescriptor();
    if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) {
        type = getJAXBModelBuilder().getJAXBType(name);
        if(type == null){
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
    } else {
        S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
        TypeAndAnnotation typeAnno = jaxbModel.getJavaType(name);
        if (typeAnno == null) {
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
        type = new JAXBType(new QName("", part.getName()), javaType);
    }
    return type;
}
 
Example #8
Source File: WSDLModeler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param part
 * @return Returns a JAXBType object
 */
private JAXBType getJAXBType(MessagePart part) {
    JAXBType type;
    QName name = part.getDescriptor();
    if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) {
        type = getJAXBModelBuilder().getJAXBType(name);
        if(type == null){
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
    } else {
        S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
        TypeAndAnnotation typeAnno = jaxbModel.getJavaType(name);
        if (typeAnno == null) {
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
        type = new JAXBType(new QName("", part.getName()), javaType);
    }
    return type;
}
 
Example #9
Source File: WSDLModelerBase.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * For Document/Lit the wsdl:part should only have element attribute and
 * for RPC/Lit or RPC/Encoded the wsdl:part should only have type attribute
 * inside wsdl:message.
 */
protected boolean isStyleAndPartMatch(
    SOAPOperation soapOperation,
    MessagePart part) {

    // style attribute on soap:operation takes precedence over the
    // style attribute on soap:binding

    if ((soapOperation != null) && (soapOperation.getStyle() != null)) {
        if ((soapOperation.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (soapOperation.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    } else {
        if ((info.soapBinding.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (info.soapBinding.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    }

    return true;
}
 
Example #10
Source File: SOAPEntityReferenceValidator.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public boolean isValid(Kind kind, QName name) {

        // just let all "xml:" QNames through
        if (name.getNamespaceURI().equals(Constants.NS_XML))
            return true;

        if (kind == SchemaKinds.XSD_TYPE) {
            return _validTypes.contains(name);
        } else if (kind == SchemaKinds.XSD_ELEMENT) {
            return _validElements.contains(name);
        } else if (kind == SchemaKinds.XSD_ATTRIBUTE) {
            return _validAttributes.contains(name);
        } else {
            // no luck
            return false;
        }
    }
 
Example #11
Source File: SOAPEntityReferenceValidator.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public boolean isValid(Kind kind, QName name) {

        // just let all "xml:" QNames through
        if (name.getNamespaceURI().equals(Constants.NS_XML))
            return true;

        if (kind == SchemaKinds.XSD_TYPE) {
            return _validTypes.contains(name);
        } else if (kind == SchemaKinds.XSD_ELEMENT) {
            return _validElements.contains(name);
        } else if (kind == SchemaKinds.XSD_ATTRIBUTE) {
            return _validAttributes.contains(name);
        } else {
            // no luck
            return false;
        }
    }
 
Example #12
Source File: WSDLModelerBase.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * For Document/Lit the wsdl:part should only have element attribute and
 * for RPC/Lit or RPC/Encoded the wsdl:part should only have type attribute
 * inside wsdl:message.
 */
protected boolean isStyleAndPartMatch(
    SOAPOperation soapOperation,
    MessagePart part) {

    // style attribute on soap:operation takes precedence over the
    // style attribute on soap:binding

    if ((soapOperation != null) && (soapOperation.getStyle() != null)) {
        if ((soapOperation.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (soapOperation.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    } else {
        if ((info.soapBinding.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (info.soapBinding.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    }

    return true;
}
 
Example #13
Source File: WSDLModeler.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param part
 * @return Returns a JAXBType object
 */
private JAXBType getJAXBType(MessagePart part) {
    JAXBType type;
    QName name = part.getDescriptor();
    if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) {
        type = getJAXBModelBuilder().getJAXBType(name);
        if(type == null){
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
    } else {
        S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
        TypeAndAnnotation typeAnno = jaxbModel.getJavaType(name);
        if (typeAnno == null) {
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
        type = new JAXBType(new QName("", part.getName()), javaType);
    }
    return type;
}
 
Example #14
Source File: WSDLModelerBase.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * For Document/Lit the wsdl:part should only have element attribute and
 * for RPC/Lit or RPC/Encoded the wsdl:part should only have type attribute
 * inside wsdl:message.
 */
protected boolean isStyleAndPartMatch(
    SOAPOperation soapOperation,
    MessagePart part) {

    // style attribute on soap:operation takes precedence over the
    // style attribute on soap:binding

    if ((soapOperation != null) && (soapOperation.getStyle() != null)) {
        if ((soapOperation.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (soapOperation.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    } else {
        if ((info.soapBinding.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (info.soapBinding.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    }

    return true;
}
 
Example #15
Source File: WSDLModeler.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param part
 * @return Returns a JAXBType object
 */
private JAXBType getJAXBType(MessagePart part) {
    JAXBType type;
    QName name = part.getDescriptor();
    if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) {
        type = getJAXBModelBuilder().getJAXBType(name);
        if(type == null){
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
    } else {
        S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
        TypeAndAnnotation typeAnno = jaxbModel.getJavaType(name);
        if (typeAnno == null) {
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
        type = new JAXBType(new QName("", part.getName()), javaType);
    }
    return type;
}
 
Example #16
Source File: SOAPEntityReferenceValidator.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean isValid(Kind kind, QName name) {

        // just let all "xml:" QNames through
        if (name.getNamespaceURI().equals(Constants.NS_XML))
            return true;

        if (kind == SchemaKinds.XSD_TYPE) {
            return _validTypes.contains(name);
        } else if (kind == SchemaKinds.XSD_ELEMENT) {
            return _validElements.contains(name);
        } else if (kind == SchemaKinds.XSD_ATTRIBUTE) {
            return _validAttributes.contains(name);
        } else {
            // no luck
            return false;
        }
    }
 
Example #17
Source File: WSDLModeler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param part
 * @return Returns a JAXBType object
 */
private JAXBType getJAXBType(MessagePart part) {
    JAXBType type;
    QName name = part.getDescriptor();
    if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) {
        type = getJAXBModelBuilder().getJAXBType(name);
        if(type == null){
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
    } else {
        S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
        TypeAndAnnotation typeAnno = jaxbModel.getJavaType(name);
        if (typeAnno == null) {
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
        type = new JAXBType(new QName("", part.getName()), javaType);
    }
    return type;
}
 
Example #18
Source File: WSDLModelerBase.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * For Document/Lit the wsdl:part should only have element attribute and
 * for RPC/Lit or RPC/Encoded the wsdl:part should only have type attribute
 * inside wsdl:message.
 */
protected boolean isStyleAndPartMatch(
    SOAPOperation soapOperation,
    MessagePart part) {

    // style attribute on soap:operation takes precedence over the
    // style attribute on soap:binding

    if ((soapOperation != null) && (soapOperation.getStyle() != null)) {
        if ((soapOperation.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (soapOperation.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    } else {
        if ((info.soapBinding.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (info.soapBinding.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    }

    return true;
}
 
Example #19
Source File: WSDLModelerBase.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * For Document/Lit the wsdl:part should only have element attribute and
 * for RPC/Lit or RPC/Encoded the wsdl:part should only have type attribute
 * inside wsdl:message.
 */
protected boolean isStyleAndPartMatch(
    SOAPOperation soapOperation,
    MessagePart part) {

    // style attribute on soap:operation takes precedence over the
    // style attribute on soap:binding

    if ((soapOperation != null) && (soapOperation.getStyle() != null)) {
        if ((soapOperation.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (soapOperation.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    } else {
        if ((info.soapBinding.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (info.soapBinding.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    }

    return true;
}
 
Example #20
Source File: SOAPEntityReferenceValidator.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean isValid(Kind kind, QName name) {

        // just let all "xml:" QNames through
        if (name.getNamespaceURI().equals(Constants.NS_XML))
            return true;

        if (kind == SchemaKinds.XSD_TYPE) {
            return _validTypes.contains(name);
        } else if (kind == SchemaKinds.XSD_ELEMENT) {
            return _validElements.contains(name);
        } else if (kind == SchemaKinds.XSD_ATTRIBUTE) {
            return _validAttributes.contains(name);
        } else {
            // no luck
            return false;
        }
    }
 
Example #21
Source File: SOAPEntityReferenceValidator.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public boolean isValid(Kind kind, QName name) {

        // just let all "xml:" QNames through
        if (name.getNamespaceURI().equals(Constants.NS_XML))
            return true;

        if (kind == SchemaKinds.XSD_TYPE) {
            return _validTypes.contains(name);
        } else if (kind == SchemaKinds.XSD_ELEMENT) {
            return _validElements.contains(name);
        } else if (kind == SchemaKinds.XSD_ATTRIBUTE) {
            return _validAttributes.contains(name);
        } else {
            // no luck
            return false;
        }
    }
 
Example #22
Source File: WSDLModeler.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param part
 * @return Returns a JAXBType object
 */
private JAXBType getJAXBType(MessagePart part) {
    JAXBType type;
    QName name = part.getDescriptor();
    if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) {
        type = getJAXBModelBuilder().getJAXBType(name);
        if(type == null){
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
    } else {
        S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
        TypeAndAnnotation typeAnno = jaxbModel.getJavaType(name);
        if (typeAnno == null) {
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
        type = new JAXBType(new QName("", part.getName()), javaType);
    }
    return type;
}
 
Example #23
Source File: SOAPEntityReferenceValidator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public boolean isValid(Kind kind, QName name) {

        // just let all "xml:" QNames through
        if (name.getNamespaceURI().equals(Constants.NS_XML))
            return true;

        if (kind == SchemaKinds.XSD_TYPE) {
            return _validTypes.contains(name);
        } else if (kind == SchemaKinds.XSD_ELEMENT) {
            return _validElements.contains(name);
        } else if (kind == SchemaKinds.XSD_ATTRIBUTE) {
            return _validAttributes.contains(name);
        } else {
            // no luck
            return false;
        }
    }
 
Example #24
Source File: WSDLModelerBase.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * For Document/Lit the wsdl:part should only have element attribute and
 * for RPC/Lit or RPC/Encoded the wsdl:part should only have type attribute
 * inside wsdl:message.
 */
protected boolean isStyleAndPartMatch(
    SOAPOperation soapOperation,
    MessagePart part) {

    // style attribute on soap:operation takes precedence over the
    // style attribute on soap:binding

    if ((soapOperation != null) && (soapOperation.getStyle() != null)) {
        if ((soapOperation.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (soapOperation.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    } else {
        if ((info.soapBinding.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (info.soapBinding.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    }

    return true;
}
 
Example #25
Source File: WSDLParser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private MessagePart parseMessagePart(TWSDLParserContextImpl context, Element e) {
    context.push();
    context.registerNamespaces(e);
    MessagePart part = new MessagePart(forest.locatorTable.getStartLocation(e));
    String partName = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
    part.setName(partName);

    String elementAttr =
        XmlUtil.getAttributeOrNull(e, Constants.ATTR_ELEMENT);
    String typeAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_TYPE);

    if (elementAttr != null) {
        if (typeAttr != null) {
            errReceiver.error(context.getLocation(e), WsdlMessages.PARSING_ONLY_ONE_OF_ELEMENT_OR_TYPE_REQUIRED(partName));

        }

        part.setDescriptor(context.translateQualifiedName(context.getLocation(e), elementAttr));
        part.setDescriptorKind(SchemaKinds.XSD_ELEMENT);
    } else if (typeAttr != null) {
        part.setDescriptor(context.translateQualifiedName(context.getLocation(e), typeAttr));
        part.setDescriptorKind(SchemaKinds.XSD_TYPE);
    } else {
        // XXX-NOTE - this is wrong; for extensibility purposes,
        // any attribute can be specified on a <part> element, so
        // we need to put an extensibility hook here
        errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ELEMENT_OR_TYPE_REQUIRED(partName));
    }

    context.pop();
    context.fireDoneParsingEntity(WSDLConstants.QNAME_PART, part);
    return part;
}
 
Example #26
Source File: WSDLModeler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private List<MessagePart> getHeaderParts(BindingOperation bindingOperation, boolean isInput) {
    TWSDLExtensible ext;
    if (isInput) {
        ext = bindingOperation.getInput();
    } else {
        ext = bindingOperation.getOutput();
    }

    List<MessagePart> parts = new ArrayList<MessagePart>();
    Iterator<SOAPHeader> headers = getHeaderExtensions(ext).iterator();
    while (headers.hasNext()) {
        SOAPHeader header = headers.next();
        if (!header.isLiteral()) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_LITERAL(header.getPart(), bindingOperation.getName()));
        }

        if (header.getNamespace() != null) {
            warning(header, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:header", bindingOperation.getName()));
        }
        com.sun.tools.internal.ws.wsdl.document.Message headerMessage = findMessage(header.getMessage(),document);
        if (headerMessage == null) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(header.getMessage(), bindingOperation.getName()));
        }

        MessagePart part = headerMessage.getPart(header.getPart());
        if (part == null) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_FOUND(header.getPart(), bindingOperation.getName()));
        }
        if (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
            if (options.isExtensionMode()) {
                warning(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName()));
            } else {
                error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName()));
            }
        }
        part.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING);
        parts.add(part);
    }
    return parts;
}
 
Example #27
Source File: WSDLModeler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private List<MessagePart> getHeaderParts(BindingOperation bindingOperation, boolean isInput) {
    TWSDLExtensible ext;
    if (isInput) {
        ext = bindingOperation.getInput();
    } else {
        ext = bindingOperation.getOutput();
    }

    List<MessagePart> parts = new ArrayList<MessagePart>();
    Iterator<SOAPHeader> headers = getHeaderExtensions(ext).iterator();
    while (headers.hasNext()) {
        SOAPHeader header = headers.next();
        if (!header.isLiteral()) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_LITERAL(header.getPart(), bindingOperation.getName()));
        }

        if (header.getNamespace() != null) {
            warning(header, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:header", bindingOperation.getName()));
        }
        com.sun.tools.internal.ws.wsdl.document.Message headerMessage = findMessage(header.getMessage(),document);
        if (headerMessage == null) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(header.getMessage(), bindingOperation.getName()));
        }

        MessagePart part = headerMessage.getPart(header.getPart());
        if (part == null) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_FOUND(header.getPart(), bindingOperation.getName()));
        }
        if (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
            if (options.isExtensionMode()) {
                warning(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName()));
            } else {
                error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName()));
            }
        }
        part.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING);
        parts.add(part);
    }
    return parts;
}
 
Example #28
Source File: WSDLModeler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private List<MessagePart> getHeaderParts(BindingOperation bindingOperation, boolean isInput) {
    TWSDLExtensible ext;
    if (isInput) {
        ext = bindingOperation.getInput();
    } else {
        ext = bindingOperation.getOutput();
    }

    List<MessagePart> parts = new ArrayList<MessagePart>();
    Iterator<SOAPHeader> headers = getHeaderExtensions(ext).iterator();
    while (headers.hasNext()) {
        SOAPHeader header = headers.next();
        if (!header.isLiteral()) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_LITERAL(header.getPart(), bindingOperation.getName()));
        }

        if (header.getNamespace() != null) {
            warning(header, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:header", bindingOperation.getName()));
        }
        com.sun.tools.internal.ws.wsdl.document.Message headerMessage = findMessage(header.getMessage(),document);
        if (headerMessage == null) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(header.getMessage(), bindingOperation.getName()));
        }

        MessagePart part = headerMessage.getPart(header.getPart());
        if (part == null) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_FOUND(header.getPart(), bindingOperation.getName()));
        }
        if (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
            if (options.isExtensionMode()) {
                warning(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName()));
            } else {
                error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName()));
            }
        }
        part.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING);
        parts.add(part);
    }
    return parts;
}
 
Example #29
Source File: WSDLParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private MessagePart parseMessagePart(TWSDLParserContextImpl context, Element e) {
    context.push();
    context.registerNamespaces(e);
    MessagePart part = new MessagePart(forest.locatorTable.getStartLocation(e));
    String partName = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
    part.setName(partName);

    String elementAttr =
        XmlUtil.getAttributeOrNull(e, Constants.ATTR_ELEMENT);
    String typeAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_TYPE);

    if (elementAttr != null) {
        if (typeAttr != null) {
            errReceiver.error(context.getLocation(e), WsdlMessages.PARSING_ONLY_ONE_OF_ELEMENT_OR_TYPE_REQUIRED(partName));

        }

        part.setDescriptor(context.translateQualifiedName(context.getLocation(e), elementAttr));
        part.setDescriptorKind(SchemaKinds.XSD_ELEMENT);
    } else if (typeAttr != null) {
        part.setDescriptor(context.translateQualifiedName(context.getLocation(e), typeAttr));
        part.setDescriptorKind(SchemaKinds.XSD_TYPE);
    } else {
        // XXX-NOTE - this is wrong; for extensibility purposes,
        // any attribute can be specified on a <part> element, so
        // we need to put an extensibility hook here
        errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ELEMENT_OR_TYPE_REQUIRED(partName));
    }

    context.pop();
    context.fireDoneParsingEntity(WSDLConstants.QNAME_PART, part);
    return part;
}
 
Example #30
Source File: WSDLParser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private MessagePart parseMessagePart(TWSDLParserContextImpl context, Element e) {
    context.push();
    context.registerNamespaces(e);
    MessagePart part = new MessagePart(forest.locatorTable.getStartLocation(e));
    String partName = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
    part.setName(partName);

    String elementAttr =
        XmlUtil.getAttributeOrNull(e, Constants.ATTR_ELEMENT);
    String typeAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_TYPE);

    if (elementAttr != null) {
        if (typeAttr != null) {
            errReceiver.error(context.getLocation(e), WsdlMessages.PARSING_ONLY_ONE_OF_ELEMENT_OR_TYPE_REQUIRED(partName));

        }

        part.setDescriptor(context.translateQualifiedName(context.getLocation(e), elementAttr));
        part.setDescriptorKind(SchemaKinds.XSD_ELEMENT);
    } else if (typeAttr != null) {
        part.setDescriptor(context.translateQualifiedName(context.getLocation(e), typeAttr));
        part.setDescriptorKind(SchemaKinds.XSD_TYPE);
    } else {
        // XXX-NOTE - this is wrong; for extensibility purposes,
        // any attribute can be specified on a <part> element, so
        // we need to put an extensibility hook here
        errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ELEMENT_OR_TYPE_REQUIRED(partName));
    }

    context.pop();
    context.fireDoneParsingEntity(WSDLConstants.QNAME_PART, part);
    return part;
}