Send XML requests

Note: See the sample files XMLApiAdapter.java and createmeeting.jsp.

Once a user is logged in, it’s useful to have a generic request method that sends a request to the server when you provide an action name and query string.

The request method in the sample takes an action and a query string and sends the BREEZESESSION cookie value back to the server in the request header:

protected Element request(String action, String queryString) 
            throws XMLApiException { 
        try { 
            if (breezesession == null) 
                login(); 
 
            URL url = breezeUrl(action, queryString); 
 
            URLConnection conn = url.openConnection(); 
            conn.setRequestProperty("Cookie", "BREEZESESSION=" + breezesession); 
            conn.connect(); 
 
            InputStream resultStream = conn.getInputStream(); 
            Document doc = new SAXBuilder(false).build(resultStream); 
            return doc.getRootElement(); 
 
        } catch (IOException ioe) { 
            throw new XMLApiException("A communication error occurred", ioe); 
        } catch (JDOMException jde) { 
            throw new XMLApiException("A parsing error occurred", jde); 
        }  
} 

// Ethnio survey code removed