Package org.objectweb.header_test.types

Examples of org.objectweb.header_test.types.TestHeader5


        //TestHeader5 return Header
        Method testHeader5 = SOAPMessageUtil.getMethod(TestHeader.class, "testHeader5");
        assertNotNull(testHeader5);
        objContext.setMethod(testHeader5);
       
        TestHeader5 arg2 = new TestHeader5();
        arg2.setRequestType("HeaderVal5");
       
        objContext.setMessageObjects(new Object[0]);
        objContext.setReturn(arg2);
        //Write the SOAP Headers for testHeader5 operation - tests headers as return.       
        binding.marshal(
                                     objContext,
                                     soapContext,
                                     new JAXBDataBindingCallback(testHeader5,
                                                                 DataBindingCallback.Mode.PARTS,
                                                                 null));               

        msg = soapContext.getMessage();
        assertNotNull(msg);

        //Test the Header Part Only
        assertNotNull(msg.getSOAPHeader());
        assertTrue(msg.getSOAPHeader().hasChildNodes());
        list = msg.getSOAPHeader().getChildNodes();
        assertEquals(1, list.getLength());
        headerElement = (Element)list.item(0);
        //Check for mustUndrstand Attribute
        assertEquals("true", headerElement
                     .getAttributeNS(SOAPConstants.HEADER_MUSTUNDERSTAND.getNamespaceURI(),
                                     SOAPConstants.HEADER_MUSTUNDERSTAND.getLocalPart()));
       
        //TestHeader5 has child elements.
        assertTrue(headerElement.hasChildNodes());
        list = headerElement.getChildNodes();
        assertEquals(1, list.getLength());
        assertEquals(arg2.getRequestType(), list.item(0).getFirstChild().getNodeValue());
       
    }
View Full Code Here


        assertNotNull(params);
        assertEquals(1, params.length);      
        //Test the Header method paramaters       
        assertNotNull(objContext.getReturn());
        TestHeader5 header5 = (TestHeader5)objContext.getReturn();
        assertEquals("HeaderVal5", header5.getRequestType());
       
    }
View Full Code Here

    }

    public void testReturnHeader() throws Exception {
       
        try {
            TestHeader5 in = new TestHeader5();
            String val = new String(TestHeader5.class.getSimpleName());
            for (int idx = 0; idx < 2; idx++) {
                val += idx;               
                in.setRequestType(val);
                TestHeader5 returnVal = proxy.testHeader5(in);

                //in copied to return               
                assertNotNull(returnVal);
                assertEquals(val, returnVal.getRequestType());
            }
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
        }
    }
View Full Code Here

TOP

Related Classes of org.objectweb.header_test.types.TestHeader5

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.