NonStop Server for Java (NSJ) Programmer's Guide (NSJ 2.0+)

// Create an RPEmployee_rp object (using the class generated by ddl2java)
// called myReply, passing it the generic reply object myGenReply
// so that it can access the message buffer.
RPEmployee_rp myReply = new RPEmployee_rp(myGenReply);
// Call the generated getReplyMessage method to return the reply message as
// a Java String.
System.out.println(Reply message: + myReply.getReplyMessage());
Exceptions
The methods that interact with Pathway servers can throw the following exceptions.
Exceptions Associated With Pathway Servers
Exception Description
TsmpServerException
Superclass for the following exceptions.
TsmpServerUnavailableException Indicates that the Pathway server was unavailable when TsmpServer tried to
send the request.
TsmpSendException
Indicates that an error occurred while trying to send a request to the Pathway
server.
TsmpRequestException
Indicates that an error occurred while trying to convert data for a
TsmpServerRequest.
TsmpReplyException
Indicates that an error occurred while trying to convert data for either
TsmpServerReply or TsmpGenericServerReply.
The generated TsmpServerReply tries to convert all fields in a reply to
Java Strings. If the server has not supplied valid values for all fields, some
conversions might fail. To determine the fields in which conversion errors
occurred, see Converting Reply Data.
Data Conversion
The TsmpServer that communicates with the Pathway server automatically calls data conversion methods in the generated
request and reply classes. (Data conversion methods are protected, so programs cannot call them directly.)
This subsection explains how the following data is converted:
Request data
Reply data
Float and Double Values
Request Data
Java Strings in the request are converted to the C or COBOL data types that the Pathway server expects, according to the
translation rules in the Data Definition Language (DDL) Reference Manual. If you set an instance variable to a value that is
not valid for the corresponding NSK data type, a conversion error occurs.
If an error occurs during the conversion of a request, a TsmpRequestException is thrown.