Using the ejb2pb125 tool
You can also use the ejb2pb125 command-line
tool to generate proxies. The tool generates:
-
Proxies
(.srx files) for the home and remote interfaces
of the EJB you specify and for the classes on which the EJB depends. -
A PowerBuilder structure object named ejbname_ejb_pb_mapping.srs, where ejbname is
the name of the EJB. This structure hosts the mapping table between
the Java class name and the PowerBuilder proxy name. -
A text file called ejbproxies.txt or,
if errors occur, ejbproxies.err.
These files are generated in the directory in which you invoke
the command. The syntax is:
1 |
ejb2pb125 [ -classpath <span>pathlist </span>] <span>EJBName</span> [<span>EJBHomeName</span>][<span> prefix </span>] |
If the pathlist argument contains spaces,
for example D:Program Files,
the pathlist must be enclosed in quotes. EJBName is
the fully qualified remote interface class name. If you use the
standard naming convention for the home interface, then including
an argument for the fully qualified home interface name, EJBHomeName,
is optional. If you specify the optional prefix,
it is added to the beginning of the generated proxy name.
For example, the following statements generate proxies for
the Portfolio class in the package cocoPortfolio on EAServer. The proxies for the home
and remote interfaces of the Portfolio class have the prefix pf_,
and the generated files are written to the directory D:workproxies:
1 |
cd D:workproxies<br>ejb2pb125 -classpath "D:Program FilesSybaseEAServerhtmlclasses" cocoPortfolio.Portfolio pf_ |
The home and remote classes for the EJB and any dependent
classes must be in the class path that you specify.
After generating the proxies, you import them into your target
by selecting the library that contains the client, selecting Import
from its pop-up menu, and selecting the .srx files
from the dialog box that displays. The order in which you import
.srx files is significant—you cannot
import proxies that depend on other classes until you have imported
the proxies for the dependent classes.