Using .NET to Post a New Blogpost in WordPress

Only available on StudyMode
  • Topic: Blog software, .NET Framework, Blog
  • Pages : 5 (1226 words )
  • Download(s) : 633
  • Published : December 11, 2010
Open Document
Text Preview
Using .NET to Post a New BlogPost In Wordpress

In this article we will see how we can use .Net and communicate with the most popular blogging tool Wordpress and post a new blog post. Before starting the development of our application, it is very important to learn about XML-RPC because we will be using XML-RPC to communicate with a Wordpress blog. So, what is XML-RPC? According to its home page

“It's a spec and a set of implementations that allow software running on disparate operating systems, running in different environments to make procedure calls over the Internet. It's remote procedure calling using HTTP as the transport and XML as the encoding. XML-RPC is designed to be as simple as possible, while allowing complex data structures to be transmitted processed and returned” Wordpress is a web application written in PHP and mostly runs on Linux servers and our application will be a .Net application which will be running on a Windows desktop. Since both run on entirely different architecture and technology, we will be using XML messages to communicate between the blog and our desktop application. To use XML-RPC in .Net, we will be using the XML-RPC.Net library. It can be downloaded from here. “XML-RPC.NET is a library for implementing XML-RPC Services and clients in the .NET environment, supporting versions 1.0, 1.1, and 2.0 of the .NET runtime. The library has been in development since March 2001 and is used in many open-source and business application”

Wordpress uses XML-RPC interface and currently supports Blogger API, metaWeblog API, and the Movable Type API. We will be using MetaWeblog API and the function newPost for creating a new post in our wordpress blog.

According to RFC: MetaWeblog API

There are three basic entry-points in the API:
metaWeblog.newPost (blogid, username, password, struct, publish) returns string metaWeblog.editPost (postid, username, password, struct, publish) returns true metaWeblog.getPost (postid, username, password) returns struct The blogid, username, password and publish params are as in the Blogger API. newPost returns a string representation of the post id, again as defined by the Blogger API. The struct is where the juice is. Let’s get started. Fire up Visual Studio.

Step 1: Add two Textboxes and a Button to the form. Following are the names and properties of controls. Textbox 1 : Name : txtTitle
Textbox 2 : Name : txtpost, Multiline : True
Button : Name: btnPost
Step 2: Add reference to XMLRPC.net library

Using .NET to Post a New BlogPost In Wordpress

In this article we will see how we can use .Net and communicate with the most popular blogging tool Wordpress and post a new blog post. Before starting the development of our application, it is very important to learn about XML-RPC because we will be using XML-RPC to communicate with a Wordpress blog. So, what is XML-RPC? According to its home page

“It's a spec and a set of implementations that allow software running on disparate operating systems, running in different environments to make procedure calls over the Internet. It's remote procedure calling using HTTP as the transport and XML as the encoding. XML-RPC is designed to be as simple as possible, while allowing complex data structures to be transmitted processed and returned” Wordpress is a web application written in PHP and mostly runs on Linux servers and our application will be a .Net application which will be running on a Windows desktop. Since both run on entirely different architecture and technology, we will be using XML messages to communicate between the blog and our desktop application. To use XML-RPC in .Net, we will be using the XML-RPC.Net library. It can be downloaded from here. “XML-RPC.NET is a library for implementing XML-RPC Services and clients in the .NET environment, supporting versions 1.0, 1.1, and 2.0 of the .NET runtime. The library has been in development since March 2001 and is used in many open-source and business...
tracking img