2 Replies Latest reply on Mar 20, 2007 10:29 PM by monowai

    Why interface for EJB3 webservices?

    Frank Zartmann Newbie


      I'm investigating your examples in jbossws-samples-1.2.0.SP1.
      In your example for EJB3 webservices you use two classes:

      1) An interface (EJB3RemoteInterface)
      2) The stateless session bean implementing the operation of the webservice (EJB3Bean01)

      // standard JSR181 annotations
      @WebService(name = "EndpointInterface", targetNamespace = "http://org.jboss.ws/samples/jsr181ejb", serviceName = "TestService")
      @SOAPBinding(style = SOAPBinding.Style.RPC)
      // standard EJB3 annotations
      // jboss propriatary annotations
      @RemoteBinding(jndiBinding = "/ejb3/EJB3Bean01")
      @WebContext(authMethod="BASIC", transportGuarantee="NONE", secureWSDLAccess=false)
      public class EJB3Bean01 implements EJB3RemoteInterface
       @WebResult(name = "result")
       public String echo(@WebParam(name = "String_1") String input)
       return input;

      I also have a small session bean / webservice :
      public class EjbEndpoint {
       public String sayHello(String name)
       return "Hello "+name+"!";

      and I can successfully deploy this session bean / webservice to jboss-5 Beta 2. Even I am able to call the webservice.

      My question: What's the purpose of the interface? Have I missed something?

      Thanks in adavance!