login
51
URL loginUrl = new URL(b "api/xml?accesskey=" + acc
"&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
accesskey
The access key for your account.
Note:
The
accesskey
parameter is required only in Breeze 4.0; it is not required for Breeze 4.1. If you
include this parameter in Breeze 4.1, it is ignored.
account-id
The ID of the account that the user is associated with. This parameter is optional.
If your organization has only one account, don’t specify an
account-id
.
login
The user’s login name, which is usually the user’s e-mail address.
password
The
user’s
password.
Note:
If the
login
or
password
is missing or incorrect, the Breeze server returns a status code of
"no-data"
.
Filters
Results cannot be filtered or sorted.
Returned elements
None.
Sample results
<results>
<status code="ok" />
</results>
Содержание BREEZE-USING THE BREEZE XML WEB SERVICES
Страница 1: ...Using the Breeze XML Web Services...
Страница 8: ...8 Contents...
Страница 12: ...12 Introduction Before You Begin...
Страница 26: ...26 Chapter 2 Working with Filters...
Страница 36: ...36 Chapter 3 Common Tasks...
Страница 112: ...112 Chapter 4 Action Reference...
Страница 186: ...186 Chapter 5 XML Results Reference...
Страница 196: ...196 Index...