I'm running a SOAP server in java on Google App Engine. According to the JAX-WS documentation, you can access the servlet context in a web service by including a WebServiceContext variable and annotating it with the
@Resource annotation but that doesn't appear to work in the GAE server.
The WebServiceContext is listed on the java class white page list -
https://developers.google.com/appengine/docs/java/jrewhitelist - so I'm assuming it's possible. Has anyone done this successfully?
@WebService
public class MyWebService {
@Resource
private WebServiceContext wsContext;
@WebMethod
public int setActive() {
ServletContext servletContext = wsContext.getMessageContext().get(MessageContext.SERVLET_CONTEXT);
servletContext.setAttribute("active", Boolean.TRUE);
return 0;
}
}