You are on page 1of 5

HTTP Transformation

Page 1 of 5

HTTP Transformation

HTTP Transformation
This chapter includes the following topics:
HTTP Transformation Overview
Creating an HTTP Transformation
Configuring the Properties Tab
Configuring the HTTP Tab
Examples

Informatica Corporation
http://mysupport.informatica.com

HTTP Transformation > HTTP Transformation Overview

HTTP Transformation Overview


Transformation type:
Passive
Connected
The HTTP transformation enables you to connect to an HTTP server to use its services and applications. When you run a session with an HTTP transformation, the Integration Service
connects to the HTTP server and issues a request to retrieve data from or update data on the HTTP server, depending on how you configure the transformation:
Read data from an HTTP server. When the Integration Service reads data from an HTTP server, it retrieves the data from the HTTP server and passes the data to the target or a
downstream transformation in the mapping. For example, you can connect to an HTTP server to read current inventory data, perform calculations on the data during the PowerCenter
session, and pass the data to the target.
Update data on the HTTP server. When the Integration Service writes to an HTTP server, it posts data to the HTTP server and passes HTTP server responses to the target or a
downstream transformation in the mapping. For example, you can post data providing scheduling information from upstream transformations to the HTTP server during a session.
The Integration Service passes data from upstream transformations or the source to the HTTP transformation, reads a URL configured in the HTTP transformation or application
connection, and sends an HTTP request to the HTTP server to either read or update data.
Requests contain header information and may contain body information. The header contains information such as authentication parameters, commands to activate programs or web
services residing on the HTTP server, and other information that applies to the entire HTTP request. The body contains the data the Integration Service sends to the HTTP server.
When the Integration Service sends a request to read data, the HTTP server sends back an HTTP response with the requested data. The Integration Service sends the requested data to
downstream transformations or the target.
When the Integration Service sends a request to update data, the HTTP server writes the data it receives and sends back an HTTP response that the update succeeded. The HTTP
transformation considers response codes 200 and 202 as a success. It considers all other response codes as failures. The session log displays an error when an HTTP server passes a
response code that is considered a failure to the HTTP transformation. The Integration Service then sends the HTTP response to downstream transformations or the target.
You can configure the HTTP transformation for the headers of HTTP responses. HTTP response body data passes through the HTTPOUT output port.

Authentication
The HTTP transformation uses the following forms of authentication:
Basic. Based on a non-encrypted user name and password.
Digest. Based on an encrypted user name and password.
NTLM. Based on encrypted user name, password, and domain.

Connecting to the HTTP Server


When you configure an HTTP transformation, you can configure the URL for the connection. You can also create an HTTP connection object in the Workflow Manager. Configure an HTTP
application connection in the following circumstances:
The HTTP server requires authentication.
You want to configure the connection timeout.
You want to override the base URL in the HTTP transformation.

Informatica Corporation
http://mysupport.informatica.com

HTTP Transformation > Creating an HTTP Transformation

Creating an HTTP Transformation


You create HTTP transformations in the Transformation Developer or in the Mapping Designer. An HTTP transformation has the following tabs:

file:///C:/Users/Ramakrishna%20K/AppData/Local/Temp/~hhD806.htm

3/16/2015

HTTP Transformation

Page 2 of 5

Transformation. Configure the name and description for the transformation.


Ports. View input and output ports for the transformation. You cannot add or edit ports on the Ports tab. The Designer creates ports on the Ports tab when you add ports to the header
group on the HTTP tab.
Properties. Configure properties for the HTTP transformation on the Properties tab.
HTTP. Configure the method, ports, and URL on the HTTP tab.
To create an HTTP transformation:
1.

In the Transformation Developer or Mapping Designer, click Transformation > Create.

2.

Select HTTP transformation.

3.

Enter a name for the transformation.

4.

Click Create.
The HTTP transformation displays in the workspace.

5.

Click Done.

6.

Configure the tabs in the transformation.

