Package javax.xml.soap

Examples of javax.xml.soap.SOAPConnectionFactory



    public void testGet() {
      if(isNetworkedResourceAvailable("http://java.sun.com/index.html")){
            try {
                SOAPConnectionFactory sf = new SOAPConnectionFactoryImpl();
                SOAPConnection con = sf.createConnection();
                //Create a valid non webservice endpoint for invoking HTTP-GET
                URL urlEndpoint = new URL("http", "java.sun.com", 80, "/index.html");
                //invoking HTTP-GET with a valid non webservice endpoint should throw a SOAPException
                SOAPMessage reply = con.get(urlEndpoint);
            } catch (Exception e) {
View Full Code Here


   
    @Test
    public void testSWA() throws Exception {
        SOAPFactory soapFac = SOAPFactory.newInstance();
        MessageFactory msgFac = MessageFactory.newInstance();
        SOAPConnectionFactory conFac = SOAPConnectionFactory.newInstance();
        SOAPMessage msg = msgFac.createMessage();
       
        QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHiWAttach");
        msg.getSOAPBody().addChildElement(soapFac.createElement(sayHi));
        AttachmentPart ap1 = msg.createAttachmentPart();
        ap1.setContent("Attachment content", "text/plain");
        msg.addAttachmentPart(ap1);
        AttachmentPart ap2 = msg.createAttachmentPart();
        ap2.setContent("Attachment content - Part 2", "text/plain");
        msg.addAttachmentPart(ap2);
        msg.saveChanges();
       
        SOAPConnection con = conFac.createConnection();
        URL endpoint = new URL("http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit1");
        SOAPMessage response = con.call(msg, endpoint);
        QName sayHiResp = new QName("http://apache.org/hello_world_rpclit", "sayHiResponse");
        assertNotNull(response.getSOAPBody().getChildElements(sayHiResp));
        assertEquals(2, response.countAttachments());
View Full Code Here

        Element response = null;
        try {
            SOAPMessage message = this.createSOAPMessage(request);
            //Make the SAAJ Call now
            SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
            SOAPConnection connection = soapConnectionFactory.createConnection();
            SOAPMessage soapResponse = connection.call(message, endpointURL.toURL());

            SOAPBody soapBody = soapResponse.getSOAPBody();
            boolean hasFault = soapBody.hasFault();
            if (hasFault) {
View Full Code Here

        }
    }

    @Validated @Test
    public void testCloseTwice() {
        SOAPConnectionFactory soapConnectionFactory = null;
        try {
            soapConnectionFactory = SOAPConnectionFactory.newInstance();
        } catch (SOAPException e) {
            fail("Unexpected Exception " + e);
        }

        SOAPConnection sCon = null;
        try {
            sCon = soapConnectionFactory.createConnection();
            sCon.close();
        } catch (SOAPException e) {
            fail("Unexpected Exception " + e);
        }
View Full Code Here

        }
    }

    @Validated @Test
    public void testCallOnCloseConnection() {
        SOAPConnectionFactory soapConnectionFactory = null;
        try {
            soapConnectionFactory = SOAPConnectionFactory.newInstance();
        } catch (SOAPException e) {
            fail("Unexpected Exception " + e);
        }

        SOAPConnection sCon = null;
        try {
            sCon = soapConnectionFactory.createConnection();
            sCon.close();
        } catch (SOAPException e) {
            fail("Unexpected Exception " + e);
        }
View Full Code Here

    @Validated @Test
    public void testGet() {
      if(isNetworkedResourceAvailable("http://java.sun.com/index.html")){
            try {
                SOAPConnectionFactory sf = new SOAPConnectionFactoryImpl();
                SOAPConnection con = sf.createConnection();
                //Create a valid non webservice endpoint for invoking HTTP-GET
                URL urlEndpoint = new URL("http", "java.sun.com", 80, "/index.html");
                //invoking HTTP-GET with a valid non webservice endpoint should throw a SOAPException
                SOAPMessage reply = con.get(urlEndpoint);
            } catch (Exception e) {
View Full Code Here

        SOAPElement application =
                requestSigningRequest.addChildElement("application", NS);
        application.addTextNode(getApplicationString(filesToSign));

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

        log("Sending siging request to server and waiting for response");
        SOAPMessage response = connection.call(message, endpoint);
View Full Code Here

        SOAPElement returnApplication =
                getSigningSetDetailsRequest.addChildElement("returnApplication", NS);
        returnApplication.addTextNode("true");

        // Send the message
        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);
View Full Code Here

    public TestAttachment(String name) {
        super(name);
    }

    public void testStringAttachment() throws Exception {
        SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
        SOAPConnection con = scFactory.createConnection();

        MessageFactory factory = MessageFactory.newInstance();
        SOAPMessage message = factory.createMessage();
        AttachmentPart attachment = message.createAttachmentPart();
        String stringContent = "Update address for Sunny Skies " +
View Full Code Here

    public TestEnvelope(String name) {
        super(name);
    }

    private SOAPEnvelope getSOAPEnvelope() throws Exception {
        SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
        SOAPConnection con = scFactory.createConnection();

        MessageFactory factory = MessageFactory.newInstance();
        SOAPMessage message = factory.createMessage();
        SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
        return envelope;
View Full Code Here

TOP

Related Classes of javax.xml.soap.SOAPConnectionFactory

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.