Example 6-2, Using the carray buffer type – HP NonStop G-Series User Manual
Page 73

back to the client. The following example assumes that a session object was already instantiated.
Example 6-2. Use of the STRING buffer type (ToUpper.java)
/* Copyright 1996 BEA Systems, Inc. All Rights Reserved */
import bea.jolt.*;
public class ToUpper
{
public static void main (String[] args)
{
JoltSession session;
JoltSessionAttributes sattr;
JoltRemoteService toupper;
JoltTransaction trans;
String userName=null;
String userPassword=null;
String appPassword=null;
String userRole="myapp";
String outstr;
sattr = new JoltSessionAttributes();
sattr.setString(sattr.APPADDRESS, "//myhost:8501");
switch (sattr.checkAuthenticationLevel())
{
case JoltSessionAttributes.NOAUTH:
break;
case JoltSessionAttributes.APPASSWORD:
appPassword = "appPassword";
break;
case JoltSessionAttributes.USRPASSWORD:
userName = "myname";
userPassword = "mysecret";
appPassword = "appPassword";
break;
}
sattr.setInt(sattr.IDLETIMEOUT, 300);
session = new JoltSession(sattr, userName, userRole,
userPassword, appPassword);
toupper = new JoltRemoteService ("TOUPPER", session);
toupper.setString("STRING", "hello world");
toupper.call(null);
outstr = toupper.getStringDef("STRING", null);
if (outstr != null)
System.out.println(outstr);
session.endSession();
System.exit(0);
} // end main
} // end ToUpper
Using the CARRAY Buffer Type
The CARRAY buffer type is a simple character array buffer type that is built into the TUXEDO system. With the CARRAY buffer type,
because the system does not interpret the data, although the data type is known, there is no way of determining how much data to transmit
during an operation. The application is always required to specify a length when passing this buffer type.
Define ECHO in the Repository Editor
Before running
, you must write and boot an ECHO TUXEDO service. The ECHO service takes a buffer and passes it back to
the Jolt client. You will also need to use the Jolt Repository Editor to define the ECHO service.
In the Repository Editor add the ECHO service as follows:
Add a service named ECHO whose buffer type is CARRAY.
1.