You are on page 1of 10

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 following figure shows how the Integration Service processes an HTTP
transformation
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.

Creating an HTTP Transformation

You create HTTP transformations in the Transformation Developer or in the


Mapping Designer. An HTTP transformation has the following tabs:

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:

In the Transformation Developer or Mapping Designer, click Transformation >


1.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.

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.

Table 8-1 describes the HTTP transformation properties that you can configure:

Table 8-1. HTTP Transformation Properties


Option Description
Runtime Location that contains the DLL or shared library. Default is
Location $PMExtProcDir. Enter a path relative to the Integration Service
machine that runs the session using the HTTP transformation.
If you make this property blank, the Integration Service uses the
environment variable defined on the Integration Service machine
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 machine. 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 Indicates if the order of the output data is consistent between
Repeatable 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 Indicates if the Integration Service processes each partition at
Thread Per the procedure with one thread. When you enable this option, the
Partition procedure code can use thread-specific operations. Default is
enabled.
Output is Indicates whether the transformation generates consistent output
Deterministic data between session runs. Enable this property to perform
recovery on sessions that use this transformation. Default is
enabled.

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.

Table 8-2 explains the different methods:

Table 8-2. HTTP Transformation Methods


Method Description
GET Reads data from an HTTP server.
POST Writes data from multiple input ports to the HTTP server.
SIMPLE A simplified version of the POST method. Writes data from one input
POST 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.

Table 8-3 describes the groups and ports for the GET method:

Table 8-3. GET Method Groups and Ports


Request/ Group Description
Response
REQUEST Input The Designer uses the names and values of the input ports to
construct the final URL.
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.
Output All body data for an HTTP response passes through the
HTTPOUT output port.

Table 8-4 describes the ports for the POST method:

Table 8-4. POST Method Groups and Ports


Request/ Group Description
Response
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.
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.
Output All body data for an HTTP response passes through the
HTTPOUT output port.

Table 8-5 describes the ports for the SIMPLE POST method:

Table 8-5. SIMPLE POST Method Groups and Ports


Request Group Description
/Response
REQUEST Input You can add one input port. Body data for an HTTP request
can pass through one input port.
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.
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 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.

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

Figure 8-2 shows that each field in the source file has a corresponding input port:
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/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<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:s
mplsource>
</n4:Body>

<n4:Envelope>,capeconnect:Clienttest1services:Clienttest1#smplsource

You might also like