[英]How to make an stateful web service with ejb3?
This is my webservice... With EJB3 + Jboss AS7这是我的网络服务...使用 EJB3 + Jboss AS7
@Stateful
@WebService(serviceName = "teste")
public class TesteWSImpl implements TesteWS {
private List<String> strings;
public TesteWSImpl() {
strings = new ArrayList<String>();
}
@WebMethod
@Override
public List<String> add(String string) {
strings.add(string);
return strings;
}
@PostConstruct
private void init() {
System.out.println("INIT WEB SERVICE. "
+ getClass().getCanonicalName());
}
@PreDestroy
public void destroy() {
System.out.println("DESTROY WEB SERVICE. "
+ getClass().getCanonicalName());
}
}
but in my jboss 7 endpoint is not found.. any idea?但是在我的 jboss 7 端点中没有找到......知道吗? I need keep state of my client我需要保持我的客户的状态
您不能使用 @WebService 注释来注释有状态会话 bean,它仅可用于无状态。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.