Show TOC Start of Content Area

Procedure documentation Generating C++ Code for the Rest of the CallbackApplication Classes  Locate the document in its SAP Library structure

Use

You use the same tool that you used in the previous step to generate the C++ files out of the IDL files that you generated against the UtilCallback bean’s remote and home interfaces. You just execute the corresponding command with different options that instruct the tool not to generate skeletons for those objects.

You must run the idl tool against the IDL files that are located in three different directories. They are subdirectories of the one that you specified with the –d option of the rmic command when you generated the IDL representation of the CallbackApplication, as described in Generating IDL Representation of the Callback Application:

·        ..\examples\iiop – run the command against the UtilCallback.idl and UtilCallbackHome.idl files.

·        ..\java\lang – run the command against all classes from this directory.

Note

This note only applies if you are using the ORBacus ORB and the idl tool provided with it to generate the C++ files. In this case, you must open (in a text processing application) the Throwable.idl file located under the ..\java\lang subdirectory. Find the line containing the following code:

custom valuetype Throwable {

and remove the custom keyword. Then save the file.

This change is necessary since it causes an error to the idl tool that will not let you generate the C++ files.

·        ..\javax\ejb - run the command against all classes from this directory.

Prerequisites

You must have installed the appropriate ORB software on your machine so that you can use its tools to generate C++ files out of the IDL ones.

Procedure

Execute the idl.exe file that is located under the <orbacus_ dir>\bin directory on your machine against the files mentioned above. Provide the following options with the command:

·        Use the --no-skeletons option to instruct the tool not to generate skeletons.

·        Use the --output-dir to specify the directory where the generated C++ files are to be saved.

Note

Make sure that you specify an existing directory in the directory path you specify with this option. If your path includes a non-existing directory, the tool will not create one, rather it will generate an error and the C++ files generation will fail.

·        Use the –I<dir> option to include paths to directories that you want to be available to the tool to search for files in. You can use the –I<dir> option several times on a single command line if you need to specify several paths. For our example, you need to include the following directories:

¡        The directory where the IDL representations of the classes from the java.lang package used by the UtilCallback bean are stored;

¡        The directory where the IDL representations of the classes from the javax.ejb package used by the UtilCallback bean are stored;

¡        <orbacus_dir>\idl directory;

¡        <orbacus_dir>\idl\OB directory;

·        Enter the full directory path to the files (including the filenames) to tell the idl tool which IDL files to run against. You can use wildcard symbol to denote multiple files, for example, *.idl to select all IDL files in the directory.

Result

You have successfully generated the C++ files that represent the Callback Application. Now you can insert those files in the Microsoft Visual Studio development environment that you use and continue with the implementation of the callback object and the client itself.

Next Step:

Implementing the Callback Object

 

End of Content Area