title: Configure endpoint for web service declared with WebService() attribute
body: <p>We have a C# Web Service that declares itself using attributes.  The code-behind file looks like:</p>
  
  <pre><code>[WebService(Namespace = "http://the.web.service.url/")]
  [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  public sealed class TheWebservice : WebService
  {
      [WebMethod]
      public SomeObject TheFunction()
      ...
  </code></pre>
  
  <p>The web services has worked for a long time now.  Recently, one request resulted in an error:</p>
  
  <blockquote>
    <p>The maximum string content length
    quota (8192) has been exceeded while
    reading XML data.</p>
  </blockquote>
  
  <p>After searching around, I found that there is a setting maxStringContentLength that can increase the meaximum size.  The post says you can configure this setting in Web.config in the <code>BasicHttpBinding</code> section.  You can then specify that <code>BasicHttpBinding</code> in an <code>endpoint</code> section.  But since we declare the webservice using the <code>WebService</code> attribute in the code-behind file, we do not have an <code>endpoint</code> section.</p>
  
  <p>Is there a way to specify an endpoint using a declarative attribute? Alternatively, is it possible to switch from attribute to web.config mode without breaking existing clients?  Am I confusing WCF and its predecessor here?</p>