Add the corews web service to your client proxy

The corews web service is a required web service. By default, the wsdl2java proxy generator does not interpret the BlackBerry® Administration API namespaces as intended. If you use the default namespaces, the proxy generator stores your BlackBerry Administration API packages in a flat file structure inside a com/rim/ folder. For example, a class in the com.rim.bes.basplugin.dispatcher package is stored in the client proxy as com/rim/com_rim_bes_basplugin_dispatcher instead of com/rim/bes/basplugin/dispatcher. You can use the default namespaces, but you must manually change the package names in any code samples, or you can change the package names manually by using Eclipse®. You can define the namespaces, which can be time consuming, but if you save the commands for future reference, you can save time when you generate the client proxy again.
Before you begin:

Create a temporary folder in which to generate the client proxy (for example, C:\Temp\BAA\proxy).

  1. At the Windows® command prompt, navigate to the bin folder of Apache CXF™.
    cd C:\Program Files\apache-cxf-2.1.2\bin\
  2. Perform one of the following tasks to invoke the wsdl2java proxy generator:

    Task

    Steps

    Use the default namespaces.

    1. In the bin folder, invoke wsdl2java.bat.
      wsdl2java.bat -wv 1.1 -d C:\Temp\BAA\proxy https://<servername>/baaws/core/ws?wsdl
    2. In any code samples that you use, change the package names so that they match the generated package names.

    Use the default namespaces and change them manually by using Eclipse.

    1. In the bin folder, invoke wsdl2java.bat.
      wsdl2java.bat -wv 1.1 -d C:\Temp\BAA\proxy https://<servername>/baaws/core/ws?wsdl
    2. Add the com folder from the client proxy to a source folder in an Eclipse project.
    3. In the Package Explorer window, right-click a package name, and click Refactor > Rename.
    4. Type the correct package name and click OK.
    5. Repeat steps 3 and 4 for each package name that contains an underscore character.

    Define the namespaces for the proxy generator.

    1. Type the following line into a text editor:
      wsdl2java.bat -wv 1.1 -d C:\Temp\BAA\proxy https://<servername>/baaws/core/ws?wsdl
    2. To view the WSDL file for the corews web service, in a browser, visit https://<servername>/baaws/core/ws?wsdl.
    3. At the beginning of the WSDL file, for each xml namespace, copy the package name. For example, in xmlns:ns1="http://www.rim.com/com.rim.bes.example.dto", the package name is com.rim.bes.example.dto.
    4. Add the following parameter to the command in your text editor for each XML namespace: -p http://www.rim.com/<package>=<package>.
      wsdl2java.bat -wv 1.1 -p http://www.rim.com/com.rim.bes.example.dto=
      com.rim.bes.example.dto -d C:\Temp\BAA\proxy https://<servername>/baaws/core/ws?wsdl
    5. After you add a -p parameter for each namespace, copy the command from your text editor into your command prompt and invoke the command.
    6. Expand the C:\Temp\BAA\proxy\com\rim folder.
    7. If your client proxy folder contains any namespaces that contain an underscore character, for example com_rim_bes_bas, delete the folder C:\Temp\BAA\proxy\com, define the namespaces in your command correctly, and invoke wsdl2java again. Also re-add any other web services that you added before you deleted C:\Temp\BAA\proxy\com.
    8. Save the command in the text editor. You might need to use it again.

Example: Defining the corews namespaces

The following one-line command adds the client proxy files for the corews web service to the C:\Temp\BAA\proxy folder. Your server might contain more namespaces or fewer namespaces.
wsdl2java.bat -wv 1.1 -p http://www.rim.com/com.rim.bes.basplugin.synchronization.dto=com.rim.bes.example.dto 
-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.basplugin.controller.dto=com.rim.bes.basplugin.controller.dto
-p http://www.rim.com/com.rim.bes.basplugin.collaboration.dto=com.rim.bes.basplugin.collaboration.dto
-p http://www.rim.com/com.rim.bes.basplugin.bas.dto=com.rim.bes.basplugin.bas.dto
-p http://www.rim.com/com.rim.bes.basplugin.attachment.dto=com.rim.bes.basplugin.attachment.dto
-p http://www.rim.com/com.rim.bes.basplugin.ascendent.dto=com.rim.bes.basplugin.ascendent.dto
-p http://www.rim.com/com.rim.bes.basplugin.alert.dto=com.rim.bes.basplugin.alert.dto
-p http://www.rim.com/com.rim.bes.basplugin.activedirectory.dto=com.rim.bes.basplugin.activedirectory.dto
-p http://www.rim.com/com.rim.bes.bas.dto=com.rim.bes.bas.dto
-p http://www.rim.com/com.rim.bes.basplugin.sip.dto=com.rim.bes.basplugin.sip.dto
-p http://www.rim.com/com.rim.bes.bas.baa.dto=com.rim.bes.bas.baa.dto
-p http://www.rim.com/com.rim.bes.bas.baa.common.dto=com.rim.bes.bas.baa.common.dto
-p http://www.rim.com/com.rim.bes.basplugin.router.dto=com.rim.bes.basplugin.router.dto
-p http://www.rim.com/com.rim.bes.basplugin.proxysettingscommon.dto=com.rim.bes.basplugin.proxysettingscommon.dto
-p http://www.rim.com/com.rim.bes.basplugin.policy.dto=com.rim.bes.basplugin.policy.dto
-p http://www.rim.com/com.rim.bes.basplugin.mdss.dto=com.rim.bes.basplugin.mdss.dto
-p http://www.rim.com/com.rim.bes.basplugin.mdscs.dto=com.rim.bes.basplugin.mdscs.dto
-p http://www.rim.com/com.rim.bes.basplugin.logging.dto=com.rim.bes.basplugin.logging.dto
-p http://www.rim.com/com.rim.bes.basplugin.emailexchange.dto=com.rim.bes.basplugin.emailexchange.dto
-p http://www.rim.com/com.rim.bes.bas.baa=com.rim.bes.bas.baa
-d C:\Temp\BAA\proxy https://<servername>/baaws/core/ws?wsdl

Was this information helpful? Send us your comments.