Developer Transformation Guide > REST Web Service Consumer Transformation > REST Web Service Consumer Transformation Ports
  

REST Web Service Consumer Transformation Ports

A REST Web Service Consumer transformation can have multiple input ports and multiple output ports. You create ports in groups based on the structure of the XML or JSON hierarchy.
When you view the transformation ports, show the ports if you do not need to view the XML or JSON hierarchy. When you show the ports, you can define groups, define ports, and map elements from the method input and output to input and output ports.
A REST Web Service Consumer transformation can have multiple input groups and multiple output groups. When you create ports, create groups and add the ports to the groups. Define the ports in a group hierarchy based on the structure of the input or output hierarchy in the XML or JSON . Add a key to relate a child group to a parent group.
All groups except the lowest group in the hierarchy must have primary keys. All groups in the hierarchy except the root group must have foreign keys.
The transformation has a root input group named RequestInput. You must add a primary key to the root input group. The key must be string, bigint, or integer. You can configure any port in the root input group as a pass-through port.
To map an element to a port, click the field in the Location column and expand the hierarchy in the Select Location dialog box. Then, choose an element from the hierarchy.

Input Ports

Input ports represent data from an upstream transformation or source that you want to pass to the web service. You can configure multiple input ports. Each input port maps to an element in the request message.
To add an input port, select an input group, click the arrow next to the New button, and select Field.

Output Ports

Output ports represent elements in the response message that you want to pass to a downstream transformation or to the target. You can configure multiple output ports. Each output port maps to an element in the response message.
To add an output port, select an output group, click the arrow next to the New button, and select Field.

Pass-through Ports

Pass-through ports pass data through the transformation without changing the data. You can configure any port in the root input group as a pass-through port.
To add a pass-through port, add a port to the root input group. Then right-click the port and select Map.

Argument Ports

Argument ports allow you to identify a resource when the URL for the resource takes an argument. Add argument ports to the root input group.
An argument port has a port name and an argument name. If an argument name contains a character that is not allowed in a port name, enter an argument name that differs from the port name. For example, you want to pass the argument "Cust-ID" to the web service, but the Data Integration Service does not allow the dash character (-) in port names. Enter "Cust-ID" as the argument name, but enter "CustID" as the port name.
The Data Integration Service appends the argument names and values for each argument port to the base URL as name=value pairs. You can configure multiple argument ports. The Data Integration Service separates multiple arguments in the request with an ampersand character (&).
For example:
http://www.HypoStores.com/customers/CustDetails?Last_Name=Jones&First_Name=Mary
If you define argument ports and URL ports in the transformation, the Data Integration Service appends the URL port values to the base URL, followed by the argument names and values.
To add an argument port, right-click on the root input group and select New > Argument Ports. Enter the argument name and the port name.

URL Ports

URL ports allow you to identify a resource through a static URL. To identify a resource, the Data Integration Service appends the value of the URL port to the base URL.
For example:
http://www.HypoStores.com/products/ProductDetails/<URL_port_value>
Add URL ports to the root input group.
You can configure multiple URL ports. The Data Integration Service separates the values in each URL port with a slash character (/). If you define URL ports and argument ports in the transformation, the Data Integration Service appends the URL port values to the base URL, followed by the argument names and values.
To add a URL port, right-click on the root input group and select New > URL Ports.

HTTP Header Ports

HTTP header ports represent HTTP headers in the request message. You can configure multiple HTTP header ports.
To pass header information to the web service in the request, add the port to the root input group. You can configure one HTTP header port for the root input group. If you add an HTTP header to the root input group, you can configure it as a pass-through port.
An HTTP header port has a port name and an HTTP header name. If an HTTP header name contains a character that is not allowed in a port name, enter an HTTP header name that differs from the port name. For example, you want to pass the header name "Content-Type" to the web service, but the Data Integration Service does not allow the dash character (-) in port names. Enter "Content-Type" as the HTTP header name, but enter "ContentType" as the port name.
To add an HTTP header port, right-click on the root input group and select New > HTTP Header. Enter a header name and port name.

Cookie Ports

You can configure the REST Web Service Consumer transformation to use cookie authentication. The remote web server tracks the web service consumer users based on the cookies. You can increase performance when a mapping calls a web service multiple times.
To pass cookie information to the web service in the request, add the port to the root input group. You can configure one cookie port for the root input group. If you add a cookie port to the root input group, you can configure it as a pass-through port.
To extract cookie information from the response, add a cookie port to an output group. You can configure one cookie port for each output group.
When you project the cookie port to a web service request message, the web service provider returns a cookie value in the response message. You can pass the cookie value to another transformation downstream in the mapping, or you can save the cookie value in a file. When you save the cookie value in a file, you can configure the cookie as input to the REST Web Service Consumer transformation.
To add a cookie port, right-click on the root input group and select New > Other Ports. Then, select Cookie, and click OK.

Output XML Ports

Output XML ports represent responses from the web service. Output XML ports are string ports.
Add an output XML port to an output group. You can configure one output XML port for each output group.
right-click on the root input group and select New > Other Ports. Then, select Output XML, and click OK.

Response Code Ports

Response code ports represent the HTTP response codes from the web service. Response code ports are integer ports.
Add a response code port to an output group. You can configure one response code port for each output group.
To add a response code port, select an output group, right-click on the root input group and select New > Other Ports. Then, select Response Code, and click OK. .