Service access in an EGL Rich UI handler or library is always asynchronous: the requester continues running without waiting for a response from the service. The user can still interact with the user interface while the requester waits for the service to respond.
myBindingVar IHttp?{@Resource{uri = "binding:myEntry"}}; call myService.myEcho("world") using myBindingVar returning to myCallBack onException myExceptionHandler;
The first statement accesses an instance of a binding that is created from the specified entry in an EGL deployment descriptor. The second statement uses that binding detail in an invocation.
After the invocation, the service does a task and, in most cases, responds to the EGL runtime code. The EGL runtime code then invokes a callback function. A callback function is a Rich UI function that you code and that you specify in the call statement that accesses the service. The invocation by the EGL runtime code is described as issuing a callback. If an error occurs during service access and you have specified an exception handler in the call statement, the EGL runtime code invokes the exception handler.
In the previous example, the myCallBack callback function (not shown) receives the text that is returned from a service and places it on the web page at run time.
To access a service, a Rich UI application uses the Rich UI proxy. The Rich UI proxy is runtime software that is installed with your code on an application server that is compliant with Java™ EE.
The format of the body of the enclosing HTTP message is JavaScript™ Object Notation (JSON).
The Rich UI application uses the EGL Rich UI proxy to access every invoked service, even services that are on the same server.
You can use the dedicated service to do tasks that other EGL-generated Java services can do, such as accessing a database. However, the dedicated service is not available to other code unless you redeploy it as a web service.