Web Services Invocation Framework:
EJB Sample

This sample aims to demonstrate the invocation of an EJB through WSIF's API. This means that an EJB is exposed as a first class WSDL-described service using the EJB binding extensions defined in WSIF.

In this particular sample, we describe an AddressBook service, a common example in various Web services toolkits. For those unfamilar with it, this service offers a port type with three operations. Two of the operations add an entry to the address book, using slightly different styles for providing input information. The third operation queries the address book with a name. The service uses complex schema types for representing an address and a phone number.

The abstract functionality is tied to an EJB binding that describes how a stateful session bean supports the abstract port type defined. It is worth emphasizing that this isn't a standard WSDL binding, instead it exploits WSDL's extensibility to describe how to access the abstract functionality when it is deployed and available on an EJB. You will notice that the <ejb:address> element in the AddressBook WSDL refers to an initial context factory that gets used by WSIF's EJB provider. The classpath specified here is vendor specific and will need to be changed depending on your particular deployment, we have provided instructions in the service deployment documentation we link to below.

The WSDL file is in this sample directory; this has the EJB binding.

Here's how this service is implemented. We also describe how to deploy the EJB on a J2EE platform of your choice.

Here's how to invoke this service dynamically using WSIF's dynamic invocation interface (DII).

Here's how to invoke this service by first generating the stub interface and using this directly through WSIF's dynamic proxy, thus hiding all WSIF specifics from the client code. Note that the stub interface used is the the service interface as defined by the JAX-RPC specification.

Deployment of an EJB as well as acessing and using it is vendor-specific. We have included instructions for deploying and using this sample in particular app server environments; even if your favorite app server isn't part of our list, we have provided enough documentation so that it should not be hard to run this sample in a different environment.