Develop a service endpoint interface from enterprise beans for JAX-RPC applications


 

+

Search Tips   |   Advanced Search

 

The easiest method for creating the service endpoint interface for an EJB Web service implementation is from the EJB remote interface. We can also create a service endpoint interface by using assembly tools.

  1. Create a Java interface that contains the methods to include in the service endpoint interface. If we start with an existing Java interface, remove any methods that do not conform to the JAX-RPC specification.

  2. Compile the interface.

    Use the name of the service endpoint interface class in the javac command for the class to compile.

    On operating systems such as AIX or Linux, see the developing thin application client code documentation.

 

Example

This example uses the EJB remote interface, AddressBook_RI, to create a service endpoint interface for an EJB implementation used as a Web service.

 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;
}

Use the following steps to create the service endpoint interface with the AddressBook_RI remote interface:

  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.

 

Next steps

Continue gathering the artifacts that are required to develop a Web service, including the WSDL file. we need to develop a WSDL file because it is the engine of a Web service; without a WSDL file, we have no Web service.

 

Related tasks

Assembly tools Implementing Web services applications with JAX-RPC
Implementing Web services applications from existing WSDL files with JAX-RPC
Set up a development environment for Web services
Develop a WSDL file for JAX-RPC applications

 

Related

Artifacts used to develop Web services
Web services specifications and APIs