Package org.apache.axiom.om.impl.dom.factory

Examples of org.apache.axiom.om.impl.dom.factory.OMDOMFactory


     * @throws Exception
     */
    public void testQNames() throws Exception {
        String ATTR = "attr";
        String NSURI = "http://ns1";
        OMFactory fac = new OMDOMFactory();
        OMNamespace ns = new NamespaceImpl(NSURI);
        OMAttribute attr = fac.createOMAttribute(ATTR, ns, "value");
        QName qname = attr.getQName();
        assertEquals("Wrong namespace", NSURI, qname.getNamespaceURI());
        assertEquals("Wrong localPart", ATTR, qname.getLocalPart());
        assertEquals("Wrong prefix", "", qname.getPrefix());
    }
View Full Code Here


                            new QName(WSConstants.SIG_NS, Constants._TAG_EXPONENT)).getText()
                            .trim();

                    // Now process the incoming element to check for ds:RSAKeyValue

                    OMElement receivedKeyInfoElem = (OMElement) new OMDOMFactory().getDocument()
                            .importNode(keyInfo, true);

                    OMElement receivedKeyValueElem = receivedKeyInfoElem.getFirstElement();
                    if (receivedKeyValueElem != null
                            && receivedKeyValueElem.getQName().equals(
View Full Code Here

        BigInteger exp = null;

        val = (KeyValue) keyValueList.get(0);
        rsaKey = val.getRSAKeyValue();
        elem = rsaKey.getDOM();
        omElem = (OMElement) new OMDOMFactory().getDocument().importNode(elem, true);
        modElem = (Element) omElem.getFirstChildWithName(Modulus.DEFAULT_ELEMENT_NAME);
        expElem = (Element) omElem.getFirstChildWithName(Exponent.DEFAULT_ELEMENT_NAME);
        mod = Base64.decodeBigIntegerFromElement(modElem);

        if (expElem != null) {
View Full Code Here

        if (validateTargetElem != null) {
       
            OMElement strElem = validateTargetElem.getFirstChildWithName(new QName(WSConstants.WSSE_NS,
                                                   "SecurityTokenReference"));
           
            Element elem = (Element)(new StAXOMBuilder(new OMDOMFactory(),
                    strElem.getXMLStreamReader()).getDocumentElement());
           
            try {
                SecurityTokenReference str = new SecurityTokenReference((Element)elem);
                if (str.containsReference()) {
View Full Code Here

        if (renewTargetElem != null) {
       
            OMElement strElem = renewTargetElem.getFirstChildWithName(new QName(WSConstants.WSSE_NS,
                                                   "SecurityTokenReference"));
           
            Element elem = (Element)(new StAXOMBuilder(new OMDOMFactory(),
                    strElem.getXMLStreamReader()).getDocumentElement());
           
            try {
                SecurityTokenReference str = new SecurityTokenReference((Element)elem);
                if (str.containsReference()) {
View Full Code Here

        ResponseMechanism[] responseMechanisms = responseMechanismList != null ? (ResponseMechanism[]) responseMechanismList
                .toArray(new ResponseMechanism[responseMechanismList.size()])
                : null;
        // Get a sepearte Document for response
        OMFactory fac = DOOMAbstractFactory.getOMFactory();
        OMDOMFactory omDomFac = (OMDOMFactory) fac;
        Document doc = omDomFac.getDocument();

        XKMSRequestData requestData = new XKMSRequestData();
        requestData.setMessageContext(inMsgCtx);
        requestData.setRequest((RequestAbstractType) xkmsElementObj);
        requestData.setDocument(doc);
View Full Code Here

     * @return The serialized node as a java.lang.String instance.
     */
    public static String nodeToString(Node node) {

        if (importerDoc == null) {
            OMDOMFactory fac = new OMDOMFactory();
            importerDoc = (Document) fac.createOMDocument();
        }
        // Import the node as an AXIOM-DOOM node and use toSting()
        Node axiomNode = importerDoc.importNode(node, true);
        return axiomNode.toString();
    }
View Full Code Here

     * @return the new <code>SOAPElement</code> object that was created
     * @throws javax.xml.soap.SOAPException if there is an error in creating the <code>SOAPElement</code>
     *                                      object
     */
    public SOAPElement createElement(String localName) throws SOAPException {
        OMDOMFactory omdomFactory = null;
        if (soapVersion.equals(SOAPConstants.SOAP_1_2_PROTOCOL)) {
            omdomFactory = (OMDOMFactory)DOOMAbstractFactory.getSOAP12Factory();
        } else {
            omdomFactory = (OMDOMFactory)DOOMAbstractFactory.getSOAP11Factory();
        }
        OMElement omElement = omdomFactory.createOMElement(new QName(localName));
        return new SOAPElementImpl((ElementImpl)omElement);
    }
View Full Code Here

                , uri, prefix);
        return new SOAPElementImpl((ElementImpl)omElement);
    }

    public SOAPElement createElement(Element element) throws SOAPException {
        OMDOMFactory omdomFactory = null;
        if (soapVersion.equals(SOAPConstants.SOAP_1_2_PROTOCOL)) {
            omdomFactory = (OMDOMFactory)DOOMAbstractFactory.getSOAP12Factory();
        } else {
            omdomFactory = (OMDOMFactory)DOOMAbstractFactory.getSOAP11Factory();
        }
        String prefix = element.getPrefix();
        if (prefix == null) {
            prefix = "";
        }
        OMNamespace ns = omdomFactory.createOMNamespace(element.getNamespaceURI(), prefix);
        OMElement omElement = omdomFactory.createOMElement(element.getLocalName(), ns);
        return new SOAPElementImpl((ElementImpl)omElement);
    }
View Full Code Here

    public ElementImplTest() {
        super(new OMDOMMetaFactory());
    }

    public void testSerialize() throws Exception {
        OMDOMFactory factory = new OMDOMFactory();
        String localName = "TestLocalName";
        String namespace = "http://ws.apache.org/axis2/ns";
        String prefix = "axis2";
        String tempText = "The quick brown fox jumps over the lazy dog";
        String textToAppend = " followed by another";

        OMElement elem = factory.createOMElement(localName, namespace, prefix);
        OMText textNode = factory.createOMText(elem, tempText);

        ((Text) textNode).appendData(textToAppend);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        elem.serialize(baos);
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.impl.dom.factory.OMDOMFactory

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.