Package javax.wsdl.extensions

Examples of javax.wsdl.extensions.UnknownExtensibilityElement


    private boolean isExistsPolicy(ServiceInfo service, String uri) {
        Object exts[] = service.getDescription().getExtensors().get();
        exts = exts == null ? new Object[0] : exts;
        for (Object o : exts) {
            if (o instanceof UnknownExtensibilityElement) {
                UnknownExtensibilityElement uee = (UnknownExtensibilityElement)o;
                String uri2 = getPolicyId(uee.getElement());
                if (uri.equals(uri2)) {
                    return true;
                }
            }
        }
View Full Code Here


        Document doc = DOMUtils.createDocument();
        Element el = doc.createElementNS(Constants.URI_POLICY_NS, Constants.ELEM_POLICY_REF);
        el.setPrefix(Constants.ATTR_WSP);
        el.setAttribute(Constants.ATTR_URI, "#" + policyId);

        UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
        uee.setElementType(new QName(Constants.URI_POLICY_NS, Constants.ELEM_POLICY_REF));
        uee.setElement(el);
        uee.setRequired(true);

        ext.addExtensor(uee);
    }
View Full Code Here

            Element policyEl = writer.getDocument().getDocumentElement();

            // Remove xmlns:xmlns attribute which Xerces chokes on
            policyEl.removeAttribute("xmlns:xmlns");

            UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
            uee.setElementType(new QName(Constants.URI_POLICY_NS, Constants.ELEM_POLICY));
            uee.setElement(policyEl);

            ei.getService().addExtensor(uee);
        } catch (XMLStreamException ex) {
            throw new RuntimeException("Could not serialize policy", ex);
        } catch (ParserConfigurationException e) {
View Full Code Here

                           ServiceInfo service,
                           Policy p,
                           Class<?> cls,
                           String defName) {
        Element el = addPolicy(service, p, cls, defName);
        UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
        uee.setElement(el);
        uee.setRequired(true);
        uee.setElementType(DOMUtils.getElementQName(el));
        place.addExtensor(uee);
    }
View Full Code Here

                    Document doc = StaxUtils.read(StaxUtils.createXMLStreamReader(src));
                    if (service.getDescription() == null && cls != null) {
                        service.setDescription(new DescriptionInfo());
                        service.getDescription().setBaseURI(cls.getResource("/").toString());
                    }
                    UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
                    uee.setElement(doc.getDocumentElement());
                    uee.setRequired(true);
                    uee.setElementType(DOMUtils.getElementQName(doc.getDocumentElement()));
                    service.getDescription().addExtensor(uee);
                    uri = doc.getDocumentElement().getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
                                                                  PolicyConstants.WSU_ID_ATTR_NAME);
                    if (StringUtils.isEmpty(uri)) {
                        uri = defName;
View Full Code Here

                el.setRequired(addressing.required());
                bindingInfo.addExtensor(el);
               
                StringBuilder polRefId = new StringBuilder(bindingInfo.getName().getLocalPart());
                polRefId.append("_WSAM_Addressing_Policy");
                UnknownExtensibilityElement uel = new UnknownExtensibilityElement();
               
                W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
                writer.writeStartElement("wsp", "PolicyReference", PolicyConstants.NAMESPACE_WS_POLICY);
                writer.writeAttribute("URI", "#" + polRefId.toString());
                writer.writeEndElement();
                Element pr = writer.getDocument().getDocumentElement();
                uel.setElement(pr);
                uel.setElementType(DOMUtils.getElementQName(pr));
                bindingInfo.addExtensor(uel);
               
                writer = new W3CDOMStreamWriter();
                writer.writeStartElement("wsp", "Policy", PolicyConstants.NAMESPACE_WS_POLICY);
                writer.writeAttribute("wsu", PolicyConstants.WSU_NAMESPACE_URI,
                                      PolicyConstants.WSU_ID_ATTR_NAME, polRefId.toString());
                writer.writeStartElement("wsam", "Addressing", JAXWSAConstants.NS_WSAM);
                if (!addressing.required()) {
                    writer.writeAttribute("wsp", PolicyConstants.NAMESPACE_WS_POLICY,
                                          "Optional", "true");
                }
                writer.writeStartElement("wsp", "Policy", PolicyConstants.NAMESPACE_WS_POLICY);
               
                String s = getAddressingRequirement(addressing);
                if (s != null) {
                    writer.writeEmptyElement("wsam", s, JAXWSAConstants.NS_WSAM);
                }
               
                writer.writeEndElement();
                writer.writeEndElement();
                writer.writeEndElement();
               
                pr = writer.getDocument().getDocumentElement();
               
                uel = new UnknownExtensibilityElement();
                uel.setElement(pr);
                uel.setElementType(DOMUtils.getElementQName(pr));
                if (bindingInfo.getService().getDescription() == null) {
                    DescriptionInfo description = new DescriptionInfo();
                    description.setName(bindingInfo.getService().getName());
                    bindingInfo.getService().setDescription(description);
                    bindingInfo.setDescription(description);
View Full Code Here

        Types types = def.getTypes();
        if (types != null) {
            Iterator extEleIt = types.getExtensibilityElements().iterator();

            while (extEleIt.hasNext()) {
                UnknownExtensibilityElement typesElement =
                    (UnknownExtensibilityElement) extEleIt.next();

                Element schemaEl = typesElement.getElement();
                if (QNameUtils.matches(schema2001, schemaEl)
                    || QNameUtils.matches(schema2000, schemaEl)
                    || QNameUtils.matches(schema1999, schemaEl)) {
                    Schema sc = new Schema(schemaEl)
                    schemas.add(sc);
View Full Code Here

        Types types = def.getTypes();
        if (types != null) {
            Iterator extEleIt = types.getExtensibilityElements().iterator();
            while (extEleIt.hasNext()) {
                // the unknown extensibility element are wrappers for DOM elements
                UnknownExtensibilityElement typesElement =
                    (UnknownExtensibilityElement) extEleIt.next();
                toList.add(typesElement);
            }
        }
View Full Code Here

            Schema2Java s2j2001 = new Schema2Java(schemaURI2001);
            QName qElemSchema2001 = new QName(schemaURI2001, "schema");

            Iterator typesElIterator = typesElList.iterator();
            while (typesElIterator.hasNext()) {
                UnknownExtensibilityElement unknExEl =
                    (UnknownExtensibilityElement) typesElIterator.next();
                Element schemaEl = unknExEl.getElement();
                try {
                    if (QNameUtils.matches(qElemSchema1999, schemaEl)
                        || QNameUtils.matches(qElemSchema2000, schemaEl)
                        || QNameUtils.matches(qElemSchema2001, schemaEl)) {
                        //Hashtable typeReg = new Hashtable();
View Full Code Here

            Schema2Java s2j2001 = new Schema2Java(schemaURI2001);
            QName qElemSchema2001 = new QName(schemaURI2001, "schema");

            Iterator typesElIterator = typesElList.iterator();
            while (typesElIterator.hasNext()) {
                UnknownExtensibilityElement unknExEl =
                    (UnknownExtensibilityElement) typesElIterator.next();
                Element schemaEl = unknExEl.getElement();
                try {
                    if (QNameUtils.matches(qElemSchema1999, schemaEl)
                        || QNameUtils.matches(qElemSchema2000, schemaEl)
                        || QNameUtils.matches(qElemSchema2001, schemaEl)) {
                        //Hashtable typeReg = new Hashtable();
View Full Code Here

TOP

Related Classes of javax.wsdl.extensions.UnknownExtensibilityElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.