1 22 package org.jboss.test.webservice.ws4eesimple; 23 24 import javax.ejb.SessionBean ; 25 import javax.ejb.SessionContext ; 26 import javax.naming.Context ; 27 import javax.naming.InitialContext ; 28 import javax.xml.rpc.Service ; 29 import java.rmi.RemoteException ; 30 31 public class HelloClientBean implements SessionBean 32 { 33 34 public String sayHello(String input) throws RemoteException 35 { 36 try 37 { 38 InitialContext iniCtx = new InitialContext (); 39 Service service = (Service ) iniCtx.lookup("java:comp/env/service/HelloService"); 40 HelloWs sei = (HelloWs) service.getPort(HelloWs.class); 41 42 String output = sei.sayHello(input); 43 return output; 44 } 45 catch (Exception e) 46 { 47 return e.toString(); 48 } 49 } 50 51 53 public void ejbCreate() 54 { 55 } 56 57 public void ejbRemove() 58 { 59 } 60 61 public void ejbActivate() 62 { 63 } 64 65 public void ejbPassivate() 66 { 67 } 68 69 public void setSessionContext(SessionContext sc) 70 { 71 } 72 } 73 | Popular Tags |