WebSphere Application Server Network Deployment, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Developing a service endpoint interface from an EJB

This topic explains how to develop a service endpoint interface from an Enterprise JavaBeans (EJB).

Before you begin

Set up a Web services development and unmanaged client run-time environment.

This task is a required step in developing a Web service from an enterprise bean.

The service endpoint interface defines the Web services methods. The enterprise beans that implements the Web service must implement methods having the same signature as the methods of the service endpoint interface. A number of restrictions exist on which types to use as parameters and results of service endpoint interface methods. These restrictions are documented in the Java API for XML-based remote procedure call (JAX-RPC) specification, which is available through Web services: Resources for learning.

The easiest method for creating the service endpoint interface for an EJB Web service implementation is from the EJB remote interface.

You can also create a service endpoint interface by using the assembly tools.

Why and when to perform this task

Develop a service endpoint interface by following the steps provided in this task section.

Steps for this task

  1. Create a Java interface containing the methods to include in the service endpoint interface. If you start with an existing Java interface, remove any methods that do not conform to the JAX-RPC specification.
  2. Compile the interface. Use the javac commands for Windows platform, and the Linux and Unix platforms that are listed in the Developing thin application client code topic to compile the interface. In the javac command, use the name of the service endpoint interface class for the class to compile.

Result

You have a service endpoint interface that you can use to develop a Web service.

Example

package addr;
public interface AddressBook_RI extends javax.ejb.EJBObject {
    /**
     * Retrieve an entry from the AddressBook.
     * 
     *@param name the name of the entry to look up.
     *@return the AddressBook entry matching name or null if none.
     *@throws java.rmi.RemoteException if communications failure.
     */
    public addr.Address getAddressFromName(java.lang.String name) 
    	throws java.rmi.RemoteException;
}
  1. Locate a remote interface that has already been created, like the AddressBook_RI.java remote interface.
  2. Make a copy of the AddressBook.java remote interface and use it as a template for the service endpoint interface.
  3. Compile the AddressBook.java service endpoint interface.

What to do next

Continue gathering the artifacts that are required to develop a Web service, including the Web Services Description Language (WSDL) file. You need to develop a WSDL file because it is the engine of a Web service; without a WSDL file, you have no Web service.



Related tasks
Developing a Web service from an enterprise bean

Related reference
Artifacts used to develop Web services

Task topic    

Terms of Use | Feedback

Last updated: Mar 17, 2005 4:28:29 AM CST
http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/twbs_devejbsei.html

© Copyright IBM Corporation 2002, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)