Web Services Invocation Framework:
Invoking the EJB Sample through a high level stub interface

First you need to set up the CLASSPATH in your environment. Beyond the standard classpath setting, you also need to add the J2EE client jar files to your classpath. The set of J2EE client JARs is vendor specific. We have included below instructions for some app servers, follow that link if you happen to be using one of those, otherwise refer to the documentation in your application server on how to set up the environment for an EJB client.

Setting up the client on some app servers

Running the client

After you have set up your classpath, to invoke this sample using a JAX-RPC stub interface, run the Run class located in this directory. This is the logic that uses the generated stub interface to run the sample. So you can run this class, specifying on the command line the location of the WSDL file for the sample. For example,
java ejb.client.stub.Run samples/ejb/AddressBook.wsdl

The sample code will use the stub interface to populate an addressbook with two entries and will then query the addressbook for those two addresses using the corresponding names.

To generate the stub interface, you can use any tool that generates Java interfaces for WSDL services using their port type descriptions, such as WSDL2Java from Axis. WSIF assumes a correspondence between the generated Java interface and the WSDL port type that has its abstract description as specified in the JAX-RPC specification. This particular sample did not use WSDL2Java in a simple way (due to a current bug in WSDL2Java that prevents it from processing WSDLs that do not have a valid SOAP endpoint or binding. We managed to get it to work by commenting out the EJB binding that is currently there, and introducing a binding element that describes a SOAP binding. After doing this, we ran WSDL2Java in the following way:
java org.apache.axis.wsdl.WSDL2Java ../../AddressBook.wsdl
After the tool finished running, we deleted all the generated files except AddressBook.java (this is the java interface corresponding to the port type), Address.java and Phone.java (these two are the java representations of the complex schema types used in the sample).