I'm using Clemens Vasters' XML-RPC implementation to implement an XML-RPC endpoint. When I host the service in a console application, it works fine.
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.
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.
I've attempted to configure an endpoint behavior in Web.config, as follows:
<system.serviceModel>
<services>
<service name="AnotherBlogEngine.Web.Api.BlogApi">
<endpoint address=""
binding="webHttpBinding"
contract="AnotherBlogEngine.Web.Api.IBlogApi"
behaviorConfiguration="xmlRpcBehavior" />
</service>
</services>
<extensions>
<behaviorExtensions>
<add name="xmlRpc"
type="AnotherBlogEngine.XmlRpc.XmlRpcEndpointBehaviorElement,
AnotherBlogEngine.XmlRpc" />
</behaviorExtensions>
</extensions>
<behaviors>
<endpointBehaviors>
<behavior name="xmlRpcBehavior">
<xmlRpc/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
...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?
The .SVC file looks like this, by the way:
<%@ ServiceHost Language="C#" Debug="true"
Service="AnotherBlogEngine.Publishing.Service.BlogApi,
AnotherBlogEngine.Publishing.Service" %>
Note: Those backslashes aren't actually there; they're just for line-wrapping.
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.
Update: It's definitely at least looking at my extension: it calls XmlRpcEndpointBehaviorElement.get_BehaviorType
, and if XmlRpcEndpointBehavior
doesn't implement IEndpointBehavior
, I get an error to that effect (displayed in place of the "You have created a service" page).
However, breakpoints on the other methods in either class don't get hit.
If I turn on WCF tracing, I see "unrecognized message version" in the log file.
See Question&Answers more detail:
os