Package javax.xml.soap

Examples of javax.xml.soap.SOAPMessage


        objContext.setMethod(testHeader2);
        objContext.setMessageObjects(SOAPMessageUtil.getMessageObjects(testHeader2));
       
        InputStream is =  getClass().getResourceAsStream("resources/TestHeader2DocLitResp.xml");
        assertNotNull(binding.getMessageFactory());
        SOAPMessage headerMsg = binding.getMessageFactory().createMessage(null,  is);
        soapContext.setMessage(headerMsg);
        soapContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
       
        binding.unmarshal(soapContext, objContext,
                                 new JAXBDataBindingCallback(
View Full Code Here


       
        ByteArrayInputStream bais = new ByteArrayInputStream(osc.getOutputStreamBytes());
       
        //System.out.println(new String(osc.getOutputStreamBytes()));
       
        SOAPMessage msg = MessageFactory.newInstance().createMessage(null,  bais);
        assertNotNull(msg);
        assertFalse(msg.getSOAPBody().hasFault());       
        Node xmlNode = msg.getSOAPBody();
        assertNotNull(xmlNode);
        assertEquals(1, xmlNode.getChildNodes().getLength());
        //Check if the Response Node is "sayHiResponse"
        xmlNode = xmlNode.getFirstChild();
        assertEquals("sayHiResponse", xmlNode.getLocalName());
View Full Code Here

        ByteArrayInputStream bais = new ByteArrayInputStream(osc.getOutputStreamBytes());
        checkSystemFaultMessage(bais);
    }

    private void checkSystemFaultMessage(ByteArrayInputStream bais) throws Exception {
        SOAPMessage msg = MessageFactory.newInstance().createMessage(null,  bais);
        assertNotNull(msg);
        Node xmlNode = msg.getSOAPBody();
        assertNotNull(xmlNode);
        assertEquals(1, xmlNode.getChildNodes().getLength());
       
        assertTrue(msg.getSOAPBody().hasFault());
       
        SOAPFault fault = msg.getSOAPBody().getFault();
        assertNotNull(fault);
        assertTrue(fault.hasChildNodes());
       
        //For Celtix Runtime Exceptions - SOAPFault will not have a Detail Node
        Detail detail = fault.getDetail();
View Full Code Here

   
    private void checkUserFaultMessage(ByteArrayInputStream bais,
                              Class<? extends Exception> clazz,
                              String faultString) throws Exception {
       
        SOAPMessage msg = MessageFactory.newInstance().createMessage(null,  bais);
        assertNotNull(msg);
        assertTrue(msg.getSOAPBody().hasFault());
        SOAPFault fault = msg.getSOAPBody().getFault();
        assertNotNull(fault);
       
        StringBuffer str = new StringBuffer(clazz.getName());
        str.append(": ");
        str.append(faultString);
View Full Code Here

        binding.marshal(objContext,
                         soapContext,
                         new JAXBDataBindingCallback(objContext.getMethod(),
                                                     DataBindingCallback.Mode.PARTS,
                                                     null));
        SOAPMessage msg = soapContext.getMessage();
        assertNotNull(msg);

        assertTrue(msg.getSOAPBody().hasChildNodes());
        NodeList list = msg.getSOAPBody().getChildNodes();
        assertEquals(1, list.getLength());
        Node wrappedNode = list.item(0).getFirstChild();
        assertTrue(wrappedNode.hasChildNodes());
        assertEquals(arg0, wrappedNode.getFirstChild().getNodeValue());
    }
View Full Code Here

        binding.marshal(objContext,
                         soapContext,
                         new JAXBDataBindingCallback(objContext.getMethod(),
                                                     DataBindingCallback.Mode.PARTS,
                                                     null));
        SOAPMessage msg = soapContext.getMessage();
        assertNotNull(msg);

        assertTrue(msg.getSOAPBody().hasChildNodes());
        NodeList list = msg.getSOAPBody().getChildNodes();
        assertEquals(1, list.getLength());
        list = list.item(0).getChildNodes();
        assertEquals(2, list.getLength());
        Node wrappedNode = list.item(0);
        assertEquals(String.valueOf(arg0), wrappedNode.getFirstChild().getNodeValue());
View Full Code Here

        binding.marshal(objContext,
                        soapContext,
                         new JAXBDataBindingCallback(objContext.getMethod(),
                                                     DataBindingCallback.Mode.PARTS,
                                                     null));
        SOAPMessage msg = soapContext.getMessage();
        assertNotNull(msg);
        assertTrue(msg.getSOAPBody().hasChildNodes());
        NodeList list = msg.getSOAPBody().getChildNodes();
        assertEquals(1, list.getLength());
        Node wrappedNode = list.item(0).getFirstChild();
        assertTrue(wrappedNode.hasChildNodes());
        assertEquals(arg0, wrappedNode.getFirstChild().getNodeValue());
    }
View Full Code Here

        String str = SOAPMessageUtil.createWrapDocLitSOAPMessage(wrapName, elName, data);       
       
        TestInputStreamContext inCtx = new TestInputStreamContext(str.getBytes());
        binding.read(inCtx, soapContext);

        SOAPMessage msg = soapContext.getMessage();
        assertNotNull(msg);
        assertTrue(msg.getSOAPBody().hasChildNodes());
        NodeList list = msg.getSOAPBody().getChildNodes();

        assertEquals(1, list.getLength());
        Node wrappedNode = list.item(0).getFirstChild();
        assertTrue(wrappedNode.hasChildNodes());
        assertEquals(data, wrappedNode.getFirstChild().getNodeValue());
View Full Code Here

        String str = SOAPMessageUtil.createWrapDocLitSOAPMessage(wrapName, elName, data);
        InputStream in = new ByteArrayInputStream(str.getBytes());
        soapContext.put(ObjectMessageContext.MESSAGE_INPUT, false);

        assertNotNull(binding.getMessageFactory());
        SOAPMessage soapMessage = binding.getMessageFactory().createMessage(null, in);
        soapContext.setMessage(soapMessage);

        //GreetMe method has a IN parameter
        objContext.setMessageObjects(new Object[1]);
        binding.unmarshal(soapContext,
View Full Code Here

        assertNotNull(testInt);
        objContext.setMethod(testInt);
       
        InputStream is =  getClass().getResourceAsStream("resources/TestIntDocLitTypeTestReq.xml");
        assertNotNull(binding.getMessageFactory());
        SOAPMessage faultMsg = binding.getMessageFactory().createMessage(null,  is);
        soapContext.setMessage(faultMsg);
        soapContext.put(ObjectMessageContext.MESSAGE_INPUT, false);

        Object[] methodArg = SOAPMessageUtil.getMessageObjects(testInt);
        assertNotNull(methodArg);
View Full Code Here

TOP

Related Classes of javax.xml.soap.SOAPMessage

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.