This article applies to the following:
- BlackBerry® Administration application programming interface (API)
- BlackBerry® Enterprise Server software version 5.0
- BlackBerry devices
- Microsoft® Internet Information Services (IIS)
- Microsoft® .NET Framework
- Apache CXF™
- Apache Tomcat™
With BlackBerry Enterprise Server software version 5.0, common administrative tasks for the BlackBerry Enterprise Server can now be executed through secure web service calls using the BlackBerry Administration API. With the use of the BlackBerry Administration API, you can also create front-end web applications that can be accessed from various browsers including the BlackBerry® Browser.
The attached sample application shows how to extend the BlackBerry Administration API to a web interface. This allows BlackBerry device users to complete BlackBerry Enterprise Server administrative tasks that would typically have to be done by a BlackBerry Enterprise Server administrator, from their BlackBerry devices. In the example, a BlackBerry smartphone user can browse to the web application that will read their personal identification number (PIN) from the Hypertext Transfer Protocol (HTTP) request headers. A list of applications is then provided; this list is based on the Software Configuration policies assigned to the BlackBerry device user. From the applications list, the BlackBerry device user can select applications they would like pushed to their BlackBerry device.
Note: The web site hosting this application must be able to connect to the BlackBerry Administration Service to execute the web service calls.
The following steps must be completed before accessing the web interface:
Microsoft Visual C#
The sample application was tested using Microsoft IIS 5.1 and Microsoft® ASP.NET 2.0.50727.
- Install the certificate for the BlackBerry Administration Service by completing the following steps:
- From your Internet browser, browse to the BlackBerry Administration Service web console at https://BAS_URL/webconsole/app.
- Install the certificate by going to File > Properties. Click the Certificates, and then complete the steps in the wizard.
- Modify the attached sample application to point the BAS_URL in your environment, and then apply the necessary credential information. This can be done by completing one of the following tasks:
- Manually change the values in the included Web.Config file.
- From the Microsoft® Visual Studio® toolbar select Website > ASP. NET Configurations. A web site appears. Select Application Configuration > Manage application settings, and then edit the necessary values.
- Build and publish the application to a Microsoft IIS server in your environment.
Note: If using an earlier version of BES then it will be necessary to create your own proxy library. The PDF in this download explains how this can be done.
- Retrieve the certificate for the BlackBerry Administration Service by completing the following steps:
- Browse to you rBAS web console in internet Explorer (https://<BAS_URL>/webconsole/app)
- Install the Certificate: File>Properties > Certificates (button) > follow the wizard instructions to install the certificate.
- Download the Certificate: File > Properties > Certificates (button) > Details (tab) > Copy to File… (button). Leave as default DER encoded and save to the lib\security directory of the currently active JRE version (save as BEScert.cer)
Generate a certificate key store and import the downloaded certificate to this key store:
- Open a command prompt in the lib\security directory of the currently active JRE version
- Run the following command to generate the keystore:
keytool -genkey -alias BESks -keystore BESks
- Import the saved key by running the command:
keytool -keystore BESks -import –file BEScert.cer
Import the ‘BAAOptionalApps_Java’ sample to your development environment (Eclipse etc) then modify the various fields in the BAAConstants.java class for your environment:
- LogFile – The path and filename used for logging
- Level.FINE – The level of logging desired
- BASUrl – The URL of the BAS instance being used
- BASUserName – The BAS username to be used for authentication
- BASUserPassword - The password for the above username
- TrustStore - The full path of the keystore (created above)
- Add all Apache CXF library files to the WebContent > WEB-INF > lib directory.
- Reference the proxyOA and all Apache CXF JAR files from the project Build Path.
- Compile then test.
- Export the WAR file to the “<Tomcat_Instance>\webapps” directory then start Tomcat
Note: The BlackBerry® Mobile Data System (BlackBerry MDS) must be configured to include the BlackBerry smartphone PINs in the HTTP headers. For more information, see this article.
After completing the previous steps, the web interface can be accessed using the BlackBerry Browser and selected applications can be pushed and installed on the BlackBerry smartphone.
Sample version Framework Used Same application Microsoft Visual C# Microsoft .NET Framework 2.0.50727 C# Sample Java Apache CXF 2.2.4 Java Sample