Default language.

Mapping the CreatePurchaseOrder operation


  1. Open the Purchase Order Web Service you created in Creating-the-web-service.
  2. Open the panel for the Create Operation called CreatePurchaseOrder.
  3. Create the input mapping.
    1. Select XML Schema from the Data Source Type list under Input Mapping.
    2. Click Choose, and then click OK to verify that you want to proceed with input mapping.
    3. In the Choose Start Element dialog box, select PurchaseOrder and click OK.

      web_services_examples_xmlstart.gif
    4. Select the ROOT element in the XML Data Type column.
       Note that ROOT is already mapped to the Purchase Order form.

      web_services_examples_createpo_map.gif
    5. Click Primary Key in the Mapping Info column.
    6. Click the ellipsis button to open the Field Selector.

      web_services_examples_po_map_pkey.gif
    7. Select PO ID as your primary key, and click OK twice.
    8. Map the fields from the Purchase Order form as follows:

      XML elements and complex types

      Form and fields

      Primary Key field

      ROOT (PurchaseOrder)

      Purchase Order

      PO ID

      POID

      PO ID

       

      CompanyName

      Company Name

       

      Description

      Description

       

      PhoneNumber

      Phone Number

       

    9. Under the Items element in the XML Data Type column, select the Item element.
    10. In the Form/Field column, click the empty table cell adjacent to the Item element.
    11. Click the ellipsis button, and select the Line Items form and click OK.
       The Item element is now mapped to the Line Items form.
    12. Click Distinguishing Key/Foreign Key in the Mapping Info column.

      web_services_examples_po_map_dfkeys.gif
    13. Click the ellipsis button next to the Distinguishing Key field.
    14. Use the Field Selector to select the Item ID field, and click OK.

      Thedoes not allow the mapping of an integer as the distinguishing key during the consumption of a web service.

    15. In the same manner, specify a Foreign Key value of Line Item PO ID.
    16. Click OK to confirm your key selections.
    17. Map the other fields from the Line Items form as follows:

      XML elements and complex types

      Form and fields

      Distinguishing Key field

      Foreign Key field

      ROOT/Items/Item

      Line Items

      Item ID

      Line Item PO ID

      ItemName

      Item Name

       

       

      Quantity

      Quantity

       

       

      ItemID

      Item ID

       

       

  4. Create the output mapping.
    1. Select Generated from the Data Source Type list.
    2. Click Auto Map, and click OK to verify that you want to proceed with output mapping.
       The ROOT element in the XML Data Type column is mapped to the Purchase Order form.
    3. In the Mapping Info column, change the Primary Key to PO ID.
    4. Verify that the Request ID element is mapped to the Request ID field.
       Your output mapping table should look similar to the one in step 3d.
  5. In the Properties tab, assign Public permissions for the web service.
  6. Click File > Save.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*