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 variable that is based on either a Service part or an Interface part. Either part provides access to a service.

Table 1. serviceLib system functions
System function and invocation Description
result = bindService (string) Specifies a binding name that refers to an element in the EGL deployment descriptor file.
convertFromJSON (json, variable) Converts a JSON string into a record or dictionary.
result = convertFromURLEncoded (url) Returns a version of a Universe Resource Locator (URL) that is decoded; for example, the returned string has a space rather than the following combination: %20.
result = convertToJSON (variable ) Converts a record or dictionary into a JSON string.
result = convertToURLEncoded (input) Returns a version of a Universe Resource Locator (URL) that is encoded so that the string can be used for service invocation.
endStatefulServiceSession (interface, exceptionHandler) Releases runtime resources used to support access of EGL REST-RPC 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.
getSOAPRequestHeaders (headerRecord) Gives access to the SOAP request headers that are provided by a service requester. This function is valid only in an EGL-generated, Java-based SOAP service and only if the service relies on JAX-WS rather than JAX-RPC.
getSOAPResponseHeaders (interface, headerRecord) Gives access to the SOAP response headers that are provided to a service requester. This function is available only in a Java- or JavaScript-based requester that relies on JAX-WS rather than JAX-RPC.
result = getTCPIPLocation (variable) Returns the host name and port number that provide TCP/IP access to an EGL service.
result = getWebServiceLocation (variable) Returns the URL that provides access to a 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.
setSOAPRequestHeaders (interface, headerRecord) Sets the request headers that will be transmitted to a SOAP service. This function is available only in a Java- or JavaScript-based requester that relies on JAX-WS rather than JAX-RPC.
setSOAPResponseHeaders (headerRecord) Sets the response headers that will be returned to a service requester. This function is available only in an EGL-generated, Java-based SOAP service and only if the service relies on JAX-WS rather than JAX-RPC.
setTCPIPLocation (variable, string) Sets the host name and port number that provide TCP/IP access to an EGL service.
setWebServiceLocation (variable, string) Sets the URL that provides access to a 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