Working with the HTTP Request Node

Overview of the HTTP Request Node

You can add an HTTP Request node to a Diagram tab in an orchestration job to access a third-party web service that uses a REST (HTTP) interface. Representational State Transfer (REST) is a set of architectural principles for designing web services that access a system's resources. The HTTP Request node is used to send raw HTTP requests to an HTTP server and handle any response received from the server.
A resource is accessed with a Uniform Resource Identifier (URI). The REST transformation generates SAS HTTP procedure code to read from and write to a web service in the context of a job.
It is assumed that you are familiar with how to use the REST interface to access web services. Gather the same information that you need to use the SAS HTTP procedure to read from and write to the desired web service. Example options and values are shown in the next section. For detailed information about the SAS HTTP procedure, see the documentation for that procedure in the Base SAS Procedures Guide.

Inputs and Outputs to the HTTP Request Node

The HTTP Request node can take the inputs and outputs listed in the following table:
Inputs and Outputs to the HTTP Request Node
Name
Description
Inputs:
WSCP_ADDRESS
The URI to process
WSCP_DOMAIN
The authentication domain of the credentials to use
WSCP_HTTP_CONTENT_TYPE
The content type to include in the HTTP request headers
WSCP_INPUT
The HTTP request data to send
WSCP_INPUT_TYPE
The HTTP request data input type
WSCP_PASS
The user’s password
WSCP_POLL_INTERVAL
The interval to check for cancellation
WSCP_PREEMPTIVE_AUTHENTICATION
The preemptive authentication setting
WSCP_PROXY_DOMAIN
The proxy authentication domain
WSCP_PROXY_HOST
The host name of the proxy
WSCP_PROXY_PASS
The proxy user’s password
WSCP_PROXY_PORT
The proxy port number
WSCP_PROXY_USER
The proxy user
WSCP_TRANSPORT_HTTP
The HTTP method
WSCP_USER
The user name
Unique Outputs:
WSCP_RESPONSE
The request response
WSCP_RESPONSE_HEADERS_OUT_STR
The response headers are output as strings and listed as key=value pairs, with one pair per line. Newline characters are used to distinguish the line breaks.

Using the HTTP Request Node

You can add an HTTP Request node to a Flow tab in an orchestration job to access a third-party web service that uses an HTTP interface. For example, you can create an orchestration job that inputs a customer ID in an Echo node. Then, you can use the actions available in the HTTP Request node to delete, put, and get the ID data. Finally, you can create an expression to write out the HTTP response to a text file.
The following display shows the sample HTTP Request job:
HTTP Request Node
HTTP Request Node
The Echo node in the job has been renamed to Set the Customer ID. An input named CustomerID has been created and given a default value of 3039.
The Input tab for the first HTTP Request node in the job is shown in the following job:
HTTP Delete Input
HTTP Delete Input
Create an ID input and bind it to CustomerID.CustomerID from the Echo node. Note the default value of 3039.
The input that you just created carries over to the HTTP Request tab that is shown in the following display:
HTTP Request with Delete Method
HTTP Request with Delete Method
Note the Delete method is specified.
The following display shows the HTTP Request node with the put method selected:
HTTP Request with Put Method
HTTP Request with Put Method
The following display shows the HTTP Request node with the get method selected:
HTTP Request with Get Method
HTTP Request with Get Method
An expression in the Expression node writes the output to a text file.
This file, which is named HTTP_PUTAndDELETE_ProxServer_Domain.txt, should contain the following content:
Job Output
Job Output

Usage Notes for HTTP Request Nodes

Out-of -Memory Errors for HTTP Request Nodes

SAS Visual Process Orchestration jobs with a SOAP Request node or an HTTP Request node can run out of memory if you are using a Sun Java Virtual Machine (JVM). If this happens, add the following option to the Java start command that is specified in the app.cfg file for the server that executes the job.
The Java option is: -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled