Examples of addHeaderBlock()


Examples of org.apache.axiom.soap.SOAPHeader.addHeaderBlock()

            header = factory.createSOAPHeader(envelope);
        }
        OMElement element = xmlHelper.toOMElement(content);
        // We can't add the element directly to the SOAPHeader. Instead, we need to copy the
        // information over to a SOAPHeaderBlock.
        SOAPHeaderBlock headerBlock = header.addHeaderBlock(element.getLocalName(),
                element.getNamespace());
        for (Iterator it = element.getAllAttributes(); it.hasNext(); ) {
            headerBlock.addAttribute((OMAttribute)it.next());
        }
        headerBlock.setMustUnderstand(mustUnderstand);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPHeader.addHeaderBlock()

        SOAPFactory fac = (SOAPFactory) env.getOMFactory();
        SOAPHeader header = env.getHeader();
        if (header == null) {
            header = fac.createSOAPHeader(env);
        }
        SOAPHeaderBlock hb = header.addHeaderBlock(qName.getLocalPart(),
                fac.createOMNamespace(qName.getNamespaceURI(), qName.getPrefix()));
        hb.setText(value);
    }

    private void removeFromHeaderList(List headersList) {
View Full Code Here

Examples of org.apache.axiom.soap.SOAPHeader.addHeaderBlock()

    protected void runTest() throws Throwable {
        SOAPEnvelope soapEnvelope = soapFactory.createSOAPEnvelope();
        SOAPHeader soapHeader = soapFactory.createSOAPHeader(soapEnvelope);
        OMNamespace namespace = soapFactory.createOMNamespace("http://www.example.org", "test");
        soapHeader.addHeaderBlock("echoOk1", namespace);
        soapHeader.addHeaderBlock("echoOk2",
                                    soapFactory.createOMNamespace("http://www.test1.org", "test1"));
        ArrayList arrayList = soapHeader.getHeaderBlocksWithNSURI(
                "http://www.test1.org");
        assertEquals(
View Full Code Here

Examples of org.apache.axiom.soap.SOAPHeader.addHeaderBlock()

    protected void runTest() throws Throwable {
        SOAPEnvelope soapEnvelope = soapFactory.createSOAPEnvelope();
        SOAPHeader soapHeader = soapFactory.createSOAPHeader(soapEnvelope);
        OMNamespace namespace = soapFactory.createOMNamespace("http://www.example.org", "test");
        soapHeader.addHeaderBlock("echoOk1", namespace);
        soapHeader.addHeaderBlock("echoOk2",
                                    soapFactory.createOMNamespace("http://www.test1.org", "test1"));
        ArrayList arrayList = soapHeader.getHeaderBlocksWithNSURI(
                "http://www.test1.org");
        assertEquals(
                "SOAP Header Test : - getHeaderBlocksWithNSURI returns an arrayList of incorrect size",
View Full Code Here

Examples of org.apache.axiom.soap.SOAPHeader.addHeaderBlock()

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPHeader header = soapFactory.createSOAPHeader(envelope);
        OMNamespace ns = soapFactory.createOMNamespace("", "");
        try {
            header.addHeaderBlock("test", ns);
            fail("Expected OMException");
        } catch (OMException ex) {
            // Expected
        }
    }
View Full Code Here

Examples of org.apache.axiom.soap.SOAPHeader.addHeaderBlock()

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPHeader header = soapFactory.createSOAPHeader(envelope);
        OMNamespace ns = soapFactory.createOMNamespace("urn:ns", "p");
        SOAPHeaderBlock h1 = header.addHeaderBlock("header1", ns);
        SOAPHeaderBlock h2 = header.addHeaderBlock("header2", ns);
        Iterator it = header.extractAllHeaderBlocks();
        assertTrue(it.hasNext());
        assertSame(h1, it.next());
        assertTrue(it.hasNext());
View Full Code Here

Examples of org.apache.axiom.soap.SOAPHeader.addHeaderBlock()

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPHeader header = soapFactory.createSOAPHeader(envelope);
        OMNamespace ns = soapFactory.createOMNamespace("urn:ns", "p");
        SOAPHeaderBlock h1 = header.addHeaderBlock("header1", ns);
        SOAPHeaderBlock h2 = header.addHeaderBlock("header2", ns);
        Iterator it = header.extractAllHeaderBlocks();
        assertTrue(it.hasNext());
        assertSame(h1, it.next());
        assertTrue(it.hasNext());
        assertSame(h2, it.next());
View Full Code Here

Examples of org.apache.axiom.soap.SOAPHeader.addHeaderBlock()

    protected void runTest() throws Throwable {
        SOAPEnvelope soapEnvelope = soapFactory.createSOAPEnvelope();
        SOAPHeader soapHeader = soapFactory.createSOAPHeader(soapEnvelope);
        OMNamespace namespace = soapFactory.createOMNamespace("http://www.example.org", "test");
        soapHeader.addHeaderBlock("echoOk1", namespace);
        soapHeader.addHeaderBlock("echoOk2", namespace);
        Iterator iterator = soapHeader.examineAllHeaderBlocks();
        iterator.hasNext();
        SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
        assertNotNull(
View Full Code Here

Examples of org.apache.axiom.soap.SOAPHeader.addHeaderBlock()

    protected void runTest() throws Throwable {
        SOAPEnvelope soapEnvelope = soapFactory.createSOAPEnvelope();
        SOAPHeader soapHeader = soapFactory.createSOAPHeader(soapEnvelope);
        OMNamespace namespace = soapFactory.createOMNamespace("http://www.example.org", "test");
        soapHeader.addHeaderBlock("echoOk1", namespace);
        soapHeader.addHeaderBlock("echoOk2", namespace);
        Iterator iterator = soapHeader.examineAllHeaderBlocks();
        iterator.hasNext();
        SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
        assertNotNull(
                "SOAP Header Test : - After calling addHeaderBlock method twice, examineAllHeaderBlocks method returns empty iterator",
View Full Code Here

Examples of org.apache.axiom.soap.SOAPHeader.addHeaderBlock()

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPHeader header = soapFactory.createSOAPHeader(envelope);
        try {
            header.addHeaderBlock("test", null);
            fail("Expected OMException");
        } catch (OMException ex) {
            // Expected
        }
    }
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.