Using JoeBlogs -metaWeblog API Wrapper
Step 1
Download the latest release of JoeBlogs from Codeplex
(Click the Downloads tab, and select the latest download)
Step 2
Unzip the contents of the downloaded zip file.
(I usually copy DLLs I am going to use into a “lib” folder at the root of my solution)
Step 3
Add a reference to BOTH CookComputing.XmlRpcV2.dll AND JoeBlogs.dll

Include AlexJamesBrown.JoeBlogs in your class, with using / Imports:
C#
using AlexJamesBrown.JoeBlogs;
VB
Imports AlexJamesBrown.JoeBlogs
Step 4:
Instantiate a new Wrapper object.
So far, the available wrappers are:
MetaWeblogWrapper
WordPressWrapper
C#
WordPressWrapper wrapper = new WordPressWrapper(Url, Username, Password);
VB
Dim wrapper As New WordPressWrapper(Url, Username, Password)
Please note -
The above example has the Url, Username and Password strings omitted. Simply replace them with the relevant information.
Step 5
You can now take full advantage of all the methods on your instantiated wrapper.
C#
string Url = "www.alexjamesbrown.com"; string User = "MyUser"; //enter your username string Password = "MyPassword"; //enter your password var wp = new WordPressWrapper(Url, User, Password); //a few test functions... var userBlogs = wp.GetUserBlogs(); var tags = wp.GetTags(); var categories = wp.GetCategories(); var authors = wp.GetAuthors();
July 7th, 2009 at 4:43 pm
[...] here for usage instructions: http://www.alexjamesbrown.com/geek/using-joeblogs/ Share [...]
August 11th, 2009 at 5:28 am
Hi,
Noticed your source code is missing a class “BaseWrapper” on the latest version.
August 11th, 2009 at 11:21 pm
Thanks for the notification.
I’ve added the missing file to revision 25150
August 18th, 2009 at 2:17 am
do you support other blog system beside wordpress?
August 23rd, 2009 at 11:44 pm
yes, anything that supports the metaWeblog API
What blog system are you using?
August 26th, 2009 at 10:28 am
I get an exception “Response XML not valid XML-RPC – missing methodResponse element.” if i place a breakpoint here:
try
{
BlogID = GetUserBlogs()[0].blogid;
}
catch(Exception ex)
{
BlogID = string.Empty;
}
Thanks anyway its an easy to use solution (if i get it to work)
August 27th, 2009 at 7:31 pm
I get:
XmlRpcIllFormedXmlException: Response from server does not contain valid XML.
from:
var userBlogs = wp.GetUserBlogs();
i tried both the wp blog i have at wordpress.com and one hosted on my own site, got the same result.
August 28th, 2009 at 12:26 am
im getting a few errors like this recently…
I’ll check over the code – i’m thinking maybe an update to wp has broken it?
What version are you running?
August 28th, 2009 at 6:13 pm
This is both from the current version of wordpress.com, and version 2.8.1 on my hosting site
August 31st, 2009 at 10:31 am
Thanks for reporting the error – it is now fixed.
Please see this post:
http://www.alexjamesbrown.com/geek/development/dotnet/joeblogs-typo-in-dummy-url-fixed/
September 1st, 2009 at 10:08 pm
Do you have a sample code for posting new post with categories included?
It errors out for me with “Response from server does not contain valid XML.”
September 12th, 2009 at 5:40 pm
Hi, does your wrapper has that NewPost function implemented? I can’t get it to work
Pls help
September 16th, 2009 at 8:32 pm
Nevermind my previous post – I got it to work.
But I have another problem – in your wrapper there’s no way to add tags to new post or edit them, but I found that it can be done with the struct “mt_keywords”, I think it can be easily added to your wrapper, but I don’t have the possibility to test it since I have Visual Studio 2005 only, and your project was done in VS 2008 (??). So could you check if adding:
public string[] mt_keywords;
in the Page.cs file (under the Page structs section) would work for adding tags to new post? I think it should, as I’ve read about it, but I can’t check it right now.
October 12th, 2009 at 2:51 pm
@Milo can you tell me how NewPost function works?
October 12th, 2009 at 9:34 pm
Hi,
I wrote a post on using the NewPost method:
http://www.alexjamesbrown.com/development/creating-a-new-post-in-wordpress-using-the-joeblogs-library/
October 13th, 2009 at 1:29 pm
hi there, great extension..i would like to ask something..the getPost() throws an error when executed. it seems that the response contains an integer when the struct expects a string..would you mind looking into this? thank you so much..:)
October 27th, 2009 at 12:13 pm
Please assist how GetOptions work?
October 28th, 2009 at 1:06 pm
hello dear,
i had used your dll for publishing post on the ‘wordpress’ account, and they worked perfectly. very good job indeed. can you please confirm if your dll works for Live Journal also. if yes can you give me sample code.
look forward to hear from you soon.
regards
navjot
November 20th, 2009 at 3:43 pm
Hey Alex -
Great job – really great! I was working with WordPress.NET, but got hung up on the limitation of having to hard code the URL, username and password. I am an intermediate C# developer. Many of the techniques of mapping Interface methods to the XMLRPC dll are brand new and a bit fuzzy. Your tool is a great find.
Thanks,
Sean Olson
January 19th, 2010 at 10:32 am
Hello,
this VB code works fine for me to add a new post.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim wrapper As New WordPressWrapper("http://myblog/xmlrpc.php", "admin", "secret")
'create a new post
Dim post As New Post()
post.dateCreated = DateTime.Now
post.title = "This is a title"
post.description = "this is the body of the post. it could be html Rev."
post.postid = "12345678"
wrapper.NewPost(post, True)
End Sub
Is there any sample code for editing an existing post? I want to modify a post from VB, but I am not sure how to get the postid. Would it be possible to search for the ID of a post? I do have the post title, but not the ID.
January 23rd, 2010 at 4:40 am
You are a legend Alex.
Many thanks for creating this great/simple/clean plugin.
Perfect for just a few simple things like “Displaying the latest posts automatically from your wordpress blog on your ASP.Net main site”..
February 7th, 2010 at 4:49 am
[...] Alex James Brown » Using JoeBlogs -metaWeblog API Wrapper [...]
March 23rd, 2010 at 9:38 pm
Hello!
Using:
wrapper.GetPostStatusList(this.BlogID, this.Username, this.Password);
error occurred:
response contains struct value where array expected (as type String[]) [response]
April 14th, 2010 at 1:41 am
Hi,
Have you got any examples about UploadFile function ?
Thanks !
May 21st, 2010 at 9:32 pm
[...] alexjamesbrown.com | Alex James Brown » Using JoeBlogs -metaWeblog API Wrapper [...]
May 24th, 2010 at 2:31 am
Hi
I am tring but not able to upload the file (jpg) with the post.
ANy can please help me with it.
Upload class needs the data class and I am not able to give the local file path to data class.
Any one please help.
May 26th, 2010 at 3:42 pm
Hey, I attempted to e-mail you concerning this post that i’ve some inquires, but can’t seem to reach you. Please email me when have a moment. Thanks.
May 30th, 2010 at 12:55 pm
Hi, sorry- I will contact you by email
June 14th, 2010 at 12:24 pm
Hi, really cool API! I have a problem though… I’m trying to create a new page but I get the error “The method or operation is not implemented”.
I’m doing it like this:
var wp = new WordPressWrapper(Url, User, Password);
Page page = new Page()
page.page_id = “1″;
page.wp_slug = “Slug_text”;
page.wp_password = “mypassword”;
page.wp_page_parent_id = 0;
page.wp_page_order = “0″;
page.wp_author_id = “0″;
page.title = “Title text”;
page.description = “The main post text…”;
page.excerpt = “Excerpt…”;
page.text_more = “Text more…?”;
page.mt_allow_comments = 0;
page.mt_allow_pings = 0;
page.dateCreated = DateTime.Now;
page.page_status = “Published”;
wp.NewPage(page);
Am I missing something? I create posts easy enough, but the page woun’t work… please advice.
June 14th, 2010 at 3:07 pm
Is there a pdf or something that I’ve missed on how to use the API? Some kind of document would be sweet!
June 14th, 2010 at 3:09 pm
Hi,
I haven’t got round to properly documenting this API yet -
I suspect, the method you are trying to use hasn’t yet been written –
I’ll try and take a look today.
July 14th, 2010 at 6:35 pm
Hi again Alex. Another question, when posting I’, trying to add a category but I get an error when I try to. First I do this:
post.categories = “Uncategorized”;
But it complains that I can’t convert type ‘string’ to ‘string[]‘. But when I do it like this:
post.categories[0] = “Uncategorized”;
I get an object not set to an object reference or something… how do I post the category?
Thanks… I would loooooove if you got to creating some kind of pdf reference for this man. Really cool stuff!