Exercise 6: Testing the Application with the Local Windows Azure WCF Service

In this exercise, you will test the Windows Phone 7 application.

Task 1 – Testing the Application with the PartsInventoryEnhanced SQL Azure Database

In this task, you will test the Windows Phone 7 application with the PartsInventoryEnhanced SQL Azure database deployed to the cloud and the PartsServiceEnhances Windows Azure WCF Service running in the local AppFabric simulation environment.

  1. In the WP7.Cloud.PartsClient solution, select Windows Phone 7 Emulator in the deployment location dropdown list.
  2. In the WP7.Clioud.PartsClient solution, press F5.
  3. The Windows Phone 7 application starts in the emulator and displays the items from the Maintenance Requests SharePoint list.

    Figure 18

    Maintenance Requests in the application

  4. Click the Fix the leaking boiler maintenance request in the list to select it.

    The Windows Phone 7 application displays the details for the selected maintenance request from the SharePoint list, as well as the replacements part stock levels for the company warehouses from the PartsInventoryEnhanced SQL Azure database.

    Notice the inventory level for the Denver warehouse is 0 and the Order pending status is No. In this scenario, the user contacts the vendor for the part and places an order to restock the Denver warehouse. After the user places the order, they update the database to indicate the order was placed.

    Figure 19

    Maintenance Request details

  5. Click the Part Ordered button next to the Denver warehouse.

    The Windows Phone 7 application calls the local PartsServiceEnhanced Windows Azure WCF Service, which in turn updates the database to indicate an order was made to restock the Denver warehouse. Then, the Order Pending Status in the Windows Phone 7 application is updated.

    Figure 20

    Parts Order status

  6. Return to Microsoft SQL Server 2008 R2 RTM - Management Studio Express.
  7. In the Object Explorer pane, expand the Databases folder and highlight the PartsInventoryEnhanced database. If you cannot see the PartsInventoryEnhanced database, highlight the Databases folder and click the refresh button in the Object Explorer toolbar.
  8. With the PartsInventoryEnhanced database highlighted, click the New Query button in the toolbar.
  9. Paste the following SQL commands into the query window. These commands query the Parts table.

    TSQL

    SELECT * FROM [Parts] GO

  10. Click Execute on the toolbar. Notice the OrderPending column for the corresponding inventory item in the Denver warehouse is updated.

    Figure 21

    Parts order status updated