Calling an iSeries program from your Java application

Use the Program Call wizard to call an iSeries program or procedure from your Java application. The wizard prompts you for information regarding program or service program objects, along with the parameters for the objects, and then creates the desired Java beans and PCML file.

Before launching the wizard, you must have a Java project or a Dynamic Web project.

This wizard helps you to define:

Based on your definition, the wizard creates a PCML file and Java beans for you to call your iSeries program or procedure. If you already have an existing PCML file that contains all the definitions, you can import the PCML file, and the wizard can generate Java beans from it.

To use the first page of the Program Call wizard:

  1. Launch the wizard. If you have a Program Call bean created previously, you can double-click on the MPCML file. This is the recommended method because it brings all information (such as package and configuration information) into the wizard as well as PCML data. Otherwise do one of the following:
    • Select the project or package in which you want the wizard to generate the Java beans and PCML file. Click the Create Program Call Bean icon.
    • Select a PCML file if you want to bring the information contained in that PCML file into the wizard. Click the Create Program Call Bean icon.
    The Create Program Call Bean icon can be found in the main menu bar.
  2. If you want to retrieve the information defined in an existing PCML file, or if you have an RPG or COBOL source file and want to have a PCML file generated from it, click Import.
    • You can import an existing PCML file that you created, a PCML file that was previously generated by the Program Call wizard, or a PCML file that was generated by the ILE RPG compiler or the ILE COBOL compiler.
    • You can select an RPG or COBOL source file and generate a PCML file directly from it.
    Read the related task on Importing PCML.
  3. To define a program or service program procedure that you want to call, click Add Program. Define a program as described in the related references below. The definition appears in the left pane of the wizard.
  4. To define a parameter required by the program or procedure, select the node that represents the program in the tree view, then click Add Parameter.
  5. When you have defined a program or structure, you can right-click your program, parameter or structure definition in the left pane and select one of the following. (You can also right-click a node in the left pane to add a program or structure definition even if nothing has been defined.)
    • Add Program (to add a program)
    • Add Parameter (to add a parameter to the selected program or structure)
    • Add Structure (to add a structure)
    • Add Database Reference Structure (to create a structure from a database record)
    • Add Database Reference Parameter (to add a parameter from a database field)
    • Add Database Reference Field (to add a field from a database field)
    • Synchronize (to resolve differences between the current properties and the actual properties in the database)
    • Show (to view the properties of a database field)
    • Move Up (to move the selected element up)
    • Move Down (to move the selected element down)
    • Delete (to delete the selected element)

When you have defined at least one program or service program object, you can proceed to the next page of the wizard (Create iSeries program call Java bean and PCML file). Click the links below for further information about this wizard.

Related concepts
Remote calls to iSeries objects
Program call markup language
Related tasks
Creating iSeries program call Java bean and PCML file
Configuring your iSeries Java run time
Editing a program, parameter, or structure
Importing a PCML file
Related reference
PCML data type values for languages and Web components
Data type conversion from database reference
Add program
Add parameter
Add structure