title: Asp.Net web service: I would like to return error 403 forbidden
body: <p>I have got a web service programmed in c#  / asp.net.</p>
  
  <pre><code>[WebService(Namespace = "http://example.com/")]
  [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  [ScriptService]
  [System.ComponentModel.ToolboxItem(false)]
  public class Service: System.Web.Services.WebService
  {
  
      [WebMethod]
      [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
      public Result GetData()
      {
          User user = GetUser();
  
          if (user.LoggedIn)
          {
              return GetData();
          }
          else
          {
              // raise exception -&gt; return error 403
          }
      }
  </code></pre>
  
  <p>How is it possible to return error 403 out of this web service? I can throw an exception - but this shows the exeption and not his error.</p>
  
  <p>Any ideas?</p>