MACROMEDIA BREEZE 5 Integration Manual page 67

Hide thumbs Also See for BREEZE 5:
Table of Contents

Advertisement

The following Java example parses the HTTP headers to store the cookie, and then indicates how
it can be passed on for all subsequent requests:
login="john@example.com"
password="abcdefg"
baseurl="http://breeze.example.com/"
URL loginUrl=new URL(baseUrl + "api/xml?action=login&login=" + login +
"&password=" + password);
URLConnection conn=loginUrl.openConnection();
conn.connect();
InputStream resultStream=conn.getInputStream();
Document doc=new SAXBuilder(false).build(resultStream);
String cookieString=(String) (conn.getHeaderField("Set-Cookie"));
StringTokenizer st=new StringTokenizer(cookieString, "=");
if (st.countTokens() > 1 && st.nextToken().equals("BREEZESESSION")) {
String cookieNext=st.nextToken();
int semiIndex=cookieNext.indexOf(';');
cookie=cookieNext.substring(0, semiIndex);
}
if (cookie == null){
throw new RuntimeException("Couldn't find the Breeze cookie.");
}
To pass the
BREEZESESSION
URLConnection conn=url.openConnection();
conn.setRequestProperty("Cookie", "BREEZESESSION=" + cookie);
conn.connect();
The preceding example sets the password and username variables manually. In a real application,
you would probably create a form that collected the password and username and passed the
variables to the code.
For a ColdFusion example, see
Parameters
The ID of the account with which the user is associated. This parameter is
account-id
optional. If your organization has only one account, don't specify an
The user's login name, which is usually the user's e-mail address.
login
The user's password.
password
Note: If the
or
login
code of
.
no-data
Filters
Results cannot be filtered or sorted.
cookie for all subsequent requests, use the following code:
"Logging in to Breeze" on page
parameter is missing or incorrect, the Breeze server returns a status
password
29.
.
account-id
login
67

Advertisement

Table of Contents
loading

Table of Contents