These are the basic steps for creating the service:
1. Code the service endpoint interface and implementation class.
A service endpoint interface must conform to a few rules: • It extends the java.rmi.Remote interface. • It must not have constant declarations, such as public final static. • The methods must throw the java.rmi.RemoteException or one of its subclasses. (The methods may also throw service-specific exceptions.) • Method parameters and return types must be supported JAX-RPC types. See the section Types Supported By JAX-RPC (page 456). In this example, the service endpoint interface is HelloIF.java: package helloservice; import java.rmi.Remote; import java.rmi.RemoteException; public interface HelloIF extends Remote { public String sayHello(String s) throws RemoteException; }
In addition to the interface, you’ll need the class that implements the interface. In this example, the implementation class is called HelloImpl: package helloservice; public class HelloImpl implements HelloIF { public String message =“Hello“; public String sayHello(String s) { return message + s; } }
2. Build, generate, and package the files required by the service.
The process includes below steps:
• compile-service
• generate-sei-service
• package-service
• process-war
3. Deploy the WAR filethat contains the service.