The tool will generate invocation code and a EJB if required. The invocation code with the Axis core classes provides the servlet that Dispatch the SOAP messages. The EJB will have a dummy Remote (Local) interface and dummy Home (LocalHome) interface. They are for deploy the ejb in the container and there existence is transparent from the deployer EWS user.
Figure: The Execution flow when the J2EE Web service is invoked.
Invocation of the Implementation bean when the Web Service is based on Java Class is simple as it is done in the same VM and it is just a java method call. The Implementation bean is initiated using the default constructer and the method is invoked. But the invocation When the Web Service is based on Stateless Session bean is complex as there are three of possible approaches.
java.util.Properties env = PropertyLoader.loadProperties("jndi.properties");
javax.naming.Context initial = new javax.naming.InitialContext(env);
Object objref = initial.lookup("ejb/bookquote");
BookQuoteHome home = (BookQuoteHome)PortableRemoteObject
Context initial = new javax.naming.InitialContext();
Object objref = jndiContext.lookup("java:comp/env/ejb/"bookquote);
BookQuoteHome home = (BookQuoteHome)objref;
ContainerIndex index = ContainerIndex.getInstance();
int length = index.length();
for(int i = 0;i < length;i++){
EJBContainer contianer = index.getContainer(i);
if(contianer!= null){
String name = contianer.getEJBName();
if("BasicStatelessBean".equals(name)){
Class bean = Class.forName("org.openejb.test.stateless.BasicStatelessBean");
Object[] arguments = new Object[]{isbn};
Object result = container.invoke(callMethod, arguments, null);
return result;
}
}
}
The security and transaction information are intercepted at the Axis Handlers and processed or propagated in to the J2EE container. For more information please refer to the security and transaction sections.