Search in sources :

Example 16 with JAXWSBinding

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

the class JAXWSBindingExtensionHandler method handleServiceExtension.

@Override
public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
    if (XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)) {
        context.push();
        context.registerNamespaces(e);
        JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e));
        for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext(); ) {
            Element e2 = Util.nextElement(iter);
            if (e2 == null) {
                break;
            }
            if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)) {
                parseClass(context, jaxwsBinding, e2);
                if ((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)) {
                    ((Service) parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc()));
                }
            } else {
                Util.fail("parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI());
                return false;
            }
        }
        parent.addExtension(jaxwsBinding);
        context.pop();
        // jaxwsBinding);
        return true;
    } else {
        Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
        return false;
    }
}
Also used : Element(org.w3c.dom.Element) Iterator(java.util.Iterator) JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Example 17 with JAXWSBinding

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

the class JAXWSBindingExtensionHandler method parseGlobalJAXWSBindings.

/**
 */
private boolean parseGlobalJAXWSBindings(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
    context.push();
    context.registerNamespaces(e);
    JAXWSBinding jaxwsBinding = getJAXWSExtension(parent);
    if (jaxwsBinding == null) {
        jaxwsBinding = new JAXWSBinding(context.getLocation(e));
    }
    String attr = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.WSDL_LOCATION_ATTR);
    if (attr != null) {
        jaxwsBinding.setWsdlLocation(attr);
    }
    attr = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.NODE_ATTR);
    if (attr != null) {
        jaxwsBinding.setNode(attr);
    }
    attr = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.VERSION_ATTR);
    if (attr != null) {
        jaxwsBinding.setVersion(attr);
    }
    for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext(); ) {
        Element e2 = Util.nextElement(iter);
        if (e2 == null) {
            break;
        }
        if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PACKAGE)) {
            parsePackage(context, jaxwsBinding, e2);
            if ((jaxwsBinding.getJaxwsPackage() != null) && (jaxwsBinding.getJaxwsPackage().getJavaDoc() != null)) {
                ((Definitions) parent).setDocumentation(new Documentation(jaxwsBinding.getJaxwsPackage().getJavaDoc()));
            }
        } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)) {
            parseWrapperStyle(context, jaxwsBinding, e2);
        } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)) {
            parseAsynMapping(context, jaxwsBinding, e2);
        } else // }
        if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)) {
            parseMimeContent(context, jaxwsBinding, e2);
        } else {
            Util.fail("parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI());
            return false;
        }
    }
    parent.addExtension(jaxwsBinding);
    context.pop();
    // jaxwsBinding);
    return true;
}
Also used : Element(org.w3c.dom.Element) Iterator(java.util.Iterator) JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Example 18 with JAXWSBinding

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

the class WSDLModeler method isAsync.

protected boolean isAsync(com.sun.tools.ws.wsdl.document.PortType portType, com.sun.tools.ws.wsdl.document.Operation wsdlOperation) {
    // First look into wsdl:operation
    JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(wsdlOperation, JAXWSBinding.class);
    Boolean isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null;
    if (isAsync != null) {
        return isAsync;
    }
    // then into wsdl:portType
    jaxwsCustomization = (JAXWSBinding) getExtensionOfType(portType, JAXWSBinding.class);
    isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null;
    if (isAsync != null) {
        return isAsync;
    }
    // then wsdl:definitions
    jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
    isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null;
    if (isAsync != null) {
        return isAsync;
    }
    return false;
}
Also used : JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Example 19 with JAXWSBinding

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

the class WSDLModeler method getJavaPackage.

protected String getJavaPackage() {
    String jaxwsPackage = null;
    JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
    if (jaxwsCustomization != null && jaxwsCustomization.getJaxwsPackage() != null) {
        jaxwsPackage = jaxwsCustomization.getJaxwsPackage().getName();
    }
    if (jaxwsPackage != null) {
        return jaxwsPackage;
    }
    String wsdlUri = document.getDefinitions().getTargetNamespaceURI();
    return XJC.getDefaultPackageName(wsdlUri);
}
Also used : JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Example 20 with JAXWSBinding

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

the class WSDLModeler method getJavaNameOfSEI.

protected String getJavaNameOfSEI(Port port) {
    QName portTypeName = (QName) port.getProperty(ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME);
    PortType pt = (PortType) document.find(Kinds.PORT_TYPE, portTypeName);
    // populate the portType map here. We should get rid of all these properties
    // lets not do it as it may break NB
    // TODO: clean all these stuff part of NB RFE
    port.portTypes.put(portTypeName, pt);
    JAXWSBinding jaxwsCust = (JAXWSBinding) getExtensionOfType(pt, JAXWSBinding.class);
    if (jaxwsCust != null && jaxwsCust.getClassName() != null) {
        CustomName name = jaxwsCust.getClassName();
        if (name != null && !name.getName().equals("")) {
            return makePackageQualified(name.getName());
        }
    }
    String interfaceName;
    if (portTypeName != null) {
        // got portType information from WSDL, use it to name the interface
        interfaceName = makePackageQualified(BindingHelper.mangleNameToClassName(portTypeName.getLocalPart()));
    } else {
        // somehow we only got the port name, so we use that
        interfaceName = makePackageQualified(BindingHelper.mangleNameToClassName(port.getName().getLocalPart()));
    }
    return interfaceName;
}
Also used : CustomName(com.sun.tools.ws.wsdl.document.jaxws.CustomName) QName(javax.xml.namespace.QName) JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Aggregations

JAXWSBinding (com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)21 Iterator (java.util.Iterator)8 Element (org.w3c.dom.Element)8 CustomName (com.sun.tools.ws.wsdl.document.jaxws.CustomName)3 QName (javax.xml.namespace.QName)2 com.sun.tools.ws.wsdl.document (com.sun.tools.ws.wsdl.document)1