When we fist decided to implement a blog on our site, we figured it would be quick and easy to roll our own, and for the most part it was. After all, a blog is only composed of a handful of tables, each with a spattering of columns. You have the blog itself, then you have comments. That's the long and short of blogging.
At least at first glance.
After you get the blogs up, you certainly want to implement trackbacks and pingbacks. If you don't know what these are, they are simply a way of interlinking sites, so that if I comment on a blog at foobar.com, they can add a link back to my site, saying comments were made there.
Trackbacks are relatively straight forward as they are simply HTTP calls made in a REST fashion (spec can be found here)
Pingbacks are only slightly more involved.
Enter the XmlRpc Spec
Pingbacks are entriely built arond the Xml-Rpc specificaion, which is exactly what it sounds like, remote procedure calls via Xml, a simpler version of SOAP if you will (I'll leave the Xml-Rpc vs SOAP vs REST argument for another day). I'll be the first to admit, somehow up to this point in my programming experience, I had somehow avoided interfacing with Xml-Rpc directly. So I did what I always do when confronted with a new spec, I read the manual.
This is a point that I want to stress. I know a lot of developers who can churn out code to email someone without having read one single RFC concerning SMTP, MIME or any other similiar technology. This is a sure way to limit your usefullness as a programmer. Along with learning a language a year, coders should also strive to understand the undelying concepts of the systems they are working with.
But I digress. To return to point, I went and read the spec, which on the surface seemed pretty simple. Since I didn't know how to implement it myself and it seemed rather simple, I decided to take a crack at implementing my own library.
In the beginning, there's the XML
Since Xml-Rpc utilizes HTTP for the request/response, and since the HttpWebRequest method is built into the .Net libraries already, I decided to start with the xml. The spec site gives a very verbal breakdown of how the xml is structured, but it is missing a schema definition file, so that's where I began. This can be found here.
Once I have the xsd defined, I used XSD.exe tool that comes with Visual Studio to create the first version of the classes to serialize the documents. The XSD.exe tool is an extremely valuable tool, but, generally, we only use it to get a base to work from. You can find the results of this generation here.
In the next part, I'll go over the changes to the Xml
NOTE:
We've released this project under the LGPL and you can download it at codeplex, BXmlRpc. The current generated documentation can be found at http://bxmlrpc.bambitinc.com/Documentation/