MACROMEDIA BREEZE-USING THE BREEZE XML WEB SERVICES Use Manual page 51

Using the breeze xml web services
Table of Contents

Advertisement

URL loginUrl = new URL(baseUrl + "api/xml?accesskey=" + accessKey +
"&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 cookie for all subsequent requests, use the following code:
URLConnection conn= url.openConnection();
conn.setRequestProperty("Cookie", "BREEZESESSION=" + cookie);
conn.connect();
Parameters
The access key for your account.
accesskey
Note: The
accesskey
include this parameter in Breeze 4.1, it is ignored.
The ID of the account that the user is associated with. This parameter is optional.
account-id
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
.
"no-data"
Filters
Results cannot be filtered or sorted.
Returned elements
None.
Sample results
<results>
<status code="ok" />
</results>
parameter is required only in Breeze 4.0; it is not required for Breeze 4.1. If you
is missing or incorrect, the Breeze server returns a status code of
password
.
account-id
login
51

Advertisement

Table of Contents
loading

This manual is also suitable for:

Breeze

Table of Contents