Mapping web service import sets

During the creation of the web service import set, you may optionally create the transform map for it.

All transform maps will be executed for the service when it is invoked if the import set mode is set as "Synchronous" (the default).

The following image is an example of the transform map associated with the Notification web service import set.
Figure 1. Soap Transform Map

Adding Web Service Response Values

In the transform map script associated with a web service import set, setting certain variable values have the effect of changing the response values of the web service. In addition to the normal variables that are available in a transform map script, the table below documents the variables that are available and their effects.
Table 1. Adding Web Service Response Values
Variable name Type Description
response Output Object Javascript object that holds dynamically created response elements used to customize the output response of a web service import set insert.

Example

// create new elements called "transaction_id" 
// and "hello" in the web service response
response.transaction_id="abc123";
response.hello="world";
 
status_message="message 1";
// this is the normal status_message variable
The code snippet above results in the following response being generated back to the web service consumer
<soapenv:Envelopexmlns:imp="http://www.service-now.com/imp_notification"                  
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/><soapenv:Body>
<insertResponse xmlns="http://www.service-now.com/imp_notification">
  <sys_id>969d157c0a0a0baf008ba5770ffa798c</sys_id>
  <table>incident</table>
  <display_name>number</display_name>
  <display_value>INC0010091</display_value>
  <status>inserted</status>
  <status_message>message 1</status_message>
  <transaction_id>abc123</transaction_id>
  <hello>world</hello>
</insertResponse>
</soapenv:Body></soapenv:Envelope>