Package javax.wsdl.extensions

Examples of javax.wsdl.extensions.UnknownExtensibilityElement


    private static UnknownExtensibilityElement createWSPolicyRef(DOMImplementation dImpl, String id) {
        Document doc = dImpl.createDocument(WSP_NAMESPACE, "wsp:PolicyReference", null);
        Element policyRef = doc.getDocumentElement();
        policyRef.setAttribute("URI", "#" + id);
        UnknownExtensibilityElement elem = new UnknownExtensibilityElement();
        elem.setElement(policyRef);
        elem.setElementType(new QName(WSP_NAMESPACE, "PolicyReference"));
        return elem;
    }
View Full Code Here


        control.replay();
        assertNull(resolver.resolveReference("A"));
        control.verify();
       
        control.reset();
        UnknownExtensibilityElement extension = control.createMock(UnknownExtensibilityElement.class);
        extensions.add(extension);
        EasyMock.expect(di.getExtensors(UnknownExtensibilityElement.class)).andReturn(extensions);
        Element e = control.createMock(Element.class);
        EasyMock.expect(extension.getElement()).andReturn(e).times(2);
        QName qn = new QName(Constants.URI_POLICY_NS,
                             Constants.ELEM_POLICY);
        EasyMock.expect(extension.getElementType()).andReturn(qn).anyTimes();
        EasyMock.expect(e.getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
                                         PolicyConstants.WSU_ID_ATTR_NAME))
                        .andReturn("A");
        Policy p = control.createMock(Policy.class);
        EasyMock.expect(builder.getPolicy(e)).andReturn(p);       
View Full Code Here

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

                    ns = doc.getDocumentElement().getNamespaceURI();
                    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 = uee.getElement()
                                    .getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
                                                    PolicyConstants.WSU_ID_ATTR_NAME);
                            if (uri.equals(uri2)) {
                                return null;
                            }
                        }
                    }
                    UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
                    uee.setElement(doc.getDocumentElement());
                    uee.setRequired(true);
                    uee.setElementType(DOMUtils.getElementQName(doc.getDocumentElement()));
                    service.getDescription().addExtensor(uee);
                   
                    uri = "#" + uri;
                } catch (XMLStreamException e) {
                    //ignore
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", Constants.URI_POLICY_NS);
                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", Constants.URI_POLICY_NS);
                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", Constants.URI_POLICY_NS,
                                          "Optional", "true");
                }
                writer.writeStartElement("wsp", "Policy", Constants.URI_POLICY_NS);
               
                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

        Document doc = DOMUtils.createDocument();
        Element el = doc.createElementNS(Constants.URI_POLICY_13_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_13_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_13_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

        for ( int i = 0; i < extElems.size(); i++ )
        {
            ExtensibilityElement extElem = (ExtensibilityElement) extElems.get( i );
            if ( extElem instanceof UnknownExtensibilityElement )
            {
                UnknownExtensibilityElement unknownExtElem = (UnknownExtensibilityElement) extElem;
                Element elem = unknownExtElem.getElement();
                if ( elem.getNamespaceURI().equals( XmlConstants.NSURI_SCHEMA_XSD )
                        && elem.getLocalName().equals( XmlConstants.XSD_SCHEMA.getLocalPart() ) )
                {
                    schemaElem = elem;
                    break;
View Full Code Here

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

            }

            // if not already added to service add it, otherwise ignore
            // and just create the policy reference.
            if (!isExistsPolicy(service.getDescription().getExtensors().get(), uri)) {
                UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
                uee.setElement(element);
                uee.setRequired(true);
                uee.setElementType(DOMUtils.getElementQName(element));
                service.getDescription().addExtensor(uee);
            }
           
            uri = "#" + uri;
        }
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.