title: Configuring XML-RPC behavior for IIS-hosted .SVC file?
body: <p>I'm using <a href="http://vasters.com/clemensv/PermaLink,guid,679ca50b-c907-4831-81c4-369ef7b85839.aspx" rel="nofollow noreferrer">Clemens Vasters'</a> XML-RPC implementation to implement an XML-RPC endpoint. When I host the service in a console application, it works fine.</p>
  
  <p>I'd like to host it in an ASP.NET MVC application, so I'm using a .SVC file. This is partially working. When I browse to the .SVC file, I see the usual "You have created a service" stuff.</p>
  
  <p>However, when I point my XML-RPC client (Windows Live Writer) at the same location, I get a "400 Bad Request". I'm guessing that this is because my service isn't correctly exposed as XML-RPC.</p>
  
  <p>I've attempted to <a href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b897113f-a69f-42f6-bbd6-8511b043b279" rel="nofollow noreferrer">configure an endpoint behavior in Web.config</a>, as follows:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
    &lt;services&gt;
      &lt;service name="AnotherBlogEngine.Web.Api.BlogApi"&gt;
        &lt;endpoint address=""
                  binding="webHttpBinding"
                  contract="AnotherBlogEngine.Web.Api.IBlogApi"
                  behaviorConfiguration="xmlRpcBehavior" /&gt;
    &lt;/service&gt;
    &lt;/services&gt;
    &lt;extensions&gt;
      &lt;behaviorExtensions&gt;
        &lt;add name="xmlRpc"
             type="AnotherBlogEngine.XmlRpc.XmlRpcEndpointBehaviorElement, \
                   AnotherBlogEngine.XmlRpc" /&gt;
      &lt;/behaviorExtensions&gt;
    &lt;/extensions&gt;
    &lt;behaviors&gt;
      &lt;endpointBehaviors&gt;
        &lt;behavior name="xmlRpcBehavior"&gt;
          &lt;xmlRpc/&gt;
        &lt;/behavior&gt;
      &lt;/endpointBehaviors&gt;
    &lt;/behaviors&gt;
  &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>...but it's not working. What am I doing wrong? Do I have my Web.config correct, or do I have it all completely wrong? Do I need to provide a custom factory in my .SVC file to sort out the behaviors?</p>
  
  <p>The .SVC file looks like this, by the way:</p>
  
  <pre><code>&lt;%@ ServiceHost Language="C#" Debug="true"
      Service="AnotherBlogEngine.Publishing.Service.BlogApi, \
               AnotherBlogEngine.Publishing.Service" %&gt;
  </code></pre>
  
  <p><strong>Note</strong>: Those backslashes aren't actually there; they're just for line-wrapping.</p>
  
  <p>Also, at the moment, I'm just testing this in Cassini (VS2010), rather than IIS, but I'll be aiming it at IIS 7.x.</p>
  
  <p><strong>Update:</strong> It's definitely at least looking at my extension: it calls <code>XmlRpcEndpointBehaviorElement.get_BehaviorType</code>, and if <code>XmlRpcEndpointBehavior</code> doesn't implement <code>IEndpointBehavior</code>, I get an error to that effect (displayed in place of the "You have created a service" page).</p>
  
  <p>However, breakpoints on the other methods in either class don't get hit.</p>
  
  <p>If I turn on WCF tracing, I see "unrecognized message version" in the log file.</p>