EGL library serviceLib

The serviceLib functions get and set service variable information.

The following table describes system functions in the serviceLib library. The variable parameter represents a service-access variable, as described in “Service access in EGL.”

Table 1. serviceLib system functions
System function and invocation Description
result = bindService (string) Dynamically binds a service-access variable to a service-client binding.
convertFromJSON (json, variable) Converts a JSON string into a record or dictionary.
result = convertFromURLEncoded (URI) Returns a string that represents a decoded Universal Resource Identifier (URI); the URI might identify a Web page or represent a resource that will be accessed by a REST service
result = convertToJSON (variable ) Converts a record or dictionary into a JSON string.
result =convertToURLEncoded (input) Receives a string and returns a Universal Resource Identifier (URI), which might identify a Web page or represent the resource that will be accessed by a REST service
endStatefulServiceSession (interface) Releases runtime resources used to used to support access of EGL REST services that provide access to stateful IBM i programs.
result = getCurrentCallbackResponse() Provides access to details from the HTTP response that is received by a callback function or onException function after a service invocation.
result = getOriginalRequest() Provides access to an HTTP request. If the function is invoked a callback or onException function, the HTTP request was sent to the service during the specific call that caused the service to invoke the callback or onException function. If serviceLib.getOriginalRequest() is invoked elsewhere, the HTTP request was provided during the most recent service call.
result =getRestRequestHeaders (interface) Returns the HTTP request headers available in an Interface variable that is used to access a REST service. The return value is an EGL dictionary.
result = getRestServiceLocation (interface) Returns the base URI used to access the REST service. The return value is a string.
result = getTCPIPLocation (variable) Returns the host name and port number that provide TCP/IP access to an EGL service.
result = getWebServiceLocation (variable) Returns the URI that provides access to a Web (SOAP) service.
setHTTPBasicAuthentication (userID, password) Gives the user access to a Web application when that access is protected by JEE basic authentication. The function lets you provide a user ID and password, which are automatically encrypted for inclusion in an HTTP header.
setProxyBasicAuthentication (userID, password) Gives the user access to the EGL Rich UI Proxy when that access is protected by JEE basic authentication. The function lets you provide a user ID and password, which are automatically encrypted for inclusion in an HTTP header.
setRestRequestHeaders (interface, headers) Sets the HTTP headers that are transmitted to a REST service. The headers are in an EGL dictionary.
setRestServiceLocation (interface, baseURI) Sets the base URI used to access the REST service.
setTCPIPLocation (variable, string) Sets the host name and port number that provide TCP/IP access to an EGL service.
setWebServiceLocation (variable, string) Sets the URI that provides access to a Web (SOAP) service.

Compatibility

Table 2. Compatibility considerations for serviceLib
Platform Issue
IMS/VS, IMS BMP serviceLib is not supported.
VSE serviceLib is not supported.

Feedback