Create the check-inventory-by-location web service operation

This is a BASIC subroutine web service that takes a dynamic array containing multivalue Item-IDs and location codes for the first argument and in the second argument, returns a dynamic array containing multivalue inventory information.

About this task

In this example, a subroutine is selected, the argument bindings to dynamic-array are set, and then the dynamic array layouts are defined.

Procedure

  1. Right-click the mvs Web Service from the MV Web Service Explorer and select the Create Web Service Operation option.

    The Create a Web Service Operation dialog box opens.

  2. Select localserver from the Database Connection drop-down, and then click Connect to display the list of accounts.
  3. Select the MVDEMO account from the Account drop-down, and then click Next.

    The Select a Web Service Operation Type dialog box opens.

  4. Select the Cataloged Subroutine option, and then click Next.

    The Construct the Cataloged Subroutine dialog box opens.

  5. Type check-inventory-by-location in the Operation Name text box and type CHECK.INVENTORY.BY.LOCATION in the Subroutine drop-down.

    Note that this subroutine has two arguments. The first argument is the REQUEST input and the second argument is the RESPONSE output.

    In this example, you need to change the arguments binding and type from simple/string to dynamic-array.

  6. Select the REQUEST argument (Argument 1) from the list of arguments, and then click Edit.

    The Argument Definition dialog box opens.

  7. Complete the following steps:
    1. Select dynamic-array from the Binding Mode drop-down.
    2. Type inventory.request in the Dynamic Array Name text box.
    3. Click OK.
  8. Select the RESPONSE argument (Argument 2) from the list of arguments, and then click Edit.
  9. Complete the following steps:
    1. Select dynamic-array from the Binding Mode drop-down.
    2. Type inventory.response in the Dynamic Array Name text box.
    3. Click OK.
  10. After changing the argument settings, click Finish to create the Web Service Operation.

    Now you can define the inventory.request and inventory.response dynamic arrays.

  11. Click the arrow icon next to the check-inventory-by-location Operation from the MV Web Server Explorer
    You will see the two dynamic arrays (inventory.request and inventory.response).
  12. Right-click the inventory.request dynamic array and select the Edit Dynamic Array option.

    You will see the inventory.request dynamic array in the Editor panel.

  13. Define the inventory.request dynamic array, as shown in the following graphic:
  14. Click the Save icon to save the definition.
    Now you can define the inventory.response dynamic array.

    See Define a dynamic array on a cataloged subroutine for more information on defining a dynamic array from the Editor panel.

  15. Right-click the inventory.response dynamic array from the MV Web Server Explorer and select the Edit Dynamic Array option.

    You will see the inventory.response dynamic array in the Editor panel.

  16. Define the inventory.response dynamic array, as shown in the following graphic:
  17. Click the Save icon to save the definition.