[jboss-user] [EJB 3.0] - Steless Session bean as Webservice

dasariprasad do-not-reply at jboss.com
Sun Sep 28 04:53:49 EDT 2008


i wrote one Stateless bean like

( in mustang version and jboss5.0.0 CR2)

SimpleWS.java (interface)

  | 
  | @WebService
  | @SOAPBinding(style=Style.RPC)
  | public interface SimpleWS extends Remote
  | {
  |   @WebMethod
  |    public  String greet(String person) 
  |             throws RemoteException;
  | }
  | 
  | SimpleWSBean.java 
  |       
  | @Stateless
  | @Remote(SimpleWS.class)
  | @WebService(endpointInterface="com.htc.htcws.SimpleWS")
  | @SOAPBinding(style=SOAPBinding.Style.RPC)
  | public class SimpleWSBean implements SimpleWS
  | {
  |   @WebMethod
  |   public  String greet(String person) 
  |   {
  |    return "Hi "+person+" all Good Wishes for Tamil New Year's Day";
  |   }
  |   
  | }
  | and deployed success fully
  | 
  | but when i run client like
  | SimpleWSClient.java 
  | public class SimpleWSClient
  | { 
  |   static Logger logger;
  | 
  |   public static void main(String[] args)
  |   {   
  |     final String _NAMESPACE = "http://htcws.htc.com/";
  |     final String _SERVICE = "SimpleWSBeanService";
  |   
  |    
  |   try
  |   {
  |    logger = Logger.getRootLogger();
  |     logger.addAppender(new FileAppender(new HTMLLayout(),
  |                                        "mylog1.log",true));  
  |   
  |   
  |    URL url =  
  |      new URL("http://127.0.0.1:10080/simpws/SimpleWSBean?WSDL");
  |  
  |     QName qName = new QName(_NAMESPACE,_SERVICE);
  |     if(args.length!=1)
  |  
  |     {
  |       System.out.print("Give the person-name as args[0]");
  |       System.exit(1);
  |     }  
  |     
  |     
  | 
  |     ServiceFactory sFactory = ServiceFactory.newInstance();
  |     
  |     Service service = sFactory.createService(url,qName);
  | 
  |     System.out.println(".."+service);
  |   
  | 
  |   
  |     SimpleWS invoker =
  |             (SimpleWS)service.getPort(SimpleWS.class); 
  |     System.out.println("##"+invoker);
  | 
  |     String res = invoker.greet(args[0]);
  |     
  |     System.out.println("Response is::"+res);
  |    }
  |    catch(Exception ex)
  |    {
  |        System.err.println("Caught the exception as"+ex);
  |    }
  |   }
  | 
  | }
  | 
  | i am getting the error
  | 
  |   [java] ..org.jboss.ws.core.jaxrpc.client.ServiceImpl at 1a62c31
  |      [java] ##org.jboss.ws.core.jaxrpc.client.CallImpl at 3020ad
  |      [java] Caught the exception asjava.rmi.RemoteException: Call invocation failed; nested exception is: 
  |      [java] 	java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
  | 
  | 
  | same i could able to run with tiger version and jboss422 with no problem

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

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



More information about the jboss-user mailing list