[wp-xmlrpc] Bug in xml-rpc code?

Joseph Scott joseph at josephscott.org
Fri Sep 28 19:30:35 UTC 2012


The fourth argument to wp.getComment isn't an array, it is just the comment id:

wp.getComment( 'blog_id', 'username', 'password', 12345 )



On Fri, Sep 28, 2012 at 9:49 AM, Frank Rust <frust at iti.cs.tu-bs.de> wrote:
> I'm trying to get a comment via xml-rpc.
>
> If I do it with wp.getComment I always receive 'error 404: invalid
> comment id'. If I do wp.getComments the comment with the requested id is
> among the results.
>
> Example:
>
>   $rpc = new WP_HTTP_IXR_Client( $this->test_url );
>
>   $params = array(
>                 0,
>                 $this->remote_login,
>                 $this->remote_passwd,
> array('filter'=>array('post_id'=>$pars['comment_post_ID'],'status'=>'','number'=>'','offset'=>0))
>             );
>
>   error_log("getComments( " .print_r($params,true) .") --");
>
>   $rpc->query('wp.getComments',$params);
>   $res = $rpc->getResponse();
>
>   error_log("got from remote:" .print_r($res,true) .") --");
>
> delivers to logfile:
>
> comment(Array
>  (
>      [0] => 0
>      [1] => username
>      [2] => PaSssword
>      [3] => Array
>          (
>              [filter] => Array
>                  (
>                      [post_id] => 108
>                      [status] =>
>                      [number] =>
>                      [offset] => 0
>                  )
>          )
>  )
> ) --
> got from remote:Array
>  (
>      [0] => Array
>          (
>              [date_created_gmt] => IXR_Date Object
>                  (
>                      [year] => 2012
>                      [month] => 09
>                      [day] => 28
>                      [hour] => 15
>                      [minute] => 09
>                      [second] => 56
>                      [timezone] =>
>                  )
>              [user_id] => 10939635
>              [comment_id] => 50
>              [parent] => 47
>              [status] => approve
>              [content] => noch ein wort
>              [link] => <some link...>
>              [post_id] => 108
>              [post_title] => Erster eigener&nbsp;Eintrag
>              [author] => myname
>              [author_url] => http://myblog.wordpress.com
>              [author_email] => myname at mail.de
>              [author_ip] => 89.182.x.x
>              [type] =>
>          )
>      [1] => Array
>          (
>              [date_created_gmt] => IXR_Date Object
>               :
>               :
>               :
>          and so on
> ) --
>
>
> BUT
>   $rpc = new WP_HTTP_IXR_Client( $this->test_url );
>
>   $params = array(
>                 0,
>                 $this->remote_login,
>                 $this->remote_passwd,
>                 array('comment_id'=>$pars['comment_ID'])
>             );
>
>   error_log("getComment( " .print_r($params,true) .") --");
>
>   $rpc->query('wp.getComment',$params);
>   $res = $rpc->getResponse();
>
>   error_log("got from remote:" .print_r($res,true) .") --");
>
> gives me:
>
> getComment(Array
>  (
>      [0] => 0
>      [1] => username
>      [2] => PaSsword
>      [3] => Array
>          (
>              [comment_id] => 50
>          )
>  )
> ) --
>
> got from remote:Array
>  (
>      [faultCode] => 404
>      [faultString] => Ung\xc3\xbcltige Kommentar-ID.
>  )
> ) --
>
> So is this a bug or what could it be?
>
>
> Thanks for any help,
> Frank
>
>
>
> --
> ------------------------------------------------------------------------
> Frank Rust                          Institut für Theoretische Informatik
> Fon: 0531 3919525               Technische Universität Carolo-Wilhelmina
> Fax: 0531 3919529                              Mühlenpfordtstrasse 22-23
> Mail: f.rust at tu-bs.de                               D-38106 Braunschweig
>
> _______________________________________________
> wp-xmlrpc mailing list
> wp-xmlrpc at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-xmlrpc



-- 
Joseph Scott
joseph at josephscott.org
http://josephscott.org/


More information about the wp-xmlrpc mailing list