You would get teh WebServiceContext injected in:
@Resource
WebServiceContext ctx;
Then do something like:
ctx.getMessageContext().get(MessageContext,SERVLET_CONTEXT);
to get the Servlet context and go from there.
Dan
On Thursday 22 April 2010 1:27:14 pm Alasdair J G Gray wrote:
> Hi,
>
> I have spent the last few hours trying to find an answer for this on the
> web without any joy.
>
> I have a Web service implementation that uses another module to provide its
> functionality. This module needs to be able to access the local file
> system on the server to read in configuration files, and generate output.
> How do I inform the service implementation of the context?
>
> With a java servlet I would use something of the form
> String prefix = getServletContext().getRealPath("/");
> String filename = prefix + "etc/configFile.xml";
> What is the CXF service implementation equivalent?
>
> Thanks,
>
> Alasdair
>
> Dr Alasdair J G Gray
> Research Associate
> [email protected]
>
> Room 2.126
> School of Computer Science
> Kilburn Building
> University of Manchester
> Oxford Road
> Manchester
> M13 9PL, UK
>
> tel: (+44) 0161 275 6132
> fax: (+44) 0161 275 6204
>
> Please consider the environment before printing this email.
--
Daniel Kulp
[email protected]
http://dankulp.com/blog