title: How might I use the W3C Markup Validator API in my .NET application?
body: <p>I found that there's an <a href="http://validator.w3.org/docs/api.html" rel="nofollow noreferrer">API for the W3C Markup Validator</a>.</p>
  
  <p>I had earlier asked:  <a href="https://stackoverflow.com/questions/583409/is-there-a-net-library-for-the-w3c-markup-validator-api">Is there a .NET library for the W3C Markup Validator API?</a></p>
  
  <p><a href="https://stackoverflow.com/users/11208/assaf">Assaf</a>'s <a href="https://stackoverflow.com/questions/583409/is-there-a-net-library-for-the-w3c-markup-validator-api/583433#583433">answer</a>:</p>
  
  <blockquote>
    <p>This API is SOAP based. If you want to
    use it in a .net application you can
    just add the web reference and code
    against it. Seems simple enough as
    it's basically a one-method API...</p>
  </blockquote>
  
  <p>So, I tried to "Add Service Reference" at address <code>http://validator.w3.org/check</code>.</p>
  
  <p>First the dialog displays:</p>
  
  <blockquote>
    <p>Please wait for service information to
    be downloaded...</p>
  </blockquote>
  
  <p>Then:</p>
  
  <blockquote>
    <p>An error ... occurred while attempting
    to find services at
    '<a href="http://validator.w3.org/check" rel="nofollow noreferrer">http://validator.w3.org/check</a>'</p>
  </blockquote>
  
  <p><a href="http://img17.imageshack.us/img17/719/addservicereference.gif" rel="nofollow noreferrer">Visual Studio Add Service Reference Dialog http://img17.imageshack.us/img17/719/addservicereference.gif</a></p>
  
  <p>Error details:</p>
  
  <blockquote>
    <p>The HTML document does not contain Web
    service discovery information.
    Metadata contains a reference that
    cannot be resolved:
    '<a href="http://validator.w3.org/check" rel="nofollow noreferrer">http://validator.w3.org/check</a>'. The
    content type text/html; charset=utf-8
    of the response message does not match
    the content type of the binding
    (application/soap+xml; charset=utf-8).
    If using a custom encoder, be sure
    that the IsContentTypeSupported method
    is implemented properly. The first
    1024 bytes of the response were:</p>
  </blockquote>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;   &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" /&gt;
  &lt;title&gt;
  
          Validation Results - W3C Markup Validator&lt;/title&gt;
      &lt;link rel="icon" href="data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%10%00%00%00%10%08%02%00%00%00%90%91h6%00%00%00%19IDAT(%91c%BCd%AB%C2%40%0A%60%22I%F5%A8%86Q%0DCJ%03%00%DE%B5%01S%07%88%8FG%00%00%00%00IEND%AEB%60%82" type="image/png" /&gt;
  &lt;link rev="made" href="mailto:www-validator@w3.org" /&gt;
  &lt;link rev="start" href="./" title="Home Page" /&gt;
  &lt;style type="text/css" media="all"&gt;@import "./style/base.css";
          @import "./style/results.css";&lt;/style&gt;
  &lt;meta name="keywords" content="HTML, HyperText Markup Language, Validation,
    W3C Markup Validation Service" /&gt;
  &lt;meta name="description" content="W3C's easy-to-use
    H
  </code></pre>
  
  <blockquote>
    <p>If the service is defined in the
    current solution, try building the
    solution and adding the service
    reference again.</p>
  </blockquote>
  
  <p>How can I use the W3C Markup Validator API in my .NET application?</p>