BlackBerry
Skip Top Navigation
Developers Partners
North America [change region] Products Solutions Purchasing Support
Developers


Optimize Wireless Bandwidth Using Message Binding

Exercise

In this lab, you learn how to optimize your bottom-up application using the message binding wizard. By binding less data to the response message, the web service uses less wireless bandwidth.

Objectives

  • Discover how to optimize your bottom-up application using the message binding wizard.
  • See how the web service uses less wireless bandwidth.

Setup Tasks

Open BlackBerry MDS Studio™ and select the LengthConverter project which you created in the previous labs. See the labs entitled Creating a Bottom-up BlackBerry MDS Studio Project, Design the Main Screen and User Interface and Create communication between the user interface and the length conversion web service for more details.

If you have not completed the first three labs in this series, create the LengthConverter project following these steps:

  1. Download the LengthConverter workspace (ZIP) and unzip the file
  2. Import the LengthConverter workspace to BlackBerry MDS Studio
    Click File menu -> Import Existing… -> Browse - > select LengthConverter -> Finish

Tasks

Remove a field from the response message

  1. In the Navigator pane, double-click the convertLengthResponse message.
  2. Click the Fields tab.
  3. Click the first Data Mapping cell.
  4. Click ....
  5. Clear the Is Mapped check box.
  6. Click OK.

Change the data type that the response message uses

  1. In the Type cell, click ....
  2. Click decimal.
  3. Click Next.
  4. Click OK.

Assign the response message to the converted length value in the web service

  1. In the Navigator pane, expand Messages.
  2. Right-click convertLengthResponse.
  3. Click Message Binding Wizard.
  4. Click Next.
  5. Click the convertLengthResponse output message.
  6. Click Next.
  7. In the list of BlackBerry MDS Application message fields in the left pane, click the convertLengthReturn: decimal field.
  8. In the list of WSDL message fields in the right pane, click the toValue: double field.
  9. Click Bind Field.
  10. Click Finish.

Note: The length converter web service no longer incorporates the other WSDL message fields in the response message.

Change the global variable to match the response message data type

  1. In the Navigator pane, expand Data > Globals.
  2. Double-click result.
  3. Click the drop-down arrow beside the Data Type field.
  4. Click decimal.
  5. Click OK.

Note: After changing the global variable data type, controls and messages previously mapped to it must be reassigned.

Assign the global variable to the edit box to display the converted length

  1. In the Navigator pane, double-click scrMain.
  2. Click the Result edit box.
  3. In the Properties pane, in the Initial Value property, click ....
  4. Expand Globals.
  5. Click result: decimal.
  6. Click Apply.
  7. Click OK.

Assign the response message data to the result global variable

  1. In the Navigator pane, double-click the convertLengthResponse message.
  2. In the Message Editor, click the Fields tab.
  3. In the Data Mapping cell, click ....
  4. Select the Is Mapped check box.
  5. Click the result global variable.
  6. Click OK.

Remove the Result data component

  1. In the Navigator pane, expand Definitions.
  2. Right-click Result.
  3. Click Delete.
  4. Click Yes.
  5. Click OK.

Save the project

  1. In Navigator pane, click the LengthConverter project.
  2. On the toolbar, click Save.

Additional Labs

Go to the first exercise in “Creating a Length Conversion Application Using the Top-down Approach”, Create a Contact Using the Top-down Approach.

Back to the Developer Lab Main Menu

 
Other Resources
 
     
 Home | Products | Solutions | Purchasing | Support | Developers | Worldwide | News | About Us | Contact Us | Site Map
 Legal | Copyright © 2008 Research In Motion Limited, unless otherwise noted.