Examples of OMFactory


Examples of org.apache.axiom.om.OMFactory

    public TestAddAttributeWithoutExistingNamespaceDeclaration(OMMetaFactory metaFactory) {
        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement element = factory.createOMElement(new QName("test"));
        OMNamespace ns = factory.createOMNamespace("urn:ns", "p");
        OMAttribute att = factory.createOMAttribute("test", ns, "test");
        element.addAttribute(att);
        assertEquals(ns, element.findNamespace(ns.getNamespaceURI(), ns.getPrefix()));
        Iterator it = element.getAllDeclaredNamespaces();
        assertTrue(it.hasNext());
        assertEquals(ns, it.next());
View Full Code Here

Examples of org.apache.axis2.om.OMFactory

        servicClient.sendRobust(getPayload());
    }

    private static OMElement getPayload() {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace(
                "http://example1.org/example1", "example1");
        OMElement method = fac.createOMElement("echo", omNs);
        OMElement value = fac.createOMElement("Text", omNs);
        value.addChild(fac.createText(value, "Axis2 Echo String "));
        method.addChild(value);

        return method;
    }
View Full Code Here

Examples of org.apache.ws.commons.om.OMFactory

    }

    private OMElement createEnvelope(String fileName) throws Exception {

        DataHandler expectedDH;
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace("http://example.org/mtom/data", "x");
        OMElement data = fac.createOMElement("Data", omNs);

        File dataFile = new File(fileName);
        FileDataSource dataSource = new FileDataSource(dataFile);
        expectedDH = new DataHandler(dataSource);
        OMText textData = fac.createText(expectedDH, true);
        data.addChild(textData);
        return data;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.