Package org.apache.ws.commons.om

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


                                                 OMXMLParserWrapper builder) {
        return new SOAP11FaultDetailImpl(parent, builder, this);
    }

    public SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException {
        OMNamespace ns =
                new NamespaceImpl(
                        SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
                        SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX, this);
        SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(ns, this);
        createSOAPHeader(env);
View Full Code Here


    /*
     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception {
       OMNamespace testingNamespace = factory.createOMNamespace(
                        "http://testing.ws.org", "ws");
        firstElement = factory.createOMElement("FirstElement", testingNamespace);
        secondElement = factory.createOMElement("SecondElement", factory.createOMNamespace(
                                "http://moretesting.ws.org", "ws"), firstElement);
    }
View Full Code Here

        assertTrue("Namespace having same information, declared in the same context, should share" +
                " the same namespace object",firstElement.getNamespace() != secondElement.getNamespace());
        assertEquals("OMElement children addition has not worked properly", secondElement, firstElement.getFirstElement());

        OMNamespace testNamespace2 = factory.createOMNamespace("ftp://anotherTest.ws.org", "ws");
        firstElement.declareNamespace(testNamespace2);

        OMNamespace inheritedSecondNamespace = secondElement.findNamespace(testNamespace2.getName(),
                testNamespace2.getPrefix());
        assertNotNull("Children should inherit namespaces declared in parent", inheritedSecondNamespace);
        assertEquals("inherited namespace uri should be equal", inheritedSecondNamespace.getName(), testNamespace2.getName());
        assertEquals("inherited namespace prefix should be equal", inheritedSecondNamespace.getPrefix(), testNamespace2.getPrefix());


    }
View Full Code Here


    }

    public void testChildDetachment() {
        OMNamespace testNamespace2 = factory.createOMNamespace("ftp://anotherTest.ws.org", "ws");
       
        secondElement.detach();
        assertTrue("OMElement children detachment has not worked properly", !secondElement.equals(firstElement.getFirstElement()));
        assertNull("First Element should not contain elements after detaching. ", firstElement.getFirstElement());
        assertNull("First Element should not contain elements after detaching. ", firstElement.getFirstOMChild());
        assertNull(secondElement.findNamespace(testNamespace2.getName(), testNamespace2.getPrefix()));

        firstElement.addChild(secondElement);
        firstElement.setText("Some Sample Text");

        assertTrue("First added child must be the first child", secondElement.equals(firstElement.getFirstOMChild()));
View Full Code Here

  public void runTest(String value, String expected) throws XMLStreamException, FactoryConfigurationError, IOException {
   
    SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
    SOAPEnvelope envelope = factory.getDefaultEnvelope();
    String ns = "http://testuri.org";
    OMNamespace namespace = factory.createOMNamespace(ns,"tst");
   
    String ln = "Child";
   
    OMElement bodyChild = factory.createOMElement(ln,namespace);
    bodyChild.addChild(factory.createText(value));
View Full Code Here

        if (ns == null || ns.getName() == null || "".equals(ns.getName())) {
            throw new OMException(
                    "All the SOAP Header blocks should be namespace qualified");
        }

        OMNamespace namespace = findNamespace(ns.getName(), ns.getPrefix());
        if (namespace != null) {
            ns = namespace;
        }

        SOAPHeaderBlock soapHeaderBlock = null;
View Full Code Here

     * method getMessageContext
     *
     * @return msgContext
     */
    public static MessageContext getMessageContext() throws AxisFault {
        OMNamespace namespace, nulNS;
        OMElement operation, value1, value2;
        OMElement subValue1, subValue2, subValue3, subValue4, subValue5;

        SOAPFactory omFactory = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope reqEnv = omFactory.getDefaultEnvelope();
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.om.OMNamespace

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.