Package org.objectweb.header_test.types

Examples of org.objectweb.header_test.types.TestHeader2Response


        //Test The InputMessage of testHeader1 Operation
        soapContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
        Method testHeader2 = SOAPMessageUtil.getMethod(TestHeader.class, "testHeader2");
        assertNotNull(testHeader2);
        objContext.setMethod(testHeader2);
        TestHeader2Response arg0 = new TestHeader2Response();
        arg0.setResponseType("BodyVal2");
        TestHeader2Response arg1 = new TestHeader2Response();
        arg1.setResponseType("HeaderVal2");
       
        Object[] args = SOAPMessageUtil.getMessageObjects(testHeader2, null, arg0, arg1);
        objContext.setMessageObjects(args);
        //Write the SOAP Headers for testHeader2 operation - tests out headers       
        binding.marshal(
                   objContext,
                   soapContext,
                   new JAXBDataBindingCallback(testHeader2,
                                               DataBindingCallback.Mode.PARTS,
                                               null));               

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

        //Test the Header Part Only
        assertNotNull(msg.getSOAPHeader());
        assertTrue(msg.getSOAPHeader().hasChildNodes());
        NodeList list = msg.getSOAPHeader().getChildNodes();
        assertEquals(1, list.getLength());
        Element headerElement = (Element)list.item(0);
        //Check for mustUndrstand Attribute
        assertEquals("true", headerElement
                     .getAttributeNS(SOAPConstants.HEADER_MUSTUNDERSTAND.getNamespaceURI(),
                                     SOAPConstants.HEADER_MUSTUNDERSTAND.getLocalPart()));
       
        //TestHeader3 has child elements.
        assertTrue(headerElement.hasChildNodes());
        list = headerElement.getChildNodes();
        assertEquals(1, list.getLength());
        assertEquals(arg1.getResponseType(), list.item(0).getFirstChild().getNodeValue());
       
        //TestHeader5 return Header
        Method testHeader5 = SOAPMessageUtil.getMethod(TestHeader.class, "testHeader5");
        assertNotNull(testHeader5);
        objContext.setMethod(testHeader5);
View Full Code Here


        //Test the Header method paramaters
        assertTrue(params[2].getClass().isAssignableFrom(Holder.class));
        Holder<?> holder = (Holder<?>)params[2];
        assertNotNull(holder.value);
        assertTrue(holder.value.getClass().isAssignableFrom(TestHeader2Response.class));
        TestHeader2Response header2 = (TestHeader2Response)holder.value;
        assertEquals("HeaderVal2", header2.getResponseType());
       
        //test for return header using TestHeader5 operation
        Method testHeader5 = SOAPMessageUtil.getMethod(TestHeader.class, "testHeader5");
        assertNotNull(testHeader5);
        objContext.setMethod(testHeader5);
View Full Code Here

       
        assertEquals(2, obj3.length);
        assertTrue(TestHeader2Response.class.isAssignableFrom(obj3[0].getClass()));
        assertTrue(TestHeader2Response.class.isAssignableFrom(obj3[1].getClass()));
       
        TestHeader2Response val = (TestHeader2Response)obj3[0];
        assertEquals("Header1", val.getResponseType());
       
        val = (TestHeader2Response)obj3[1];
        assertEquals("Header2", val.getResponseType());
       
    }
View Full Code Here

    public void testHeader2(
        TestHeader2 in,
        Holder<TestHeader2Response> out,
        Holder<TestHeader2Response> outHeader) {
       
        TestHeader2Response outVal = new TestHeader2Response();
        outVal.setResponseType(in.getRequestType());
        out.value = outVal;
       
        TestHeader2Response outHeaderVal = new TestHeader2Response();
        outHeaderVal.setResponseType(in.getRequestType());
        outHeader.value = outHeaderVal;       
    }
View Full Code Here

TOP

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

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.