In the XML Mapping Utility, you can specify JavaScript code for performing tasks related to data service calls. For outbound mappings, the code is executed when the service call is made. For inbound mappings, the code is executed after the response is received. To associate JavaScript code with a data service call, type the code in the Path/Value column in the Mappings table of the XML Mapping Utility and set the Type value to Script. In this context, the execution context is an instance of the jsx3.net.Service class. In the Path/Value column, you can execute any method of the jsx3.net.Service class using the syntax this.method_name. When sending data to a data service, you can write code to specify a value that is unknown at design time. For example, you could specify the license key for using the data service at runtime, then you could pass the license key in the message using the setValue() method. When receiving data, you can use this feature to filter and validate return values or parse data into the format required by your application. For example, you can extract the value of an outcome element in a response and use that value to control conditional execution in a component callback handler. For a mapping tutorial, see Communicating with a Web Service Tutorial. |
Contents
|
