HTTP Component

The HTTP component is similar to the SOAP component, but in the HTTP component you don't specify a wsdl file. It is an http request, but it can be any web page that returns the data. The returned data can be an XML file, text file (flat) or an html page. Like the Soap component, the HTML component can require input parameter values and can output values of its own, depending on the type of output (XML, text, or HTML). The reserved variable RESPONSE will always contain the complete response (txt/html/xml) of the HTTP-service.

The HTTP component can be used for any call to any page. Input parameters can be sent with the HTTP request. Output parameters can be delivered.

As an exercise, a very simple journey using a W3Schools test page: http://www.w3schools.com/jquery/demo_test_post.asp. The page was created to do a Jquery post test (http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax_post) but we will use it to test the POST values and see what is returned
The URL of the page is http://www.w3schools.com/jquery/demo_test_post.asp and the input POST parameters are 'name' and 'city'.  In the journey we created a form "HTTPservice - search" with an input field named NAME and CITY. The submitted values @NAME and @CITY are used as values for the HTTP service Input parameters 'name' and 'city'.
A result page is returned. We use it as an Output value @HTML to display the entire result page (html) on the second journey page (~@HTML~ in the Editor)









Events

The HTTP component triggers two events: OnSucces and OnFailed:

  • OnSucces: when the call has been successfully executed.
  • OnFailed: when the call has not been executed successfully

 

Properties

General

  1. Enter a name and description for the component. This information appears on the journey canvas
  2. Enter a valid URL for the HTTP request
  3. Select the Request type to be used for the input parameters: GET or POST (GET means that parameters are added in the URL. Post means the parameters are added in the page.)
  4. Select a value for the Response field. A choice can be made between the following types of return:
  • XML parameters

XML:
                <XML>

                                <FIELD1>value1</ FIELD1>
                                <FIELD2>value2</FIELD2>
                                <
FIELD3>value3</FIELD3>
                </XML>

  • Flat parameters

Flat:
FIELD1:value1
FIELD2:value2
FIELD3:value3

  • HTML Content

HTML:
Only the RESPONSE variable is returned holding the entire html code.

Input parameters

Input parameters are entered manually. These parameters are used by the HTTP request.  These values can either be string  or numeric values, values retrieved from the audience list or its extended profiles, system variables or values retrieved in a form.

  • posted values from a form. E.g. @FIRSTNAME
  • List values
  • Numeric and string values. For string values use single quotes e.g. 'Spring 20'
  • System variables. E.g. SYSTEM.CAMPAIGNID
  • Functions. E.g. GETDATE() to retrieve the current date
  • Combined. E.g. IF(@VALUE=1,1,OPTIN). If a posted value equals 1, pass 1, otherwise take the value of the OPTIN field.

Output parameters

The Output parameters need to be entered manually. These are the parameters that are returned by the HTTP request. The RESPONSE parameter contains the complete response (the complete XML, text, or HTML code)

 

Back to components