setHTTPBasicAuthentication()

The serviceLib.setHTTPBasicAuthentication() system function provides simple HTTP header authentication using 64–bit encryption.

HTTP Basic Authentication is a transport layer protocol used when invoking a Web service over HTTP. The key-value pair in the HTTP request header consists of the following parts:

The function requires native platform support, and so is available for Java™ Web service clients only (WebSphere® Application Server and Apache Axis).

Syntax

  serviceLib.setTCPIPLocation(variable Service | Interface in, 
  userID STRING in,
  password STRING in)
variable
A variable that your code uses to access the service. This is a service or interface variable. EGL throws a ServiceBindingException if variable is not a Web service variable.
userID
The ID you use to access the service.
password
The password you use to access the service.

Example

The following example shows the setHTTPBasicAuthentication() function in context:

try
  serviceLib.setHTTPBasicAuthentication(accountServices,
      userID, password);
  onException(sbe ServiceBindingException)
    sysLib.setError(sbe.message);
end

Compatibility

Table 1. Compatibility considerations for setHTTPBasicAuthentication()
Platform Issue
COBOL generation The setHTTPBasicAuthentication() function is not supported.

Feedback