You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to download post data from my wordpress blog, but the following happens:
Call
var commentcount = wordPressWrapper.GetCommentCount(post.PostID.ToString());
in a try/catch block
with the current bindings in stuct CommentCount as int and zero comments the code works
but when there are comments the binding throws an exception that the response contains string where int is expected.
1.16 How do I specify data whose type is not known until runtime?
it suggests to use System.Object, this works for me.
CHANGE:
In the /classes/CommentCount.cs and /xmlRpcStructs/CommentCount.cs change all the types from int to object and then handle actual conversion outside the API i.e. in my project like:
commentcount.Approved.ToString()
Hope this helps
The text was updated successfully, but these errors were encountered:
Hi Alex
Thanks for writing this awesome API!!
I am trying to download post data from my wordpress blog, but the following happens:
Call
var commentcount = wordPressWrapper.GetCommentCount(post.PostID.ToString());
in a try/catch block
FIX:
Looking at the XML-RPC documentation
it suggests to use System.Object, this works for me.
CHANGE:
In the /classes/CommentCount.cs and /xmlRpcStructs/CommentCount.cs change all the types from int to object and then handle actual conversion outside the API i.e. in my project like:
commentcount.Approved.ToString()
Hope this helps
The text was updated successfully, but these errors were encountered: