title: asp.net / [WebMethod] - exception only serialized for localhost?
body: <h2>Summary</h2>
  
  <p>Exception serialization behaviour for [WebMethod] differs between 'all on same server' use and 'real world use'.</p>
  
  <h2>Situation</h2>
  
  <p>I have a webservice implemented, in <strong>foo.aspx</strong>, like this :</p>
  
  <pre><code>[WebMethod]
  [ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json, XmlSerializeString = false)]
  public static Fruit InsertUpdateFruitWebService()
  {
      return FruitHelper.InsertUpdateFruit();
  
  }
  </code></pre>
  
  <p>The webservice is called from within <strong>bar.aspx</strong> using jQuery - $.ajax.</p>
  
  <p>If some sort of problem occurs in <strong>InsertUpdateFruit</strong> an exception is thrown, the 'error' callback specified within $.ajax is invoked and a JSON blob is passed as an argument to the 'error' callback function.</p>
  
  <h2>The Good News</h2>
  
  <p>When the browser and the server are on the same machine this all works fine.</p>
  
  <h2>The Not So Good News</h2>
  
  <p>When the browser and the server are not the same machine all you get in the JSON blob passed as an argument to the 'error' callback is this :</p>
  
  <pre><code>{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}
  </code></pre>
  
  <p>No stacktrace, no exception details, etc.</p>
  
  <h2>The Question</h2>
  
  <p>Can anyone point me in the direction of what might cause this ?</p>