Deploying and Managing Apama Applications > The Apama Web Services Client Adapter > Mapping Web Service message parameters > Combining convention and template mapping
Combining convention and template mapping
You can combine the convention-based and template-based mapping approaches. In this case, you supply an XML template file and you also use the adapter to automatically convert one or more event fields (of event or sequence type) to XML. The value of one or more converted fields supplies the value for a variable in the template file.
To use the combined mapping approach:
1. In the adapter editor's Event Mappings tab, right-click the operation's parameters entry and select Assign Template. The Assign Template dialog appears.
2. In the Assign Template dialog's XML Template file field, enter the name of the template file you want to use or use the Browse and Down Arrow buttons to locate the file.
When you specify a template file, the contents of the file are added to the text field in the dialog.
3. Edit the template file to create at least one variable that will get its value from a field in the input event. For example, suppose you are working with the WSRequest and WSResponse messages described in Convention-based Web Service message mapping example. You might edit the template to create a variable that will get its value from Leaf elements.
Remember that you must write or have previously written the template file.
4. Edit the template as needed and click OK.
The Operation hierarchical tree is re-displayed showing the various elements and attributes that are defined in the template, including any variables.
5. In the Event hierarchical tree, right-click the Apama event field that contains a field you want to map to a variable and click Convert Into XML. For example:
6. Right-click an event field in the converted field drag a line from that field to the template variable element in the Operation tree. The event field you select provides the value for the target variable. For example, map the converted Leaf sequence to the Leaf variable:
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.