[jboss-user] [JBossWS] - Why interface for EJB3 webservices?

zauberlehrling do-not-reply at jboss.com
Tue Mar 20 14:15:20 EDT 2007


Hi,

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
  | @Remote(EJB3RemoteInterface.class)
  | @RolesAllowed("friend")
  | @Stateless
  | 
  | // jboss propriatary annotations
  | @RemoteBinding(jndiBinding = "/ejb3/EJB3Bean01")
  | @WebContext(authMethod="BASIC", transportGuarantee="NONE", secureWSDLAccess=false)
  | @SecurityDomain("JBossWS")
  | public class EJB3Bean01 implements EJB3RemoteInterface
  | {
  |    @WebMethod
  |    @WebResult(name = "result")
  |    public String echo(@WebParam(name = "String_1") String input)
  |    {
  |       return input;
  |    }
  | }
I also have a small session bean / webservice :
@WebService
  | @Stateless
  | public class EjbEndpoint {
  | 	
  |     @WebMethod
  |     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!

Frank

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029931#4029931

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029931



More information about the jboss-user mailing list