Professional Documents
Culture Documents
XML RPC Call
XML RPC Call
I never thought I would have gotten as many comments about my little weblog. I was
thinking at one point of making all of TripleASP’s source code available, but I think in the
short run, I am going to put together a small downloadable weblog, so look for that
hopefully by the end of the year.
In the mean time, I know there are a bunch of you writing your own weblog’s at the
moment. In my brief weblogging life time, I have learned a little about XML-RPC. To be
honest, I don’t know too much about it yet, but I did find a pretty nifty library to help
make XML-RPC calls almost a no-brainer. Charles Cook's CookComputing
As a quick example, the downloadable code below will illustrate how to notify
WebLogs.com that you have made an update to your blog.
The WeblogsNotificationProxy
using System;
using CookComputing.XmlRpc;
namespace TripleASP.Components
{
/// <summary>
/// Summary description for WeblogsNotificatinProxy.
/// </summary>
[XmlRpcUrl("http://rpc.weblogs.com/RPC2")]
public class WeblogsNotificatinProxy : XmlRpcClientProtocol
{
public WeblogsNotificatinProxy()
{
[XmlRpcMethod("weblogUpdates.ping")]
public XmlRpcStruct Notifiy(string name, string url)
{
return (XmlRpcStruct) Invoke("Notifiy",new object[] {name,url});
}
}
}
The Implementation
WeblogsNotificatinProxy wp = new WeblogsNotificatinProxy();
if(wp.Ping("ASP.NET and Me","http://TripleASP.Net/Weblog"))
{
wlMessage.Text = "Weblogs was notified and accepted";
}
else
{
wlMessage.Text = wp.ErrorMessage;
}