Tuesday, March 4, 2008 by Mistlee
XML-RPC ping endpoint in C# and ASP.NET Can't see any images? - ! |
| Recent Articles | A New Way to Organize Your Feeds When you come across something interesting on the web, but don't have time to read it at that moment, what do you do?The old way is to add the web page to your browser's bookmarks or favourites so you can retrieve it when you do have time. A more recent method is to... Google Sitemaps and Competitive Intelligence I'm a big fan of the Google Webmaster Central Program and using sitemaps. I agree that you should build your website so that it is crawlable and not rely on sitemaps to compensate for poor site architecture, but... A Milestone for XBRL This could be a milestone in illustrating the benefits of using XBRL for companies filing financial data.Last week, Microsoft submitted a Form 8-K filing to the financial data.Last week, Microsoft submitted a Form... When Is XML Not XML? Here is a mystery for folks. I've updated my parsing engine for coldfusionbloggers.org. I'm using CFHTTP now so I can check Etag type stuff. I take the result text and save it to a file to be parsed by CFFEED. | | 03.04.08 XML-RPC ping endpoint in C# and ASP.NET By Mads Kristensen All blog platforms send out pings using the XML-RPC protocol whenever a new post is created or an old one is updated. It is very simple to send out XML-RPC pings using C#, because it is just a normal HTTP request with some XML in the request body. See here how to ping using C#. To send a ping is the client part of the transaction. There must also be a server to intercept the ping an endpoint. Feedburner is probably the most widely used by blogs at the moment. What happens is that when you write a post, the blog engine sends a ping to Feedburners XML-RPC endpoint. In the XML body of the ping request is the URL of your blog so Feedburner knows who sent the ping. It then retrieves your blogs RSS feed, parses it, and spits it out to your readers. Thats how simple and powerful it is to use XML-RPC pings. In an earlier post I showed you how to write the ping client, now lets look at the server or endpoint. The endpoint can be used by any service that needs to be notified whenever content is updated on a website. That goes for all applications that listen to RSS feeds for instance. The Code In 100 lines of code including comments, we are able to build an XML-RPC ping server endpoint. All it has to do is to listen for POST requests and parse the XML sent in the request body as shown in my earlier post. By parsing the XML it can find the URL that has been updated. The method HandleUrl is where the URL is passed to and it's from here you write your logic to handle the ping request. #region Using using System; using System.IO; using System.Net; using System.Xml; using System.Web;
| |
0 comments:
Post a Comment