Many blogs have the ability to ping different ping-services, such as Ping-o-Matic, Feedburner and Technorati, whenever some content is created or updated. But it is not only blogs who can benefit from pinging these services. Almost all websites that is updated regularly can use this technique.
All these services use XML-RPC and the exact same format, so you can write a ping class ones and then just add whatever ping service URL later. I’ve written a very simple static ping class that can be used in any ASP.NET application.
Here is the the three methods needed to send XML-RPC pings.
/// Sends a ping to various ping services.
public static void Send()
/// Creates a web request and with the RPC-XML code in the stream.
private static void Execute(string url)
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.ContentType = "text/xml";
request.Timeout = 3000;
// Log the error.
/// Adds the XML to web request. The XML is the standard
/// XML used by RPC-XML requests.
private static void AddXmlToRequest(HttpWebRequest request)
Stream stream = (Stream)request.GetRequestStream();
using (XmlTextWriter writer = new XmlTextWriter(stream, Encoding.ASCII))
// Add the name of your website here
writer.WriteElementString("value", "The name of your website");
// The absolute URL of your website - not the updated or new page
Download the class below and drop it into the App_Code folder or a class library. Then from anywhere in your ASP.NET project you can use the class by calling the Send method like so:
Because it can take some time to ping all the different services, you might want to consider doing it asynchronously. Here is how to do that. That’s it. Now you have a class that pings various services using XML-RPC. You can find a full list of available ping services here.