Establishing a connection to more than one web service
The actuate.initialize( ) function establishes a session with one Actuate BIRT Viewer Toolkit application service. Use the actuate.authenticate( ) function for additional sessions with other Actuate BIRT Viewer Toolkit application services. Call actuate.initialize( ) before calling actuate.authenticate( ).
Use authenticate( ) as shown in the following code:
actuate.authenticate(serviceurl, null, null, null, null, callback, errorcallback);
*serviceurl is a URL for the Actuate web application service in use. This URL must correspond to an Actuate BIRT Viewer Toolkit application.
*null specifies the default settings for the RequestOptions object that is provided by the connected Actuate BIRT Viewer Toolkit application. RequestOptions sets custom or additional URL parameters for the request. To use custom or additional URL parameters, construct an actuate.RequestOptions object, assign the specific values to the object, and put the object into the custom or additional URL parameter.
*The third and fourth parameters are reserved. Leave these parameters as null.
*null specifies no additional user credentials. This parameter holds information that supports external user credential verification mechanisms, such as LDAP. Add any required credential information with this parameter where additional security mechanisms exist for the application server upon which the web service is deployed.
*callback is a function to call after the authentication completes.
*errorcallback is a function to call when an exception occurs.
After authenticate( ) finishes, access resources from the Actuate BIRT Viewer Toolkit application service at the URL in serviceurl.
Application servers share session authentication information to enable a user to log in to one application context root and have authentication for another. For example, for Apache Tomcat, setting the crossContext parameter to "true" in the server.xml Context entries allows domains to share session information. The entries to share the authentication information from the web application with Actuate BIRT Viewer Toolkit look like the following example:
<Context path="/MyApplication" crossContext="true" />
<Context path="/BIRTViewerToolkit" crossContext="true" />