Generating a client proxy for the web services

The BlackBerry® Administration API includes several web services and each web service is associated with a WSDL definition. You can use a proxy generator to specify the web references for each WSDL definition and automatically generate the classes in your project. To make sure that you do not have multiple copies of the same data types in your project, you should generate a single client proxy using a command line proxy generator. Microsoft® Visual Studio® includes a compatible proxy generator called wsdl.exe, Apache CXF™ includes a proxy generator called wsdl2java, and JAX-WS RI includes a proxy generator called WSimport.

If you remove components from the BlackBerry® Enterprise Server, you can regenerate your client proxy to update your definitions and test your application to make sure that programming elements have not been removed. If you add components to the BlackBerry Enterprise Server, you can regenerate your client proxy to add any new programming elements to your development environment.

By default, not all proxy generators interpret the BlackBerry Administration API namespaces in the same way. For example, if you are working in Java® and you use the wsdl2java proxy generator included with Apache CXF, by default, the class DispatcherService.java uses the class path com.rim.com_rim_bes_basplugin_dispatcher instead of the path com.rim.bes.basplugin.dispatcher that the BlackBerry Administration API documentation and code samples use. Your proxy generator might include an option that you can use to manually specify how to interpret the namespaces.

You would typically generate the corews, utilws, and dispatcherws web services, and one of the email web services if you plan to use the messaging features. You should not generate the client proxy with multiple email web services. Only the corews web service is required.

Web service

Description

corews

This web service contains the main infrastructure of the BlackBerry Administration API, such as user and group management. This web service is required.

Web reference: https://<servername>/baaws/core/ws?wsdl

utilws

This web service contains utilities that can be useful for authentication and data encoding.

Web reference: https://<servername>/baaws/core/wsutil?wsdl

dispatcherws

This web service contains features that can manage wireless activation, and can start or stop services.

Web reference: https://<servername>/baaws/dispatcher/ws?wsdl

emailexchangews

This web service contains features related to messaging and the users' Microsoft® Exchange messaging accounts. You can use this web service if you use BlackBerry Enterprise Server for Microsoft Exchange and you plan to use the messaging features.

Web reference: https://<servername>/baaws/emailexchange/ws?wsdl

emaildominows

This web service contains features related to messaging and the users' IBM® Lotus® Domino® messaging accounts. You can use this web service if you use BlackBerry Enterprise Server for IBM Lotus Domino and you plan to use the messaging features.

Web reference: https://<servername>/baaws/emaildomino/ws?wsdl

emailgroupwisews

This web service contains features related to messaging and the users' Novell® GroupWise® messaging accounts. You can use this web service if you use BlackBerry Enterprise Server for Novell GroupWise and you plan to use the messaging features.

Web reference: https://<servername>/baaws/emailgroupwise/ws?wsdl

Example: Generating a client proxy in Microsoft Visual C#

The following command generates four web service definitions into a single proxy output file called proxy.cs. Each web reference is separated by a space character.
wsdl.exe /sharetypes /out:proxy.cs https://<servername>/baaws/core/ws?wsdl 
	https://<servername>/baaws/emailexchange/ws?wsdl 
	https://<servername>/baaws/core/wsutil?wsdl 
	https://<servername>/baaws/dispatcher/ws?wsdl

Example: Generating a client proxy in Java and Apache CXF

If you create the folder C:\Temp\proxy, the following four commands generate the programming elements from all four web service definitions into the folder. You can then add the folder to your project. By default, wsdl2java does not interpret the BlackBerry Administration API namespaces correctly, which means that your class paths do not match those shown in the documentation.
wsdl2java.bat -wv 1.1 -d -d C:\Temp\proxy https://<servername>/baaws/core/ws?wsdl
wsdl2java.bat -wv 1.1 -d -d C:\Temp\proxy https://<servername>/baaws/core/wsutil?wsdl
wsdl2java.bat -wv 1.1 -d -d C:\Temp\proxy https://<servername>/baaws/dispatcher/ws?wsdl
wsdl2java.bat -wv 1.1 -d -d C:\Temp\proxy https://<servername>/baaws/emailexchange/ws?wsdl
To make your class paths match those shown in the documentation, you can use the -p option to specify how wsdl2java.bat interprets each namespace. To do so, in a browser, open each WSDL definition file on your server (for example, visit https://<hostname>/baaws/dispatcher/ws?wsdl) and specify the path for each namespace listed at the beginning of the file as shown in the following command for the dispatcherws web service.
wsdl2java.bat -wv 1.1 -p http://www.rim.com/com.rim.bes.basplugin.emailcommon.dto=com.rim.bes.basplugin.emailcommon.dto -p http://www.rim.com/com.rim.bes.basplugin.dispatcher.dto=com.rim.bes.basplugin.dispatcher.dto -p http://www.rim.com/com.rim.bes.bas.dto=com.rim.bes.bas.dto -p http://www.rim.com/com.rim.bes.bas.baa.dispatcher.dto=com.rim.bes.bas.baa.dispatcher.dto -p  http://www.rim.com/com.rim.bes.bas.baa.common.dto=com.rim.bes.bas.baa.common.dto -d C:\Temp\proxy https://<servername>/baaws/dispatcher/ws?wsdl
 

Was this information helpful? Send us your comments.