Creating a filter with input and output mappings
The topic describes the procedures for creating a Set Fields filter with input and output mappings to get a purchase order and a line item record.
To create the filter
- Select File > New > Filter.
- Select the server on which you want to create the filter, and click Finish.
- Right-click the Associated Forms panel, and select Expand All Panels.
- In the Associated Forms panel, click the Add button (see the "Stock Quote filter — Associated Forms and Execution Options panels" figure (Example of consuming a simple flat document)).
- In the Form Selector dialog box, select the Purchase Order Client form to use as the base form, and click OK.
- From the State list, select Enabled.
- In the Execution Order field, enter the execution order for the filter, or accept the default value.
- In the Execution Options panel, select Submit.
- Right-click the If Actions panel, select Add Action, and select Set Fields.
A new panel appears, where you configure the Set Fields action. - From the Data Source list, select WEB SERVICE.
- From the Server Name list, select the server on which to store the web service mappings as a server object.
In the WSDL field, enter the path or browse to your WSDL file.
In this scenario, your URL might look like this:http://TestServer/arsys/WSDL/public/TestServer/Purchase Order Web Service
You can also enter a path to a local WSDL file, for example:
C:\Temp\Purchase Order Web Service.wsdl
- Click Reload.
- If prompted, enter the user name and password required by the remote web server for basic authentication.
- From the Port list, select the port for the web service.
- From the Operation list, select the getPurchaseOrder operation.
The menu is automatically populated with the available operations for the web service.
To create the input mappings in the filter
- In the Input Mapping table, select the ROOT element in the XML Data Type column.
Note that ROOT is already mapped to the Purchase Order Client. - Click Primary Key in the Mapping Info column.
- Click the ellipsis button to open the Field Selector (see Mapping the GetPurchaseOrder operation).
- Select PO ID as your primary key, and click OK twice.
- Select the POID element in the XML Data Type column.
- Click the adjacent cell in the Forms/Field column, and click the ellipsis button.
- Select the PO ID field and click OK.
Your input mapping should look similar to the one in Purchase Order Client filter — Set Fields action. - Select File > Save, and name your filter Purchase Order Client Filter.
To create the output mappings in the filter
- Select the ROOT element in the XML Data Type column.
Note that ROOT is already mapped to the Purchase Order Client form. - Click Primary Key in the Mapping Info column.
- Click the ellipsis button to open the Field Selector (see Mapping the GetPurchaseOrder operation).
- Select PO ID as your primary key, and click OK twice.
Map the fields from the Purchase Order Client form as follows, referring to Purchase Order Client filter — Set Fields action:
XML elements and complex types
Form and fields
Primary Key field
ROOT
Purchase Order Client
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 next to the Item element.
- Click the ellipsis button, and select the Line Items Client form and click OK.
The Item element is now mapped to the Line Items Client form, as shown in Purchase Order Client filter — Set Fields action. - 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, referring to Mapping the GetPurchaseOrder operation:
XML elements and complex types
Form and fields
Distinguishing Key field
Foreign Key field
ROOT/Items/Item
Line Items Client
Item ID
PO ID
ItemName
Item Name
Quantity
Quantity
ItemID
Item ID
Your output mapping should look similar to the one in Purchase Order Client filter — Set Fields action.
- Save your changes to the filter.
Comments
Log in or register to comment.