[Version 5.0.2 and later]Developing a Service Endpoint Interface for a Java bean implementation

Before you begin

Access an existing Java bean WAR file.

Set up a Web services development and unmanaged client execution environment.

The Service Endpoint Interface defines the methods for a particular Web service. The Java bean implementation must implement methods having the same signature as the methods on the Service Endpoint Interface. There are a number of restrictions 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.

You can also create a Service Endpoint Interface by using the Assembly Toolkit, which is a component of the Application Assembly Toolkit. The steps are similar except the Assembly Toolkit automatically compiles the interface when you save it.

Why and when to perform this task

To develop a Service Endpoint Interface for a Java bean implementation:

Steps for this task

  1. Create a Java interface containing the methods to include in the Service Endpoint Interface.
    The interface should extend the java.rmi.Remote interface. Each method throws the exception, java.rmi.RemoteException. If you start with an existing Java interface, remove any methods that do not conform to JAX-RPC. See the example that follows this tasks steps.
  2. Compile the interface.
    Use the javac commands for Windows and UNIX platforms listed in the topic Developing thin application client code to compile the interface. In the javac command, use the name of the Service Endpoint Interface class for the class to be compiled.

Results

A Service Endpoint Interface which you can use to develop a Web service.

Example

This example uses a Java interface called AddressBook. The following example depicts the AddressBook interface:

package addr;
public interface AddressBook {
    /**
     * 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);
}

You use the AddressBook Java interface to create the Service Endpoint Interface:

  1. Begin with the remote interface, AddressBook.java.
  2. Make a copy of the remote interface named AddressBook_SEI.java and use it as a template for the Service Endpoint Interface.
  3. Change the interface to extend the java.rmi.Remote interface.
  4. Modify each method declaration to add a throws clause for java.rmi.RemoteException.
  5. Compile the interface.

What to do next

Use the Service Endpoint Interface to Develop a Web Services Description Language (WSDL) file.

Related tasks
Developing a Web service from a Java bean
Related reference
Artifacts used to develop Web services based on Web Services for J2EE



Searchable topic ID:   twbs_devbeansei
Last updated: Jun 21, 2007 4:55:42 PM CDT    WebSphere Application Server Network Deployment, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/twbs_devbeansei.html

Library | Support | Terms of Use | Feedback