4.4.3.1 tryOnFml.java Client Code

The tryOnFml.java Java code fragment in the following listing illustrates how Jolt works with a service whose buffer type is FML. In this example, it is assumed that a session object was already instantiated.

Listing tryOnFml.java Code Example

/* Copyright 1997 Oracle Systems, Inc. All Rights Reserved */

import bea.jolt.*;
class ...
{

      ...
      public void tryOnFml ()
      {
          JoltRemoteService passFml;
          String outputString;
          int outputInt;  
          float outputFloat;
                   ...
          passFml = new JoltRemoteService("PASSFML",session);
          passFml.setString("INPUTSTRING", "John");
          passFml.setInt("INPUTINT", 67);
          passFml.setFloat("INPUTFLOAT", (float)12.0);
          passFml.call(null);
          outputString = passFml.getStringDef("OUTPUTSTRING", null);
          outputInt = passFml.getIntDef("OUTPUTINT", -1);
          outputFloat = passFml.getFloatDef("OUTPUTFLOAT", (float)-1.0);
          System.out.print("String =" + outputString);
          System.out.print(" Int =" + outputInt);
          System.out.println(" Float =" + outputFloat);
          }
}