Develop a service endpoint interface for JAX-RPC applications

 

+

Search Tips   |   Advanced Search

 

Overview

Develop a service endpoint interface if you are developing a JAX-RPC Web service from a JavaBeans implementation.

We need to set up a development environment for Web services and access an existing Java bean Web archive (WAR) file.

This task is a required step in developing a JAX-RPC Web service from a Java bean.

The service endpoint interface defines the methods for particular JAX-RPC Web services. The JavaBeans implementation must implement methods with the same signature as the methods on the service endpoint interface. A number of restrictions apply on which types to use as parameters and results of service endpoint interface methods. These restrictions are documented in the JAX-RPC specification.

You can also create a service endpoint interface by using the assembly tools. Develop a service endpoint interface for a JavaBeans implementation by following the actions listed:

 

Procedure

  1. Create a Java interface that contains 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 name of the service endpoint interface class in the javac command for the class to compile.

    On Windows use the javac commands.

    On *nix systems, use the Linux and Unix platforms cited in Developing thin application client code.

 

Results

You have developed a service endpoint interface used to to develop Web services.

 

Example

  1. Code the AddressBook interface...

     package addr; public interface AddressBook 
    {
        public addr.Address getAddressFromName(java.lang.String name);
    
    }
    

  2. Use the AddressBook interface to create the service endpoint interface:

     cp AddressBook.java AddressBook_SEI.java
    
    

    Use this copy as a template for the service endpoint interface.

  3. Compile the interface.

 

What to do next

Continue to gather 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, you do not have a Web service.



Develop Web services applications from JavaBeans

 

Related Reference

Artifacts used to develop Web services
Web services specifications and APIs