XML-RPC with WCF
UPDATE: The code has been updated. Ignore this post and go here.
I'm writing lots of code lately. I've rejoined the dasBlog community and I'm busy writing a prototype for the .NET Framework 3.5 version of dasBlog (we just released the 2.0 version, see http://www.dasblog.info/).
One of the goals of the prototype, which we'll eventually merge into the main codebase once the .NET Framework 3.5 is available at hosting sites is to standardize on WCF for all non-HTML endpoints. Since lots of the relevant inter-blog and blogging tool APIs are still based on XML-RPC, that called for an implementation of XML-RPC on WCF. I've just isolated that code and put it up on wcf.netfx3.com.
My XML-RPC implementation is a binding with a special encoder and a set of behaviors. The Service Model programming experience is completely "normal" with no special extension attributes. That means you can also expose the XML-RPC contracts as SOAP endpoints with all the advanced WCF bindings and features if you like.
The binding supports client and service side and is completely config enabled. Here's a snippet from the MetaWeblog contract:[ServiceContract(Namespace = http://www.xmlrpc.com/metaWeblogApi)]
public interface IMetaWeblog : Microsoft.ServiceModel.Samples.XmlRpc.Contracts.Blogger.IBlogger
bool metaweblog_editPost(string postid,
CategoryInfo metaweblog_getCategories( string blogid,
For your convenience I've included complete Blogger, MetaWeblog, and MovableType API contracts along with the respective data types in the test application. The test app is a small in-memory blog that you can use with the blogging function of Word 2007 as a client or some other blogging client for testing.
Of the other interesting XML-RPC APIs, the Pingback API has the following contract:
public interface IPingback
string ping(string sourceUri, string targetUri);
and the WeblogUpdates API looks like this:
public struct WeblogUpdatesReply
public bool flerror;
public string message;
public interface IWeblogUpdates
[OperationContract(Action = "weblogUpdates.extendedPing")]
WeblogUpdatesReply ExtendedPing(string weblogName, string weblogUrl, string checkUrl, string rssUrl);
WeblogUpdatesReply Ping(string weblogName, string weblogUrl);
The code is subject to the Microsoft samples license, which means that you can put it into your (blogging) apps. Enjoy.