[q] xml-rpc & wp7.

cris_rowlands

Senior Member
Nov 7, 2007
427
1
0
30
www.CrisRowlands.com
In my search to find out a good way (or any way) to post comments on a wordpress article using C# on windowsphone, someone suggested looking into XML-RPC.

Ive done a search & it looks like the right lines, but I have no idea how to actually use it.

Anyone fancy giving me a little example or some sort of push in the right direction about how I can use XML-RPC in my WP7 app.
 
G

GuestK00306

Guest
In my search to find out a good way (or any way) to post comments on a wordpress article using C# on windowsphone, someone suggested looking into XML-RPC.

Ive done a search & it looks like the right lines, but I have no idea how to actually use it.

Anyone fancy giving me a little example or some sort of push in the right direction about how I can use XML-RPC in my WP7 app.
XML-RPC is just reading/writing XML. You could easily just use the built-in Xml classes to build your XML, then use the WebClient to post/receive it from the server. You can use the spec from here to see what XML needs to be generated:
http://www.xmlrpc.com/spec

I don't know of any complete libraries for Windows Phone 7 right now, but you can check this out to get you started:
http://xml-rpc.net/
 

emfor

Member
Mar 19, 2009
10
1
0
I've used this silverlight lib called xmlrpc-silverlight. It can be found on google code.
It works perfectly on wp7.

Best regards,
Mateusz
 
G

GuestK00306

Guest
I've used this silverlight lib called xmlrpc-silverlight. It can be found on google code.
It works perfectly on wp7.

Best regards,
Mateusz
This will come in handy for one of my projects also, thanks for this!
 

emfor

Member
Mar 19, 2009
10
1
0
I have too few posts... On the page, go to "Source" tab, than "Browse" and in the "trunk" folder there is file XmlRpc.cs - that's it!

Best regards,
Mateusz
 

cris_rowlands

Senior Member
Nov 7, 2007
427
1
0
30
www.CrisRowlands.com
Well, Ive played with it a bit & I think I understand some of it, but I really have never used XML-RPC before & cant get it to work :(

Any chance you could give me a hint as to how I could post a comment to (for example) this page: http://www.1800pocketpc.com/2011/02/03/fireworks-an-amazing-free-app-for-windows-phone-7.html

Its just a random post from the site Im creating the app for.

On the wordpress page about XML-RPC it says this:

wp.newComment
Create new comment.

If you want to send anonymous comments, leave the second and third parameter blank.

Parameters

■ int blog_id
■ string username
■ string password
■ int post_id
■ struct comment ■ int comment_parent
■ string content
■ string author
■ string author_url
■ string author_email

Return Values
■ int comment_id
Sadly Im not quite sure what to do with that. Plus I havent a clue what the "blog_id" or "post_id" would be :/

Ive been coding for 4 years & I still feel like a total newbie half the time >_<
 

emfor

Member
Mar 19, 2009
10
1
0
I think something like that shoud work:

Code:
XmlRpcService service = new XmlRpcService("Url_to_the_service");

XmlRpcRequest req = new XmlRpcRequest(service, "wp.NewComment", new object[] { 
   1,
   "UserName",
   "Pass",
   1,
   ?,
   1,
...

});

req.XmlRpcCallCompleteHandler
    += new XmlRpcCallComplete(req_XmlRpcCallCompleteHandler);
req.Execute(null);
generally this should work. There is an struct element, so you should implement this struct in C# and pass it there...

I don't know WP so i can't help with parameters meaninig...

Good luck!

Best regards,
Mateusz
 
Last edited:
  • Like
Reactions: cris_rowlands