CORBA Web Service Example

Contents

Overview

This demo shows how to use Oracle Web Service Assambler (WSA) to expose a CORBA object as a Web Service. WSA uses a config file (service-config.xml) that contains information about the location of the IDL file (Hello.idl) and CORBA Naming properties to generate a application ear.

To run this example, the orbd and idlj executable files must be accessible in your path. These executables can be found in the JDK1.4 bin directory.

The CORBA servant (CORBA back-end Object) was developed from the IDL file Hello.idl with JDK1.4 For more information about JDK CORBA developement refer to: http://java.sun.com/j2se/1.4.1/docs/guide/corba/index.html

Quick Start

Ensure that you have installed the required software and set up your environment. You must have OC4J running. If it is not running on your localhost on port 8888, you'll have to modify the ANT script (build.xml) to use the correct host and port to your server.

Before you run the example, you need to start the CORBA Naming Server. In another window/terminal, type:

Then you need to run the CORBA servant. In another window/terminal, type:

Once you have OC4J, the CORBA Naming Server, and the CORBA servant running, you can type ant to run the example.

Step By Step
  1. Run Web Service Assembler to create a deployable ear from the WSA config file service-config.xml. This file contains information on the CORBA IDL file location and CORBA naming properties.

    % ant wsa-corba-hello

    This should result in a webservices application file: build/corba_hello.ear

  2. Run CORBA Naming Service:

    % orbd -ORBInitialPort 1050

    or

    % ant run-orbd

    NOTE: The orbd executable can be found in the JDK1.4 bin directory

  3. Compile and Run the CORBA servant object:

    % ant run-servant

  4. Deploy and bind the CORBA WebService application:

    % ant deploy-corba-hello

    Visit the http test page by going to http://localhost:8888/corba_hello/corba_hello to make sure that the application has been deployed properly.

  5. To run the client, type:

    % ant run-corba-hello-client

    You should see result like:

    HelloClient: HelloClient: Hello CORBA We bService!

    You should also see following from CORBA servant:

    CorbaHelloImpl(servant) sayHello : Hello CORBA WebService!

    NOTE: The client code is oracle.demo.corba.HelloClient under client-src directory. In order to compile and run this class, the client-side stub (proxy) needs to be generated and compiled into the client's classpath. The ant target run-corba-hello-client performs all of this. The script runs wsa with the config file stub-config.xml to generate the client proxy.

Troubleshooting