How to Use Argument Ports to Generate URL Parameters
How to Use Argument Ports to Generate URL Parameters
You can use argument ports to generate parameters in the URL to filter the data that you request from the web service. For example, if you use the Get method, you cannot configure a method input definition or an input mapping, but you still want to use a filter in the Get request. You can use argument ports to create a filter in the request message. Build a URL such as
https://sample.com?arg1=val1&arg2=val2
by using argument ports to generate the URL parameters.
To configure an argument port after you create the REST Web Service Consumer transformation, complete the following steps:
Select the REST Web Service Consumer transformation.
Navigate to the
Properties
view and select the
Advanced
tab.
To configure the base URL, complete one of the following steps:
To configure the
URL
property, enter the base URL.
To configure the
Connection
property, select the HTTP connection.
Navigate to the
Ports
tab.
Highlight the
RequestInput
group and select
New
. Select
Argument Ports
from the drop-down menu.
Enter values for
Argument Name
and
Port Name
.
If the port name contains characters that the Data Integration Service cannot process, change the port name.
The following image shows the argument port nested under RequestInput:
Repeat steps 3 and 4 to add a second argument port.
The second argument port appears under the first argument port:
The argument port values are appended to the URL in the format
http://sample.com?arg1=val1&arg2=val2
. The port name is not used in the URL. The Data Integration Service uses the port name to identify the argument ports.
To use the argument ports
arg1
and
arg2
as parameters in the base URL, link ports from an upstream mapping object to the argument ports in the REST Web Service Consumer transformation.