Using Alternate Languages with the BlackBerry Web Services for Enterprise Administration

by BlackBerry Development Advisor (Retired) on ‎05-27-2011 02:42 PM (5,973 Views)

Summary

This article applies to the following:

  • BlackBerry® Web Services for Enterprise Administrators
  • BlackBerry® Enterprise Server software version 5.0.3 or higher
  • Python version 2.7.0
  • SUDS version 0.4 (SOAP client for consuming web services)

Details

The BlackBerry Web Services for Enterprise Administrators has introduced a true SOAP interface for application developers to take advantage. The current officially supported languages and frameworks are Java® using Apache CXF™ and Microsoft® Visual Studio® .NET C#, but that doesn't mean that these are the only frameworks that will be able to communicate with this service. The great thing about Web Service interfaces is that they are open to any language that has a Web Service framework. 

 

Python

As a great example of how web services can be handled by other languages, the attached sample code written in Python is miniscule (~5KB). It relies on the SUDS SOAP client which has the benefit of not requiring stubs to be generated. Instead it builds the required framework of objects by parsing the WSDL on the fly.

 

Setup

In order to have this sample code run there are a few initial setup steps:

  1. Download and install Python version 2.7.0 
  2. Install SUDS using the Python Package Manager
    a) After Python is installed, open a command prompt
    b) Type the following command which will retrieve and install SUDS
         pypm install suds
  3. Make the following changes to the bws-getUsers.py file
    a) Change <Your_BAS_URL> to the actual URL of your BAS instance
    b) Change the values for USER and PASS to the username and password of the BAS authenticated account you wish to use

 

Run

To run this sample, simply open a command prompt to the directory the bws-getUsers.py file has been saved and run the following command:

     python bws-getUsers.py

 

All output will be displayed within the console.

 

 

If anyone would like to contribute simple samples written in other languages, please post them to the BlackBerry Enterprise Server Development board. Any usable samples written in new languages will be incorporated to this article if possible.