Steless Session bean as Webservice
dasariprasad Sep 28, 2008 4:53 AMi 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@1a62c31
[java] ##org.jboss.ws.core.jaxrpc.client.CallImpl@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