Example usage for javax.xml.soap SOAPConnection get

List of usage examples for javax.xml.soap SOAPConnection get

Introduction

In this page you can find the example usage for javax.xml.soap SOAPConnection get.

Prototype

public SOAPMessage get(Object to) throws SOAPException 

Source Link

Document

Gets a message from a specific endpoint and blocks until it receives,

Usage

From source file:org.apache.axis2.saaj.SOAPConnectionTest.java

public void testGet() {
    if (isNetworkedResourceAvailable("http://java.sun.com/index.html")) {
        try {//w  ww .ja va  2 s. c om
            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) {
            assertTrue(e instanceof SOAPException);
        }
    } else {
        //If resource is not available online, do a mock test
        assertTrue(true);
    }
}