3.6 Receiving Results from a Service
The ServletSessionPool.call()
method returns a
ServletResult
object that contains the results from
the Tuxedo service. If the service call fails, an exception is
thrown. You should always attempt to catch exceptions and handle
them appropriately. Refer to “Appendix A, Oracle Jolt
Exceptions” in Using Oracle Jolt for details about the
possible exceptions that can occur.
The following example retrieves a ServletResult
object using the ServletSessionPool.call()
method in
an HTTP servlet:
ServletResult sResult = ssPool.call("service_name", request);
where ssPool
is a ServletSessionPool
,
and
request
is an
HttpServletRequest
.
The ServletSessionPool.call()
method returns a
Result
object that you must cast as a
ServletResult
object. The ServletResult
object provides extra methods for retrieving data as Java
Strings.
Provided the call was successful, the individual parameters can
be retrieved from the Result
or
ServletResult
object using various forms of the
getValue()
method.