title: Accessing the complete server path for a file in a WCF web service
body: <p>I have a web service with a svc file and a codebehind that defines a simple web service using WCF.</p>
  
  <p>Obviously I am hosting the web service on a server using the svc file.</p>
  
  <p>My service needs to access a file in the directory of the web application where the web service resides.</p>
  
  <p>Consider that following structure:</p>
  
  <pre><code>Web application root folder: MyWebApp
  
  MyWebApp (folder) -&gt; Images (folder)
  
  MyWebApp (folder) -&gt; App_Code (folder)
  
  MyWebApp (folder) -&gt; WebServices (folder)
  
  MyWebApp (folder) -&gt; Data (folder)
  
  MyWebApp (folder) -&gt; Web.config (file)
  
  MyWebApp (folder) -&gt; WebServices (folder) -&gt; MyWebService.svc (file)
  
  MyWebApp (folder) -&gt; App_Code (folder) -&gt; MyWebService.cs (file)
  
  MyWebApp (folder) -&gt; Data (folder) -&gt; myfile.txt
  </code></pre>
  
  <p>Well. From the csharp file codebehind web service file I would like to access the xml file located in the appropriate folder for data.</p>
  
  <p>How should I do this??? I cannot have access to a Server object of course...</p>
  
  <p>Thankyou</p>