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)
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.
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.
In order to have this sample code run there are a few initial setup steps:
- Download and install Python version 2.7.0
- 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
- 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
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:
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.