Informatica Corporation
http://mysupport.informatica.com

HTTP Transformation > Configuring the Properties Tab

Configuring the Properties Tab


The HTTP transformation is built using the Custom transformation. Some Custom transformation properties do not apply to the HTTP transformation or are not configurable.
The following table describes the HTTP transformation properties that you can configure:
Option

Description

Runtime Location

Location that contains the DLL or shared library. Default is $PMExtProcDir. Enter a path relative to the Integration Service node that runs the
HTTP transformation session.
If this property is blank, the Integration Service uses the environment variable defined on the Integration Service to locate the DLL or shared
library.
You must copy all DLLs or shared libraries to the runtime location or to the environment variable defined on the Integration Service node. The
Integration Service fails to load the procedure when it cannot locate the DLL, shared library, or a referenced file.

Tracing Level

Amount of detail displayed in the session log for this transformation. Default is Normal.

Is Partitionable

Indicates if you can create multiple partitions in a pipeline that uses this transformation:
No. The transformation cannot be partitioned. The transformation and other transformations in the same pipeline are limited to one partition.
Locally. The transformation can be partitioned, but the Integration Service must run all partitions in the pipeline on the same node. Choose
Local when different partitions of the Custom transformation must share objects in memory.
Across Grid. The transformation can be partitioned, and the Integration Service can distribute each partition to different nodes.
Default is No.

Output is Repeatable

Indicates if the order of the output data is consistent between session runs.
Never. The order of the output data is inconsistent between session runs.
Based On Input Order. The output order is consistent between session runs when the input data order is consistent between session runs.
Always. The order of the output data is consistent between session runs even if the order of the input data is inconsistent between session
runs.
Default is Based on Input Order.

Requires Single Thread Per Partition

Indicates if the Integration Service processes each partition at the procedure with one thread.

Output is Deterministic

Indicates whether the transformation generates consistent output data between session runs. Enable this property to perform recovery on
sessions that use this transformation. Default is enabled.

Warning: If you configure a transformation as repeatable and deterministic, it is your responsibility to ensure that the data is repeatable and deterministic. If you try to recover a session
with transformations that do not produce the same data between the session and the recovery, the recovery process can result in corrupted data.

Informatica Corporation
http://mysupport.informatica.com

HTTP Transformation > Configuring the HTTP Tab

Configuring the HTTP Tab


On the HTTP tab, you can configure the transformation to read data from the HTTP server or write data to the HTTP server. Configure the following information on the HTTP tab:
Select the method. Select GET, POST, or SIMPLE POST method based on whether you want to read data from or write data to an HTTP server.
Configure groups and ports. Manage HTTP request/response body and header details by configuring input and output ports. You can also configure port names with special
characters.
Configure a base URL. Configure the base URL for the HTTP server you want to connect to.

Selecting a Method
The groups and ports you define in a transformation depend on the method you select. To read data from an HTTP server, select the GET method. To write data to an HTTP server, select
the POST or SIMPLE POST method.

file:///C:/Users/Ramakrishna%20K/AppData/Local/Temp/~hhD806.htm

3/16/2015

HTTP Transformation

Page 3 of 5

The following table explains the different methods:


Method

Description

GET

Reads data from an HTTP server.

POST

Writes data from multiple input ports to the HTTP server.

SIMPLE POST

A simplified version of the POST method. Writes data from one input port as a single block of data to the HTTP server.

To define the metadata for the HTTP request, you must configure input and output ports based on the method you select:
GET method. Use the input group to add input ports that the Designer uses to construct the final URL for the HTTP server.
POST or SIMPLE POST method. Use the input group for the data that defines the body of the HTTP request.
For all methods, use the header group for the HTTP request header information.

Configuring Groups and Ports


