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);
        } 
} 


Take a survey


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/breeze/6/xml_api/appa_fi8.htm