Service Bean Sample Code

package com.attachmate.test;

//These classes are automatically generated.
import Test.TestServiceBean;
import Test.TaskInput.ScreenInputs;
import Test.TaskOutput.ScreenOutputs;

/**
 * A simple console applications that demonstrates how to execute a task via
 * the service bean API.
 */
public class ServiceBeanTest
{
    /**
     * Application entry point.
     * @param args Command line arguments.  Not used.
     */
    public static void main (String[] args)
    {
        try
        {
            //Instantiate the service bean
            TestServiceBean bean = new TestServiceBean();

            //Set the task inputs
            ScreenInputs inputs = new ScreenInputs();
            inputs.setInput("data");

            //Execute the task
            ScreenOutputs outputs = bean.Task(inputs);

            //Display the output
            System.out.println(outputs.getOutput());
        }
        catch (Exception xx)
        {
            xx.printStackTrace();
        }
    }
}
Related Topics
Bullet Using Tasks in Your Applications, Overview
Bullet Using Java Beans
Bullet Building Applications Using Native Win32 Technologies
Bullet Proxy Service Interface API Reference
  Attachmate