Mapping to complex documents
To map to complex documents
- In Developer Studio, open a web service for editing.
- Expand the WSDL Ports panel, the Port panel, and the WSDL Operations panel.
Click the operation you want to map, expanding the corresponding panel.
Tables for input and output mapping are displayed.AR Systemsets default mappings automatically when you create a web service or when you add an operation to a web service.
- Select the Data Source type for your mapping.
To have AR Systemautomatically generate a basic XML schema, set the Data Source Type to Generated, click the Auto Map button, and skip to step f.
You cannot use Developer Studioto modify XML elements in an external XML schema. To modify XML elements in an external schema, edit the XML schema file directly.
If you are using an external XML schema, set the Data Source Type to XML Schema.
The XML Schema option is available only if you specify a file name in the XML Schema panel, and the file has been loaded.
- Select Support XSI Type, if necessary.
If this option is selected, the system specifies XSI Type for all XML data while creating XML documents. - Click Choose, then click OK to verify that you want to change the mapping.
The Choose Start Element dialog box appears, displaying complex types and elements. - Select your start element or complex type. For more information, see Importing an external XML schema.
Verify that your XML elements and complex types are displayed in the XML Data Type column and that the parent form and fields are displayed in the Form/Field column as shown in the following figure.
- Review the mappings, and make any necessary adjustments to forms, fields, and elements in your XML schema.
To replace a form or field in the Form/Field column, select the object and click the adjacent ellipsis button (...). - Add child forms to the list of mapped objects.
- Right-click the ROOT element in the XML Data Type column.
- Select New > Element > Form.
- Rename the new form element that appears under ROOT.
- Click the corresponding (blank) field in the Form/Field column.
- Click the ellipsis button (...), and select a form for mapping to your new form element.
- In the row where your parent form is mapped, click the field in the Mapping Info column.
The parent form is typically mapped to the ROOT element.
The Primary Key selector appears. - Click the ellipsis button (...) and select a field to use as the primary key.
This is the field that uniquely identifies the entries in the specified form. It is typically the Request ID field. The list of primary keys is limited to character fields specified as unique in Form > Form Properties > Indexes. - Click OK to close the Primary Key dialog box.
Map any other fields in the parent form to elements in the XML schema.
When you create a filter to consume a web service, the output mapping table does not allow you to select fields that only the system can modify. You must map to the same data types. If you hover the cursor over the XML element name or field name, the tooltip shows the data type. For more information, see Automatically-mapping-XML-elements.
- In the row where one of your child forms is mapped, click the field in the Mapping Info column.
The Distinguishing Key and Foreign Key selectors appear. Click the ellipsis button (...), and select a value for Distinguishing Key.
This is the value that uniquely identifies each of the detail items in the child form of any given parent entry.The AR System server does not allow the mapping of an integer as the distinguishing key during the consumption of a web service.
- Click the ellipsis button (...) and select a value for Foreign Key.
The combination of distinguishing key and foreign key should uniquely identify an entry in a child form. Developer Studiodoes not enforce this relationship, but the AR System serverreturns an error if it detects noncompliance.
A field specified as a foreign key should not be used in any field mapping, because the system uses this field to store the foreign key. If it is mapped, the value of the mapped XML element is usually overridden by the foreign key value. - Map any other fields in the child form to XML elements.
- Save your web service. For more information, see Supported-schema-constructs-and-web-service-limitations.
The topics listed in the following table describe how the XML schema maps to interrelated forms and how the SET, GET, and Push Field actions work for complex documents:
Action | Reference |
---|---|
Learn how the XML schema is mapped in complex documents | |
Learn how the SET operation works in complex documents | |
Learn how the GET operation works in complex documents | |
Learn how the Push Fields action works in complex documents while publishing and consuming web services |