This is my webservice... With 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? I need keep state of my client
You can not annotate an stateful session bean with @WebService annotation, it is only available to stateless.