title: ASP.NET Web Service ignores [NonSerialized] hook
body: <p>I'm trying to implement a SOAP service in ASP.NET using C# so I can consume it with Flex - but that's the next step. The problem I'm having is that I'm trying to communicate with a server-side class which has an <code>XmlNamespaceManager</code> field within a <code>[Serializable]</code> class:</p>
  
  <pre><code>[Serializable]
  public class Site {
  ...
  public XmlNamespaceManager xmlNS;
  ...
  }
  </code></pre>
  
  <p>I've tried appending the <code>[NonSerialized]</code> hook onto the problematic field, but my SOAP service doesn't seem to be obeying my instructions. Here's the service:</p>
  
  <pre><code>public class DotNetWikiService : WebService
  {
  
      [WebMethod]
      public Article doWork(Site ws, String title)
      {
          Page thePage = new Page(ws, title);
          thePage.Load();
  
          if (thePage.Exists() == false)
          {
              return new Article(title, "Wiki page contents are empty.");
          }
  
          return new Article(title, thePage.text);
      }
  }
  </code></pre>
  
  <p>and here's the error I get when I try and run the .asmx file:</p>
  
  <blockquote>
    <p>To be XML serializable, types which inherit from IEnumerable must have 
    an implementation of Add(System.Object) at all levels of their inheritance 
    hierarchy. System.Xml.XmlNamespaceManager does not implement Add(System.Object).</p>
  </blockquote>
  
  <p>Now, I'm aware that <code>XmlNamespaceManager</code>s are not serializable, so I've tried to indicate this, but something's going awry and I don't know what to do. </p>
  
  <p>Help, please? :D</p>