Java Reference
In-Depth Information
We shall use the first method. Create a remote business interface instance using
lookup with the mapped name:
CatalogSessionEJBRemote beanRemote =(CatalogSessionEJBRemote)context.
Invoke the test() method of the session bean and return the String value returned
from the testClient method, which is a web service operation:
The Web Service class is listed as follows:
import javax.jws.WebService;
public class EJB3WSImpl {
public EJB3WSImpl() {
public String testClient() {
String catalog = "EJB 3.0 Web Service";
try {
Properties properties = new Properties();
InitialContext context = new InitialContext(properties);
CatalogSessionEJB beanRemote =
} catch (NamingException e) {catalog=e.getMessage();
return catalog;
Creating a web service client
Next, we create a JAX-RPC Java client for the web service. First, create a Java
class EJB3WSClient . In the Java client application, create an instance of the
EJB3WSImplService service:
EJB3WSImplService service = new EJB3WSImplService();
Search WWH ::

Custom Search