I've found the solution: inject the WebServiceContext.
@WebService
public class MyService {
@Resource
private WebServiceContext wsContext;
@WebMethod
public String myMethod(){
try{
MessageContext mc=wsContext.getMessageContext();
ServletContext sc=(ServletContext)mc.get(MessageContext.SERVLET_CONTEXT);
String path=sc.getRealPath("/resources/myMessageTemplate");
}catch(Exception e){
//TODO
}
}
}
[Message sent by forum member 'aperezymadrid' (aperezymadrid)]
http://forums.java.net/jive/thread.jspa?messageID=257042