Examples of SOAPMessage


Examples of javax.xml.soap.SOAPMessage

            assertEquals("astring", mc.get("a"));
            assertTrue((Boolean)mc.get("b"));
            assertEquals(Integer.MIN_VALUE, ((Integer)mc.get("c")).intValue());
            assertEquals(mn, (BigInteger)mc.get("d"));
            assertNull(mc.get("e"));
            SOAPMessage smsg = (SOAPMessage)mc.get(SOAP_MSG_KEY);
            for (int i = 0; i < smsg.getSOAPBody().getChildNodes().getLength(); i++) {
                Node node = smsg.getSOAPBody().getChildNodes().item(i);
                if (Node.ELEMENT_NODE == node.getNodeType()) {
                    assertEquals("greetMeRequest", node.getLocalName());
                }
            }
        }
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        SOAPService service = new SOAPService(wsdl, serviceName);
        assertNotNull(service);

        InputStream is =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
        SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null,  is);
        assertNotNull(soapReqMsg);
       
        InputStream is1 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq1.xml");
        SOAPMessage soapReqMsg1 = MessageFactory.newInstance().createMessage(null,  is1);
        assertNotNull(soapReqMsg1);
       
        InputStream is2 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq2.xml");
        SOAPMessage soapReqMsg2 = MessageFactory.newInstance().createMessage(null,  is2);
        assertNotNull(soapReqMsg2);
       
        InputStream is3 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq3.xml");
        SOAPMessage soapReqMsg3 = MessageFactory.newInstance().createMessage(null,  is3);
        assertNotNull(soapReqMsg3);

        Dispatch<SOAPMessage> disp = service.createDispatch(portName,
                                                            SOAPMessage.class, Service.Mode.MESSAGE);
        SOAPMessage soapResMsg = disp.invoke(soapReqMsg);
        assertNotNull(soapResMsg);
        String expected = "Hello TestSOAPInputMessage";
        assertEquals("Response should be : Hello TestSOAPInputMessage",
                     expected, soapResMsg.getSOAPBody().getTextContent());
       
        disp.invokeOneWay(soapReqMsg1);
       
        Response response = disp.invokeAsync(soapReqMsg2);
        SOAPMessage soapResMsg2 = (SOAPMessage)response.get();
        assertNotNull(soapResMsg2);
        String expected2 = "Hello TestSOAPInputMessage2";
        assertEquals("Response should be : Hello TestSOAPInputMessage2",
                     expected2, soapResMsg2.getSOAPBody().getTextContent());
       
        TestSOAPMessageHandler tsmh = new TestSOAPMessageHandler();
        Future f = disp.invokeAsync(soapReqMsg3, tsmh);
        assertNotNull(f);
        while (!f.isDone()) {
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        SOAPService service = new SOAPService(wsdl, serviceName);
        assertNotNull(service);

        InputStream is =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
        SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
        DOMSource domReqMsg = new DOMSource(soapReqMsg.getSOAPPart());
        assertNotNull(domReqMsg);
       
        InputStream is1 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq1.xml");
        SOAPMessage soapReqMsg1 = MessageFactory.newInstance().createMessage(null, is1);
        DOMSource domReqMsg1 = new DOMSource(soapReqMsg1.getSOAPPart());
        assertNotNull(domReqMsg1);
       
        InputStream is2 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq2.xml");
        SOAPMessage soapReqMsg2 = MessageFactory.newInstance().createMessage(null, is2);
        DOMSource domReqMsg2 = new DOMSource(soapReqMsg2.getSOAPPart());
        assertNotNull(domReqMsg2);
       
        InputStream is3 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq3.xml");
        SOAPMessage soapReqMsg3 = MessageFactory.newInstance().createMessage(null, is3);
        DOMSource domReqMsg3 = new DOMSource(soapReqMsg3.getSOAPPart());
        assertNotNull(domReqMsg3);
   

        Dispatch<DOMSource> disp = service.createDispatch(portName,
                                                            DOMSource.class, Service.Mode.MESSAGE);
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        SOAPService service = new SOAPService(wsdl, serviceName);
        assertNotNull(service);

        InputStream is =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
        SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null,  is);
        DOMSource domReqMsg = new DOMSource(soapReqMsg.getSOAPBody().extractContentAsDocument());
        assertNotNull(domReqMsg);
       
        InputStream is1 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq1.xml");
        SOAPMessage soapReqMsg1 = MessageFactory.newInstance().createMessage(null,  is1);
        DOMSource domReqMsg1 = new DOMSource(soapReqMsg1.getSOAPBody().extractContentAsDocument());
        assertNotNull(domReqMsg1);
       
        InputStream is2 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq2.xml");
        SOAPMessage soapReqMsg2 = MessageFactory.newInstance().createMessage(null,  is2);
        DOMSource domReqMsg2 = new DOMSource(soapReqMsg2.getSOAPBody().extractContentAsDocument());
        assertNotNull(domReqMsg2);
       
        InputStream is3 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq3.xml");
        SOAPMessage soapReqMsg3 = MessageFactory.newInstance().createMessage(null,  is3);
        DOMSource domReqMsg3 = new DOMSource(soapReqMsg3.getSOAPBody().extractContentAsDocument());
        assertNotNull(domReqMsg3);

        Dispatch<DOMSource> disp = service.createDispatch(portName,
                                                            DOMSource.class, Service.Mode.PAYLOAD);
       
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

       
        String replyBuffer;
       
        public void handleResponse(Response<SOAPMessage> response) {
            try {
                SOAPMessage reply = response.get();
                replyBuffer = reply.getSOAPBody().getTextContent();
            } catch (Exception e) {
                e.printStackTrace();
            }           
        }
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

     * @param maps the MAPs to encode
     */
    private void encode(SOAPMessageContext context,
                        AddressingProperties maps) {
        if (maps != null) {
            SOAPMessage message = context.getMessage();
            LOG.log(Level.INFO, "encoding MAPs in SOAP headers");
            try {
                SOAPEnvelope env = message.getSOAPPart().getEnvelope();
                SOAPHeader header = env.getHeader() != null
                                    ? env.getHeader()
                                    : env.addHeader();
                discardMAPs(header);
                header.addNamespaceDeclaration(Names.WSA_NAMESPACE_PREFIX,
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

    private AddressingProperties decode(SOAPMessageContext context) {
        // REVISIT generate MessageAddressingHeaderRequired fault if an
        // expected header is missing
        AddressingProperties maps = null;
        boolean isRequestor = ContextUtils.isRequestor(context);
        SOAPMessage message = context.getMessage();
        maps = unmarshalMAPs(message);
        if (isRequestor && null != maps.getRelatesTo()) {
            ContextUtils.storeCorrelationID(maps.getRelatesTo(),
                                            false,
                                            context);
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

    public SOAPMessageDataReader(DynamicDataBindingCallback cb) {
        callback = cb;
    }

    public Object read(int idx, T input) {
        SOAPMessage src = (SOAPMessage)input;
        Source obj = null;
        try {
            if (DOMSource.class.isAssignableFrom(callback.getSupportedFormats()[0])) {
               
                obj = new DOMSource(src.getSOAPPart());
               
            } else if (SAXSource.class.isAssignableFrom(callback.getSupportedFormats()[0])) {
               
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                src.writeTo(baos);
                ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
                InputSource inputSource = new InputSource(bais);
                obj = new SAXSource(inputSource);
               
            } else if (StreamSource.class.isAssignableFrom(callback.getSupportedFormats()[0])) {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                src.writeTo(baos);
                ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
                obj = new StreamSource(bais);
            }
        } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        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 operationNode = list.item(0);
        assertEquals(objContext.getMethod().getName(), operationNode.getLocalName());
        WebService wsAnnotation = objContext.getMethod().getDeclaringClass().getAnnotation(WebService.class);
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        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 operationNode = list.item(0);
        assertEquals(objContext.getMethod().getName() + "Response", operationNode.getLocalName());
       
        WebService wsAnnotation = objContext.getMethod().getDeclaringClass().getAnnotation(WebService.class);
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.