WebLogic Server 6.1 Code Examples, BEA Systems, Inc.

Package examples.iiop.rmi.cppclient

This directory contains a c++ client which can be used to call either a Tuxedo Server or a WebLogic Server and also demonstrate server to server connectivity using the underlying WebLogic Tuxedo Connector technology. You must have Visibroker 4.1 installed on your machine in order to get the example running. You set the location of visibroker by modifying the iiop.properties located in the WL_HOME/samples/examples/iiop folder (for example, it would likely be set to INPRISE_HOME=c:/Inprise/vbroker). You also need a C++ compiler; this example used Microsoft Visual C++. Make sure that your PATH is set so that the compiler can be run.

Before you run the client applications in this directory, be sure to build the full example. This includes building the WebLogic Server and, if you wish to run through the Tuxedo Server, the Tuxedo Server (iiop/rmi/server/tux) as well. Make sure you have run through the set up and building on the WebLogic Server side first and then attempt going through the Tuxedo Server. The following links lead to instructions on setting up the servers:

  • WebLogic Server
  • Tuxedo Server

    Be sure to also take a look at the C++ client code.

    Visibroker

    There are many bugs in Visibroker that make configuring your files and environment correctly a difficult process (Note how we must force GIOP version below). This example demonstrates using Visibroker with an EJB, but it also simultaneously demonstrates how difficult this process can be. It is not recommended to utilize this sort of implementation in production systems.

    Configure WebLogic

    Due to a Visibroker bug in GIOP 1.2 you must force Visibroker to use GIOP 1.1. You can do this by adding the DefaultGIOPMinorVersion element to your Server MBean in the config.xml contained in the WL_HOME/config/examples directory. For example:
    <Server AcceptBacklog="50" AdministrationPort="0" ClusterWeight="1"
            ConsoleInputEnabled="false" DGCIdlePeriodsUntilTimeout="2"
            DefaultGIOPMinorVersion="1" DefaultProtocol="t3"
            DefaultSecureProtocol="t3s" HttpdEnabled="true"
            JavaCompiler="C:\BEA\jdk131/bin/javac" ListenPort="7001"
            Name="examplesServer" NativeIOEnabled="true"
            RootDirectory="C:\BEA\wlserver6.1"
            SocketReaderTimeoutMaxMillis="10"
            TransactionLogFilePrefix="config/examples/logs/"
            TunnelingClientPingSecs="45" TunnelingClientTimeoutSecs="40"
            XMLEntityCache="XMLCacheMBean" XMLRegistry="examplesXMLRegistry">
    

    Build the example

    1. Set up your development shell as described in Setting up your environment.

    2. Execute the build script provided for this example in the samples\examples\iiop\rmi\cppclient directory of your WebLogic Server installation.

    Run the Example

    1. Open a separate command-line window in which you will run the client.

    2. Set up the environment for your client as described in Setting up your environment for building and running the examples.

    3. Run the client by executing the Client.exe:
      
      Client.exe -ORBInitRef NameService=iioploc://localhost:7001/NameService 
      

      Enter the correct hostname and port for your particular configuration. You should see the Ping! message in the WebLogic server log.

    4. To run the client through Tuxedo make sure you have built and properly configured the included components necessary for both the Tuxedo server and WebLogic (iiop/samples/examples/ejb/stateless/server/wls and iiop/samples/examples/ejb/stateless/server/wls). Then run the RMI application with the following command:
      
       Client -ORBInitRef NameService=iioploc://ip_address:2468/NameService 
      

      Enter the correct ip address and port for your particular Tuxedo configuration. You should see the Ping! message in the Tuxedo ULOG where you booted your Tuxedo Server.

    5. To demonstrate server to server connectivity add true to the end of either command (i.e. Client.exe -ORBInitRef NameService=iioploc://localhost:7001/NameService true). If you have set up both your environments correctly, the server you have called will make an outbound call to the other server (either Tuxedo or WebLogic) and you should see Ping! in that servers log. In the Tuxedo case, this will be the ULOG where you booted your Tuxedo Server.

    There's more...

    Read more about WebLogic RMI over IIOP in the Developer Guide, Using WebLogic RMI over IIOP.

    Read more about WebLogic EJB in the Developer Guide, BEA WebLogic Server Enterprise JavaBeans.

    Read more about WebLogic RMI in the Developer Guide, Using WebLogic RMI.

    For more information about WebLogic Server WebLogic Tuxedo Connector, see:

    Documentation is available at
    http://e-docs.bea.com/wls/docs61

    Copyright © 2001 BEA Systems, Inc. All Rights Reserved.