To synchronize Breeze with the directory service:
Log in by calling the
1.
of an account administrator. Examine the returned HTTP headers to find the value of the
BREEZESESSION cookie, which you need when calling subsequent actions.
Note: Consider creating an administrative user specifically for performing synchronizations. If you
create such a user, you should exclude it from the list of users to synchronize when you perform the
synchronization.
The following code example logs in a user and obtains the cookie value:
<cfset login="john@example.com">
<cfset password="abcdefg">
<cfset accesskey="0123456789101112">
<cfset baseurl="http://breeze.example.com/">
<cfset params="accesskey=#accesskey#&action=login&login=#login#&password=
#password#">
<cfhttp url="#baseurl#api/xml?#params#" method="get">
<cfset loginHeaders= "#cfhttp.ResponseHeader#" />
<cfloop collection="#loginHeaders#" item="httpHeader">
<cfif httpHeader eq "Set-Cookie">
<cfset value= loginHeaders[httpHeader] />
<cfset cookieHeader="#value[1]#" />
<cfloop list="#cookieHeader#" index="c" delimiters=";">
<cfset cookieName= Left(c, Find('=', c)-1) />
<cfif cookieName eq "BREEZESESSION">
<cfset fullCookie= mid(c, len(cookieName)+2,
len(c)-len(cookieName)+1) />
<cfset loginCookie= Left(fullCookie, Find('.', fullCookie)-1) />
</cfif>
</cfloop>
</cfif>
</cfloop>
Check that the
2.
login
examining the value of the
what the error was and handle it appropriately.
<cfset xml= XmlParse(cfhttp.FileContent)>
<cfset resultsElement= XmlSearch(xml, "//status[@code='ok']")>
<cfif ArrayLen(resultsElement) ne 1>
<!--- No status code "ok" found. Check for other status codes and handle
errors. --->
</cfif>
action on the Breeze server, specifying the login name and password
login
action completed successfully by parsing the returned XML and
tag's
status
code
attribute. If the status code isn't
Integrating Breeze with a directory service
, determine
"ok"
29
Need help?
Do you have a question about the BREEZE-USING THE BREEZE XML WEB SERVICES and is the answer not in the manual?
Questions and answers