Web Service Consumer midstream transformation in mappings
After you have defined the business service, you can configure the Web Services transformation in a mapping to access or transform data from a web service. The requirements and available options depend on whether you are connecting the Web Services transformation to one source object or to more than one source object.
Advance midstream properties
The following table describes the properties available for the Web Services transformation from the Advanced tab:
Property
Description
Cache Size for Web Service Request (KB)
Memory available for the web service request.
Default is 100 KB. If the request is more than 100 KB, you can increase the cache size.
Cache Size for Web Service Response (KB)
Memory available for the web service response.
If the web service response contains many rows or columns, you might want to increase the cache size. Default is 100 KB. Maximum is 99999 KB.
Allow Input Flush
The mapping task creates XML when it has all of the data for a group. When enabled, the mapping task flushes the XML after it receives all of the data for the root value. When not enabled, the mapping task stores the XML in memory and creates the XML after it receives data for all the groups.
Note: You cannot select the option to allow input flush if you are connecting to multiple source objects.
Transaction Commit Control
Control to commit or roll back transactions based on the set of rows that pass through the transformation. Enter an IIF function to specify the conditions to determine whether the mapping task commits, rolls back, or makes no transaction changes to the row. Use the transaction commit control if you have a large amount of data and you want to control how it is processed.
Note: You cannot configure a transaction commit control if you are connecting to multiple source objects.
Midstream transformation mapping example
The following example demonstrates how to use the Web Service Consumer midstream transformation to interact with NetSuite to get product availability details.
You can review this example to learn how to configure a Web Service Consumer midstream transformation to structure a SOAP request and response using the NetSuite operation, getItemAvailability. The midstream transformation passes the item ID in the request. The web service then returns information on the latest item availability in a SOAP response.
First, to connect to the web service, create a WSConsumer connection. You add a WSDL that describes the request and response web service messages and configures the necessary security.
Second, define a business service using the WSConsumer connection. Use the connection to define a business service and access the getItemAvailability operation:
Third, create a mapping that uses the Web Service transformation. The example mapping includes the following configuration options:
1The source is a simple .csv file that includes four fields with the login details and an item ID:
2On the Web Service tab, select the business service and operation previously defined:
3After you add a Web Services transformation, you can connect the source and see four incoming fields. You can filter your view of the incoming fields to show all fields, mapped fields, unmapped fields, or keys:
4In the Request Mapping, the incoming fields are mapped to the SOAP message. The Envelope contains the credentials and the Body contains the item ID, as shown in the following image. You drag incoming fields onto items in the request structure to create the mapping:
5On the Response Mapping tab, you map the SOAP message to the output fields you want to use. You can choose Relational or Denormalized format for output fields. This example uses Relational format:
The system generates these output field groups automatically:
- FaultGroup, if it is supported by the connection type you are using.
- Envelope, which contains the documentinfo, if you select elements of response to be mapped to output fields.
- One group for each element you have mapped where the cardinality is greater than one.
The example above has three groups. In the response, you can choose to map or unmap objects and fields by selecting a node in the hierarchy and choosing an option to map (or unmap), as shown in this image. Click the down arrow to display the mapping options for a specific node:
6On the Output Fields tab, you can see each group. If needed, you can edit the type, precision, and scale of the fields:
7The mapping includes three targets: one for the status, one for the availability, and one for the FaultGroup data:
When the mapping runs, it returns the item availability and status code. If it cannot successfully run, it creates a record in the default target that contains the fault information.