Developer Transformation Guide > Web Service Consumer Transformation > Web Service Consumer Transformation Example
  

Web Service Consumer Transformation Example

Your organization needs to expose order information for the RT100 product line to the sales organization. The sales team needs to query the order summary and order details on a daily basis.
Create a logical data object that exposes the daily order information in virtual tables. The read mapping contains a Web Service Consumer transformation that returns the latest RT100 orders. The Web Service Consumer transformation consumes a web service that returns the daily order summary and order detail information for the RT100 product line.

Input File

The input file is a flat file that contains the product line number.
Create a physical data object to define the input file. The file has one field, Product_Line. The field value is RT100. Define the location of the physical data object in the Runtime Properties view.

Logical Data Object Model

A business analyst in your organization creates a logical data model that describes the order summary and order detail table structures. The logical data model contains the Order_Summary and Order_Detail logical data objects.
The analyst creates a schema in a modeling tool that defines the logical data model. You import the logical data model from the schema and create the Order_Summary and Order_Detail logical data objects.

Logical Data Object Mapping

The logical data object mapping describes how to access data through the logical data object.
""
The read mapping contains the following objects:
Product_Line
Input flat file that contains the product line number.
Exp_Curr_Date transformation
Expression transformation that returns the current date and a primary key for the Web Service Consumer transformation root level input group.
WSC_Order transformation
Web Service Consumer transformation that consumes a web service to retrieve order information. The transformation passes the product line and current date to the web service in the request message. The transformation receives order information from the web service in the response message.
Order_Summary table
A logical data object that contains order information such as Order_No, Customer_Id, Qty, and Order_Date.
Order_Detail table
A logical data object that contains order detail information such as Order_No, Product_Id, Qty, and Status.
Orders_Fault
Output flat file that receives generic fault messages.

Web Service Consumer Transformation

The Web Service Consumer transformation receives a product line, date, and a sequence number as input. The transformation consumes the Get_Order_Info web service operation to retrieve the order information.
When you create the Web Service Consumer transformation, choose a WSDL data object that describes the request and response web service messages. A web service message contains hierarchical groups of XML elements. An element can contain other elements. Some elements occur multiple times. Create the transformation from the Order_Info WSDL object in the repository.
Configure the transformation input ports and map the ports to the operation input hierarchy. Map nodes from the operation output hierarchy to the output ports. Define the web services connection and run-time properties.

Transformation Input Mapping

When you show the input mapping on the Ports view, you can define input ports and map them to nodes in the operation input.
The transformation Ports area has a root group and an Order group. The root group is the Request input group. Add one port to the Request input group to represent the primary key.
The Order group has the Select_Date and Select_Product_Line input ports.
Map the input ports to the Order_Date and Product_Line nodes in the Operation Input area.
The Operation Input area defines the request message that the Web Service Consumer transformation passes to the web service. The nodes appear in the Operation Input area by default.

Transformation Output Mapping

When you show the output mapping on the Ports view, you can define the output ports by mapping nodes from the operation output to the transformation output groups.
The web service returns the following hierarchy in a web service response message:
Response
Orders
Order
Key_Order
Order_ID
Order_Date
Customer_ID
Total_Qty
Order_Details
Order_Detail
Product_ID
Description
Qty
Status
The web service returns multiple orders. Order is a multiple-occurring node in the Orders level. For each order, the web service can return multiple order details. Order_Detail is a multiple-occurring node in the Order_Details level.
Note: The Developer tool adds the Key_Order node in the user interface. You can map the key to output groups to define relationships between groups. For this example, the Order_ID is the primary key in Order, and it is the foreign key in Order_Details.
Create the following output groups in the Ports area:
Order
Order_ID
Order_Date
Customer_ID
Total_Qty
Order_Detail
Order_ID
Product_ID
Description
Qty
Status
The Data Integration Service writes a row from the Order group whenever the value of Order_ID changes.
The Data Integration Service writes a row from the Order_Detail group whenever the values of Order_ID and Product_ID change.

Transformation Advanced Properties

Configure the following advanced properties for the Web Service Consumer transformation:
Enable Generic SOAP Fault Handling
Adds output ports that receive SOAP fault messages.
Connection
Choose a web services connection to access the web service.
Enable Compression
The Web Service Consumer transformation compresses the web messages with GZIP.