Search in sources :

Example 1 with TWSDLParserContextImpl

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

the class WSDLParser method buildWSDLDocument.

private WSDLDocument buildWSDLDocument() {
    /*
          Currently we are working off first WSDL document
          TODO: add support of creating WSDLDocument from fromjava.collection of WSDL documents
         */
    String location = forest.getRootWSDL();
    // It means that WSDL is not found, an error might have been reported, lets try to recover
    if (location == null)
        return null;
    Document root = forest.get(location);
    if (root == null)
        return null;
    WSDLDocument document = new WSDLDocument(forest, errReceiver);
    document.setSystemId(location);
    TWSDLParserContextImpl context = new TWSDLParserContextImpl(forest, document, listeners, errReceiver);
    Definitions definitions = parseDefinitions(context, root);
    document.setDefinitions(definitions);
    return document;
}
Also used : WSDLDocument(com.sun.tools.ws.wsdl.document.WSDLDocument) TWSDLParserContextImpl(com.sun.tools.ws.wsdl.framework.TWSDLParserContextImpl) Definitions(com.sun.tools.ws.wsdl.document.Definitions) Document(org.w3c.dom.Document) WSDLDocument(com.sun.tools.ws.wsdl.document.WSDLDocument)

Example 2 with TWSDLParserContextImpl

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

the class SOAPExtensionHandler method handleInputOutputExtension.

protected boolean handleInputOutputExtension(TWSDLParserContext contextif, TWSDLExtensible parent, Element e) {
    TWSDLParserContextImpl context = (TWSDLParserContextImpl) contextif;
    if (XmlUtil.matchesTagNS(e, getBodyQName())) {
        context.push();
        context.registerNamespaces(e);
        SOAPBody body = new SOAPBody(context.getLocation(e));
        String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
        if (use != null) {
            if (use.equals(Constants.ATTRVALUE_LITERAL)) {
                body.setUse(SOAPUse.LITERAL);
            } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
                body.setUse(SOAPUse.ENCODED);
            } else {
                Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use);
            }
        }
        String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
        if (namespace != null) {
            body.setNamespace(namespace);
        }
        String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
        if (encodingStyle != null) {
            body.setEncodingStyle(encodingStyle);
        }
        String parts = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PARTS);
        if (parts != null) {
            body.setParts(parts);
        }
        parent.addExtension(body);
        context.pop();
        // context.fireDoneParsingEntity(getBodyQName(), body);
        return true;
    } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) {
        return handleHeaderElement(parent, e, context);
    } else {
        Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
        // keep compiler happy
        return false;
    }
}
Also used : TWSDLParserContextImpl(com.sun.tools.ws.wsdl.framework.TWSDLParserContextImpl)

Aggregations

TWSDLParserContextImpl (com.sun.tools.ws.wsdl.framework.TWSDLParserContextImpl)2 Definitions (com.sun.tools.ws.wsdl.document.Definitions)1 WSDLDocument (com.sun.tools.ws.wsdl.document.WSDLDocument)1 Document (org.w3c.dom.Document)1