Package javax.xml.soap

Examples of javax.xml.soap.SOAPConnection.call()


        SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
        SOAPConnection connection = soapConnectionFactory.createConnection();
        URL endpoint = new URL("https://test-api.ws.symantec.com:443/webtrust/SigningService");

        log("Requesting signed files from server and waiting for response");
        SOAPMessage response = connection.call(message, endpoint);

        log("Processing response");
        SOAPElement responseBody = response.getSOAPBody();

        // Check for success
View Full Code Here


        String headerName = "foo";
        String headerValue = "bar";
        message.getMimeHeaders().addHeader(headerName, headerValue);

        URLEndpoint endpoint = new URLEndpoint("http://localhost:8080/axis/services/TestMimeHeaderService");
        SOAPMessage response = con.call(message, endpoint);
        String[] responseHeader = response.getMimeHeaders().getHeader(headerName);
        assertTrue("Response header was null", responseHeader != null);
        assertEquals("ResponseHeader.length wasn't 1", 1, responseHeader.length);
        assertEquals("Header value didn't match", headerValue, responseHeader[0]);
    }
View Full Code Here

        Name name = envelope.createName("arg0");
        SOAPElement symbol = bodyElement.addChildElement(name);
        symbol.addTextNode("Hello");

        URLEndpoint endpoint = new URLEndpoint("http://localhost:8080/jws/EchoHeaders.jws");
        SOAPMessage response = con.call(message, endpoint);
        String responseEncoding = (String) response.getProperty(SOAPMessage.CHARACTER_SET_ENCODING);
        assertEquals(requestEncoding, responseEncoding);
    }
}
View Full Code Here

        Name name = envelope.createName("arg0");
        SOAPElement symbol = bodyElement.addChildElement(name);
        symbol.addTextNode("Hello");

        URLEndpoint endpoint = new URLEndpoint("http://localhost:8080/jws/FaultTest.jws");
        SOAPMessage response = con.call(message, endpoint);
        SOAPBody respBody = response.getSOAPPart().getEnvelope().getBody();
        assertTrue(respBody.hasFault());
    }

    public static void main(String args[]) throws Exception {
View Full Code Here

        Name name = envelope.createName("arg0");
        SOAPElement symbol = bodyElement.addChildElement(name);
        symbol.addTextNode("Hello");

        URLEndpoint endpoint = new URLEndpoint("http://localhost:8080/jws/FaultTest.jws");
        SOAPMessage response = con.call(message, endpoint);
        SOAPBody respBody = response.getSOAPPart().getEnvelope().getBody();
        assertTrue(respBody.hasFault());
    }

    public static void main(String args[]) throws Exception {
View Full Code Here

        } catch (SOAPException e) {
            fail("Unexpected Exception " + e);
        }

        try {
            sCon.call(null, new Object());
            fail("Expected Exception did not occur");
        } catch (SOAPException e) {
            assertTrue(true);
        }
    }
View Full Code Here

        //Namespace prefix is empty
        body.addBodyElement(new QName("http://fakeNamespace2.org","echo"))
                      .addTextNode("This is some text");

        SOAPConnection sCon = SOAPConnectionFactory.newInstance().createConnection();
        SOAPMessage response = sCon.call(request, getAddress());
        assertFalse(response.getAttachments().hasNext());
        assertEquals(0, response.countAttachments());

        String requestStr = printSOAPMessage(request);
        String responseStr = printSOAPMessage(response);
View Full Code Here

        SOAPMessage request = mf.createMessage();

        createSimpleSOAPPart(request);

        SOAPConnection sCon = SOAPConnectionFactory.newInstance().createConnection();
        SOAPMessage response = sCon.call(request, getAddress());
        assertFalse(response.getAttachments().hasNext());
        assertEquals(0, response.countAttachments());

        String requestStr = printSOAPMessage(request);
        String responseStr = printSOAPMessage(response);
View Full Code Here

        jpegAttach.setContentId("submitSampleImage@apache.org");
        jpegAttach.setContentType("image/jpg");
        request.addAttachmentPart(jpegAttach);

        SOAPConnection sCon = SOAPConnectionFactory.newInstance().createConnection();
        SOAPMessage response = sCon.call(request, getAddress());

        assertEquals(2, response.countAttachments());

        Iterator attachIter = response.getAttachments();
View Full Code Here

        InputStream inputStream = TestUtils.getTestFile("soap-part-iso-8859-1.xml");
        SOAPMessage requestMessage = MessageFactory.newInstance().createMessage(mimeHeaders, inputStream);
       

        SOAPConnection sCon = SOAPConnectionFactory.newInstance().createConnection();
        SOAPMessage response = sCon.call(requestMessage, getAddress());
        assertFalse(response.getAttachments().hasNext());
        assertEquals(0, response.countAttachments());

        printSOAPMessage(requestMessage);
        String responseStr = printSOAPMessage(response);
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.