|
| WebLogic Server 6.1.0a1 Code Examples, BEA Systems, Inc. |
Package examples.rmi_iiop.hello C++ client
The files in this package are used to create a C++ CORBA client that
accesses the remote object created in the Hello
example.
See:
Description
Class Summary |
HelloClient |
This CORBA client initializes an ORB, obtains a reference to the
HelloServer, and calls HelloServer methods.
|
Package rmi_iiop.hello C++ client Description
The files in this package are used to create a C++ CORBA client that
accesses the remote object created in the Hello
example. The client was created to use
VisiBroker for C++, version 4.0.
The following instructions assume you have installed VisiBroker for C++ and
Microsoft Visual C++.
The following section describes how to build and run the examples:
- Build the example
- Run the example
- This example uses the RMI remote object created in the Hello
example. You must first build and deploy the Hello example.
- Set up your development shell as described in
Setting up your environment.
- Note: Edit the variable VISIBROKER_HOME
and MSVC_HOME in the build_c++_client file
provided for this example in the samples/examples/rmi_iiop/hello directory for your
VisiBroker for C++ and Microsoft Visual C++ installation.
- Execute the build_c++_client script provided for this example
in the samples/examples/rmi_iiop/hello directory
as shown in this example for Windows NT/2000:
$ build_c++_client
The preceding script will perform the following steps:
- Set the PATH as shown in this example for Windows NT:
$ set PATH=%PATH%;%WL_HOME%\lib;%VISIBROKER_HOME%\bin;%VISIBROKER_HOME%\lib;%MSVC_HOME%\bin
where:
- WL_HOME
- WebLogic Server installation directory
- VISIBROKER_HOME
- VisiBroker installation directory
- MSVC_HOME
- Microsoft Visual C++ installation directory
- Compile the HelloWorld.idl file located in the samples\examples\rmi_iiop\hello\idlSources\examples\rmi_iiop\hello
directory with the VisiBroker idl2cpp utility as shown in this example for Windows NT:
$ idl2cpp -I%WL_HOME%\lib -IidlSources -src_suffix cpp idlSources\examples\rmi_iiop\hello\HelloWorld.idl
where WL_HOME is the WebLogic Server installation directory.
- Compile the Remote.idl file located in the samples\examples\rmi_iiop\hello\idlSources\java\rmi
directory with the VisiBroker idl2cpp utility as shown in this example for Windows NT:
$ idl2cpp -I%WL_HOME%\lib -IidlSources -src_suffix cpp idlSources\java\rmi\Remote.idl
- Create a java and java\rmi directory under rmi_iiop\hello\cpp directory and copy the Remote*.* files generated in the previous step to the java\rmi directory.
$ mkdir java java\rmi
$ copy Rem*.* cpp\java\rmi
$ copy HelloWorld_* cpp
$ cd cpp
- Compile the HelloClient.cpp and HelloWorld_c.cpp file located in the samples\examples\rmi_iiop\hello\cpp directory
and create the executable HelloClient.exe file as shown in this examples for Windows NT:
$ CL -DWIN32 /GX /MD -I%VISIBROKER_HOME%\include
-I%MSVC_HOME%\include /Z7 -DVISIBROKER HelloClient.cpp HelloWorld_c.cpp /link /libpath:%VISIBROKER_HOME%\lib /out:HelloClient.exe
where:
- VISIBROKER_HOME
- VisiBroker installation directory
- MSVC_HOME
- Microsoft Visual C++ installation directory
Run the example
- Start the WebLogic Server in a command shell.
- In a new command shell, set up your development shell as described in
Setting up your environment.
- Obtain the WebLogic Server Inter-operable Object Reference (IOR) by running the
host2ior utility as shown in this example for Windows NT:
$ java utils.host2ior hostname port
where:
- hostname
- Host name of the WebLogic Server
- port
- Port where the WebLogic Server is listening for connections
(weblogic.system.ListenPort).
The WebLogic Server IOR will be returned to the console. Select and copy the IOR to the clipboard. The console
may insert line breaks into the IOR where it wraps to the next line. You must remove the linebreaks before pasting the IOR
into the command-line argument list of an RMI over IIOP example. You can remove the line breaks by pasting into the IOR into
an text editor, deleting the linebreaks, then re-copying the IOR to the clipboard.
-
In the Client shell, run HelloClient.exe with the following command:
$ HelloClient ServerIOR
where ServerIOR is the IOR you obtained by
running the host2ior utility.
There's more...
Read more about:
Copyright © 2000 BEA Systems, Inc. All rights reserved.