The ports you add to an HTTP transformation depend on the method you choose and the group. An HTTP transformation uses the following groups:
Output. Contains body data for the HTTP response. Passes responses from the HTTP server to downstream transformations or the target. By default, contains one output port,
HTTPOUT. You cannot add ports to the output group. You can modify the precision for the HTTPOUT output port.
Input. Contains body data for the HTTP request. Also contains metadata the Designer uses to construct the final URL to connect to the HTTP server. To write data to an HTTP server,
the input group passes body information to the HTTP server. By default, contains one input port.
Header. Contains header data for the request and response. Passes header information to the HTTP server when the Integration Service sends an HTTP request. Ports you add to the
header group pass data for HTTP headers. When you add ports to the header group the Designer adds ports to the input and output groups on the Ports tab. By default, contains no
ports.
Note: The data that passes through an HTTP transformation must be of the String datatype. String data includes any markup language common in HTTP communication, such as HTML
and XML.
The following table describes the groups and ports for the GET method:
Request/

Group

Description

Response
REQUEST

Input

The Designer uses the names and values of the input ports to construct the final URL.

REQUEST

Header

You can configure input and input/output ports for HTTP requests. The Designer adds ports to the input and output groups based on the
ports you add to the header group:
Input group. Creates input ports based on input and input/output ports from the header group.
Output group. Creates output ports based on input/output ports from the header group.

RESPONSE

Header

You can configure output and input/output ports for HTTP responses. The Designer adds ports to the input and output groups based on the
ports you add to the header group:
Input group. Creates input ports based on input/output ports from the header group.
Output group. Creates output ports based on output and input/output ports from the header group.

RESPONSE

Output

All body data for an HTTP response passes through the HTTPOUT output port.

The following table describes the ports for the POST method:
Request/

Group

Description

REQUEST

Input

You can add multiple ports to the input group. Body data for an HTTP request can pass through one or more input ports based on what you
add to the header group.

REQUEST

Header

You can configure input and input/output ports for HTTP requests. The Designer adds ports to the input and output groups based on the
ports you add to the header group:

Response

Input group. Creates input ports based on input and input/output ports from the header group.
Output group. Creates output ports based on input/output ports from the header group.
RESPONSE

Header

You can configure output and input/output ports for HTTP responses. The Designer adds ports to the input and output groups based on the
ports you add to the header group:
Input group. Creates input ports based on input/output ports from the header group.
Output group. Creates output ports based on output and input/output ports from the header group.

RESPONSE

Output

All body data for an HTTP response passes through the HTTPOUT output port.

The following table describes the ports for the SIMPLE POST method:
Request /Response

Group

Description

REQUEST

Input

You can add one input port. Body data for an HTTP request can pass through one input port.

REQUEST

Header

You can configure input and input/output ports for HTTP requests. The Designer adds ports to the input and output groups based on the
ports you add to the header group:
Input group. Creates input ports based on input and input/output ports from the header group.
Output group. Creates output ports based on input/output ports from the header group.

RESPONSE

Header

You can configure output and input/output ports for HTTP responses. The Designer adds ports to the input and output groups based on the
ports you add to the header group:
Input group. Creates input ports based on input/output ports from the header group.
Output group. Creates output ports based on output and input/output ports from the header group.

RESPONSE

Output

All body data for an HTTP response passes through the HTTPOUT output port.

Adding an HTTP Name


The Designer does not allow special characters, such as a dash (-), in port names. If you need to use special characters in a port name, you can configure an HTTP name to override the
name of a port. For example, if you want an input port named Content-type, you can name the port ContentType and enter Content-Type as the HTTP name.

Configuring a URL
After you select a method and configure input and output ports, you must configure a URL. Enter a base URL, and the Designer constructs the final URL. If you select the GET method, the

file:///C:/Users/Ramakrishna%20K/AppData/Local/Temp/~hhD806.htm

3/16/2015

HTTP Transformation

Page 4 of 5

