Writing Session Bean Web Services 111 Container Service (Web hosting companies)
Writing Session Bean Web Services 111 Container Service Implementation Bean Port Components SEI Service Implementation Bean SEI Figure 5.2 EJB container with port components. The great news is that (almost) no additional coding is required. The only thing that our session bean is missing is a slightly different form of remote interface, which we will add. After that, exposing the bean as a Web Service requires only repackaging and redeploying the application, which now contains a port component. The EJB container will know how to dispatch incoming SOAP messages to our bean implementation and how to map incoming XML data types to Java. The same will happen on the way back: The container just knows how to map our Java return values back into XML, how to build a SOAP response message, and where to send it. Figure 5.2 depicts the additional ports that the container now supports. The JAX-RPC Service Endpoint Interface The simple convention that we mentioned previously is to provide a Java interface to your bean that lists all the business methods supported by the bean. This interface is called the Service Endpoint Interface (SEI) and shown in the following block of code. The remaining HelloBean implementation does not have to be changed to actually implement this interface. All that is required is that the HelloBean support business methods with the same name and signature as those in the remote interface, as shown in the following example: package examples; /** This is the Hello service endpoint interface. */ public interface HelloInterface extends java.rmi.Remote
Here java web hosting you will find professional-grade java web hosting at affordable prices.