MetaWeblog and Blogimporter
A good blog system, there are some public APIs. BlogEngine.NET implements the standard MetaWeblog API interface to allow users to publish their blogs via client software, and it also implements articles in other blogging systems (standard format BLOGML or RSS). Import into the BlogEngine.NET Blogimporter interface, in this article I will be a detailed introduction to these open parts, for some related knowledge points also give a link or do a simple description.
The MetaWeblog API uses the standard HTTP protocol encapsulated XMLRPC implementations (similar to the SOAP protocol in WebService)
1. First let's take a look at what is the MetaWeblog API
The MetaWeblog API (MWA) is a set of programming interfaces that allow outside programs to get and set the text or attributes of a blog post. It is built on the XMLRPC interface and already has a lot of implementations.
The 2.MetaWeblog API has three basic function specifications:
Metaweblog.newpost (blogid, username, password, struct, publish) returns a string, possibly the ID of the blog.
Metaweblog.editpost (PostID, username, password, struct, publish) returns a Boolean value that represents whether the modification succeeded.
Metaweblog.getpost (PostID, username, password) returns a struct.
where blogID, username, password each represent the ID of the blog (note: If you have two blog,blogid specify the blog you need to edit), username and password. For a limited space, please refer to the link section at the end of the article for more information about the MetaWeblog API.
The implementation analysis of MetaWeblog API in 3.blogengine.net
The XMLRPC invocation of blogengine.net is mainly done by several types under the BlogEngine.Core.API.MetaWeblog namespace.
First, the client software submits a standard XML request to Metawebloghandler through the HTTP protocol, Metawebloghandler is a HttpHandler, Then Metawebloghandler executes ProcessRequest to process the request, and finally encapsulates the processing results back to the client software for XML.
Let me make a brief introduction to some of the types involved in this section:
Metawebloghandler: Needless to say, the main logical part of the process, ProcessRequest, is the entry point of the process, delegating some of the specific processing to some private members, such as:
internal string NewPost(string blogID, string userName, string password,
MWAPost sentPost, bool publish)
Xmlrpcrequest: is a HttpRequest information after the package, which is a number of parsing XML extraction information related properties and methods, such as remote invocation method name, parameters, article information.
Xmlrpcresponse: Corresponds to Xmlrpcrequest, and its response method generates XML for execution results and passes it to HttpResponse and returns to the client.
Other structures such as mwabloginfo, such as Mwamediaobject,mwapost, are packages of data extraction information for business object types, and are defined primarily for the exchange of information.
From the blogengine.net implementation, it supports a number of standard protocols, many of which are based on XML for communication, and blogengine.net generally deal with these standards through HttpHandler.