Sample application demonstrating BlackBerry Administration API technology

by Retired on ‎02-18-2010 03:43 PM - edited on ‎01-07-2011 01:57 PM by Retired (8,180 Views)


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.

  1. Install the certificate for the BlackBerry Administration Service by completing the following steps:
    1. From your Internet browser, browse to the BlackBerry Administration Service web console at https://BAS_URL/webconsole/app.
    2. Install the certificate by going to File > Properties. Click the Certificates, and then complete the steps in the wizard.
  2. 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:
    1. Manually change the values in the included Web.Config file.
    2. 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.
  3. Build and publish the application to a Microsoft IIS server in your environment.


 The sample application was tested and created using Apache CXF 2.2.4Apache Tomcat 6.0, BES 5.0.2, Java SDK (required, version 1.6.0 update 20 used).


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.


  1. Retrieve the certificate for the BlackBerry Administration Service by completing the following steps:
    1. Browse to you rBAS web console in internet Explorer (https://<BAS_URL>/webconsole/app)
    2. Install the Certificate: File>Properties > Certificates (button) > follow the wizard instructions to install the certificate.
    3. 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)
  2. Generate a certificate key store and import the downloaded certificate to this key store:

    1. Open a command prompt in the lib\security directory of the currently active JRE version
    2. Run the following command to generate the keystore:
      keytool -genkey -alias BESks -keystore BESks
    3. Import the saved key by running the command:
      keytool -keystore BESks -import –file BEScert.cer
  3. Import the ‘BAAOptionalApps_Java’ sample to your development environment (Eclipse etc) then modify the various fields in the class for your environment:

    1. LogFile – The path and filename used for logging
    2. Level.FINE – The level of logging desired
    3. BASUrl – The URL of the BAS instance being used
    4. BASUserName – The BAS username to be used for authentication
    5. BASUserPassword  - The password for the above username
    6. TrustStore  - The full path of the keystore (created above)
  4. Add all Apache CXF library files to the WebContent > WEB-INF > lib directory.
  5. Reference the proxyOA and all Apache CXF JAR files from the project Build Path.
  6. Compile then test.
  7. 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