Verifying your customized REST service call by using the Poster browser plug-in

In this lesson, you verify the customized REST calls to the sample data beans and controller commands with the Poster browser plug-in.

Procedure

  1. Create and display your requisition list in the storefront.
    1. Open the Aurora B2B starter store in a web browser. Go to https://localhost/webapp/wcs/stores/servlet/en/aurorab2besite.
    2. Click Sign In/Register and log in to the store as a Site Administrator.
      For example, wcsadmin.
    3. Click My Account to load the My Account page.
    4. On the left pane, click Requisition Lists tab under the Order section.
    5. On the right side, click Create List .
      A small window pane opens. Type in a name and select a type (Shared/private) to create a requisition list.
    6. Save your new data.
      A message window displays the successfully created requisition list. Close the prompt.
    7. Select a product under the Recommended section. Go to the Product Details page.
    8. Enter a quantity for the product. Click Add to Requisition List.
    9. Enter a name for the requisition list and save.
    10. Select continue and go back to the Requisition List Display page.

      If you have problems with this step, where the new requisition lists are not saved, clear your browser's cache and cookies. Then, try again.

    11. If necessary, create extra requisition lists to test.
    12. Go to the requisition lists page.
      The requisition lists page now shows the created requisition lists in the table:
      Requisition Lists
  2. Verify your customized REST service call by using the Poster browser plug-in.
    1. Launch poster for Firefox.
    2. Enter the following values, which signs in to the store as the Site Administrator (wcsadmin).
      Parameter Value
      URL https://localhost/wcs/resources/store/10202/loginidentity
      Content Type application/json
      Content Body
      
      {
      "logonId" : "wcsadmin","logonPassword" : "wcsadmin_pwd"
      }
      
      Where wcsadmin is the user ID of the Site Administrator and wcsadmin_pwd is the password of the Site Administrator.
      Use the following screen capture as a guide:
      Poster
    3. Click POST.
      A response window shows. Make note of the values for WCToken and WCTrustedToken for later use.
    4. In the URL field, enter your URL for the GET action to retrieve the data from the requisition list. Specify the custom profile that you created in the URL, since the IBM_Store_Summary profile is recognized by the RequisitionListHandler by default.
      For example, https://localhost/wcs/resources/store/10202/requisition_list?q=usable&profileName=MyCompany_Store_Summary.
    5. Click GET.
      The REST service retrieves the corresponding data. The response window with the corresponding information displays.
      For example, the following key sets of information must be available within the response window:
      
      {"recordSetTotal":2,"recordSetCount":2,"recordSetStartNumber":0,"recordSetCompleteIndicator":true,
      "resultList":[{"Owner":7000000000000000252,"userRegistration":{"middleName":"","lastName":"wcsadmin",
      "firstName":""},"status":"Z","lastUpdate":"2016-03-30T19:40:34.051000000Z","description":"David's list",
      "memberId":"-1000","totalTax":"0.00000","shipDate":"2016-03-30T19:48:45.662000000Z","organizationId":"-2001",
      "comment":null,"storeId":"10202","orderId":"12001"},{"Owner":7000000000000000252,"userRegistration":{"middleName":"","lastName":"wcsadmin","firstName":""},"status":"Z","lastUpdate":"2016-03-30T19:40:08.878000000Z",
      "description":"Jenny's list","memberId":"-1000","totalTax":"0.00000","shipDate":"2016-03-30T19:48:45.668000000Z",
      "organizationId":"-2001","comment":null,"storeId":"10202","orderId":"12002"}]}
      

      Review the results, noting the information is available within it for the first requisition list item. Extra data such as Owner, totalTax, and shipdate is also retrieved successfully.

    Next, customize the store widget to use the additional data.