final URL contains the base URL and parameters based on the port names in the input group. If you select the POST or SIMPLE POST methods, the final URL is the same as the base URL.
You can use a mapping parameter or variable to configure the base URL. For example, declare the mapping parameter $$ParamBaseURL, enter the mapping parameter $$ParamBaseURL
in the base URL field, and then define $$ParamBaseURL in the parameter file.
You can also specify a URL when you configure an HTTP application connection. The base URL specified in the HTTP application connection overrides the base URL specified in the HTTP
transformation.
Note: An HTTP server can redirect an HTTP request to another HTTP server. When this occurs, the HTTP server sends a URL back to the Integration Service, which then establishes a
connection to the other HTTP server. The Integration Service can establish a maximum of five additional connections.

Final URL Construction for GET Method


The Designer constructs the final URL for the GET method based on the base URL and port names in the input group. It appends HTTP arguments to the base URL to construct the final
URL in the form of an HTTP query string. A query string consists of a question mark (?), followed by name/value pairs. The Designer appends the question mark and the name/value pairs
that correspond to the names and values of the input ports you add to the input group.
When you select the GET method and add input ports to the input group, the Designer appends the following group and port information to the base URL to construct the final URL:

?<input group input port 1 name> = $<input group input port 1 value>
For each input port following the first input group input port, the Designer appends the following group and port information:

& <input group input port n name> = $<input group input port n value>
where n represents the input port.
For example, if you enter www.company.com for the base URL and add the input ports ID, EmpName, and Department to the input group, the Designer constructs the following final URL:

www.company.com?ID=$ID&EmpName=$EmpName&Department=$Department
You can edit the final URL to modify or add operators, variables, or other arguments. For more information about HTTP requests and query string, see http://www.w3c.org.

Informatica Corporation
http://mysupport.informatica.com

HTTP Transformation > Examples

Examples
This section contains examples for each type of method:
GET
POST
SIMPLE POST

GET Example
The source file used with this example contains the following data:

78576 78577 78578


The following figure shows the HTTP tab of the HTTP transformation for the GET example:

The Designer appends a question mark (?), the input group input port name, a dollar sign ($), and the input group input port name again to the base URL to construct the final URL:

http://www.informatica.com?CR=$CR
The Integration Service sends the source file values to the CR input port of the HTTP transformation and sends the following HTTP requests to the HTTP server:

http://www.informatica.com?CR=78576 http://www.informatica.com?CR=78577 http://www.informatica.com?CR=78578


The HTTP server sends an HTTP response back to the Integration Service, which sends the data through the output port of the HTTP transformation to the target.

POST Example
The source file used with this example contains the following data:

33,44,1 44,55,2 100,66,0


The following figure shows that each field in the source file has a corresponding input port:

file:///C:/Users/Ramakrishna%20K/AppData/Local/Temp/~hhD806.htm

3/16/2015

HTTP Transformation

Page 5 of 5

The Integration Service sends the values of the three fields for each row through the input ports of the HTTP transformation and sends the HTTP request to the HTTP server specified in
the final URL.

SIMPLE POST Example


The following text shows the XML file used with this example:

<?xml version="1.0" encoding="UTF-8"?>


<n4:Envelope xmlns:cli="http://localhost:8080/axis/Clienttest1.jws" xmlns:n4="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://schemas.xmlsoap.org/soap/e
<n4:Header>
</n4:Header>
<n4:Body n4:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><cli:smplsource>
<Metadatainfo xsi:type="xsd:string">smplsourceRequest.Metadatainfo106</Metadatainfo></cli:smplsource>
</n4:Body>
<n4:Envelope>,capeconnect:Clienttest1services:Clienttest1#smplsource
The following figure shows the HTTP tab of the HTTP transformation for the SIMPLE POST example:

The Integration Service sends the body of the source file through the input port and sends the HTTP request to the HTTP server specified in the final URL.

Informatica Corporation
http://mysupport.informatica.com

file:///C:/Users/Ramakrishna%20K/AppData/Local/Temp/~hhD806.htm

3/16/2015

You might also like