Mapping the GetPurchaseOrder operation
- Open the Purchase Order Web Service you created in Creating the web service.
- Open the panel for the Get Operation called GetPurchaseOrder.
- Create the input mapping.
- Select Generated from the Data Source Type list under Input Mapping.
- Click Auto Map.
- Click OK to verify that you want to proceed with input mapping, and select the standard Get operation mapping option.
By default, the input map should contain two XML elements — ROOT and Request_ID. - Click the Request_ID element, and change the name to POID.
Your input mapping table should look similar to the one in the following figure. In the Qualification field, replace the qualification with this text:
'PO ID' = XPATH(/ROOT/POID)
Tip
You can type or paste the text, or you can use the Expression Editor to build the qualification. To open the Expression Editor, click the ellipsis button.
- Create the output mapping.
- Select XML Schema from the Data Source Type list under Output Mapping.
- Click Choose, and click OK to verify that you want to proceed with output mapping.
- In the Choose Start Element dialog box, select PurchaseOrder and click OK (see Mapping the CreatePurchaseOrder operation).
- Select the ROOT element in the XML Data Type column.
Note that ROOT is already mapped to the Purchase Order form. - Click Primary Key in the Mapping Info column.
- Click the ellipsis button to open the Field Selector (see Mapping the CreatePurchaseOrder operation).
- Select PO ID as your primary key, and click OK twice.
Map the fields from the Purchase Order form as follows:
XML elements and complex types
Form and fields
Primary Key field
ROOT
Purchase Order
PO ID
POID
PO ID
CompanyName
Company Name
Description
Description
PhoneNumber
Phone Number
- Under the Items element in the XML Data Type column, select the Item element.
- In the Form/Field column, click the empty table cell adjacent to the Item element.
- Click the ellipsis button, then select the Line Items form and click OK.
The Item element is now mapped to the Line Items form. - Click Distinguishing Key/Foreign Key in the Mapping Info column (see Mapping the CreatePurchaseOrder operation).
- Click the ellipsis button adjacent to the Distinguishing Key field.
Use the Field Selector to select the Item ID field, and click OK.
The AR System server does not allow the mapping of an integer as the distinguishing key during the consumption of a web service.
- In the same manner, specify a Foreign Key value of Line Item PO ID.
- Click OK to confirm your key selections.
Map the 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
PO ID
ItemName
Item Name
Quantity
Quantity
ItemID
Item ID
- In the Properties tab, assign Public permissions for the web service.
- Save the web service.
Comments
Log in or register to comment.