title: SharePoint: how to know web service's host SPSite's url
body: <p>I have a web service hosted under a SPSite, whose url is <a href="http://server/sites/blank/_layouts/_vti_bin/service.asmx" rel="nofollow">http://server/sites/blank/_layouts/_vti_bin/service.asmx</a>.</p>
  
  <p>In a web service method, HttpContext.Current.Request.Url looks like <a href="http://server/_vti_bin/service.asmx/Method" rel="nofollow">http://server/_vti_bin/service.asmx/Method</a>, which makes sense, as IIS doesn't know anything about SPSite's.</p>
  
  <p>But, SPContext.Current is null :-(</p>
  
  <p>How can I know the url where service is being hosted? Am I missing something that instantiates SPContext.Current for ex. during deployment of the service?</p>
  
  <p>Thanks!</p>