Help with comment_parentID on wp.comment API.
-
Hi all,
I am using wp.newcomment API and I am encountered a problem with its comment parent id. It seems that if I set the comment parent id to 0(zero), it only works just for the first brand new comment. After that, it keeps giving me a same error all the time. I want to add a new comment every time the button is clicked.
The error says: Internal Server Error.
And here is the snippet of my code:
public struct comment { public string content; public string author; public string author_url; public string author_email; public int comment_parent; } public interface IgetCatList { [XmlRpcMethod("wp.newComment")] int newComment(int blog_id, string username, string password, int post_id, comment c); } protected void Button1_Click(object sender, EventArgs e) { XmlRpcClientProtocol clientProtocol; IgetCatList categories; comment c = new comment(); c.author = "asdf"; c.author_email = "(email visible only to moderators and staff)"; c.author_url = "asdf"; c.comment_parent = 0; c.content = "Test Again"; categories = (IgetCatList)XmlRpcProxyGen.Create(typeof(IgetCatList)); clientProtocol = (XmlRpcClientProtocol)categories; clientProtocol.Url = "http://example.com/xmlrpc.php"; int a = categories.newComment(1106, "userName", "password", 1106, c); }Can anyone help me with this ? I am totally stuck with this. Thank you in advance.
Best Regards,
A.S -
As there is no wordpress.com blog linked to your username and you have not posted the URL for the blog to which you refer I’m asking for you to please post the complete URL now starting with http://
It seems to me that you may have a wordpress.org blog for self hosting and if that’s the case then you are posting to the wrong forum. Please read this entry and determine if that’s the case or not https://en.forums.wordpress.com/topic/please-read-me-first-before-posting?replies=1
-
Hi there,
Thank you for the response. Here is the full code of mine. I don’t think I am posting to the wrong forum here.
‘
protected void Button1_Click(object sender, EventArgs e)
{
XmlRpcClientProtocol clientProtocol;
IgetCatList categories;
comment c = new comment();
c.author = “Test”;
c.author_email = “(email visible only to moderators and staff)”;
c.author_url = “Test”;
c.content = “Test Again”;categories = (IgetCatList)XmlRpcProxyGen.Create(typeof(IgetCatList));
clientProtocol = (XmlRpcClientProtocol)categories;
clientProtocol.Url = “http://intersoftpt.wordpress.com/xmlrpc.php”;int a = categories.newComment(0, “santosoandi”, “q*****Y”, 935, c);
}
‘
I hope you can help me to fix this. Thank you and have a nice day.Best Regards
Andi Santoso -
- The topic ‘Help with comment_parentID on wp.comment API.’ is closed to new replies.