[campcaster-dev] help with XML-RPC API
  • Hi guys,

    I need your help again with the XML-RPC API. I tried to use the browseCategory() function in the
    following way:

    $conditions = array(array('cat'=>'dc:type', 'op'=>'=', 'val'=>'Rock'),
    array('cat'=>'dc:creator', 'op'=>'=', 'val'=>'Santana'));
    $criteria = array('filetype' => 'audioclip',
    'operator' => 'and',
    'limit' => 0,
    'offset' => 0,
    'conditions' => $conditions
    );
    $r = $xrc->xr_browseCategory(array('sessid'=>$sessid, 'category'=>'title',
    'criteria'=>$criteria));
    echo "
    \nbrowse:\n";
    print_r($r);
    echo "
    \n";

    Still, I get an empty list all the time; using the same criteria on searchMetadata() displays a
    list of files. The session is ok because it was used in other functions which returned valid
    results in the same test script.

    What did I do wrong? Please give me an example how should the code look like.

    Thanks,
    Mugur




    ____________________________________________________________________________________
    Yahoo! Music Unlimited
    Access over 1 million songs.
    http://music.yahoo.com/unlimited
  • 1 Comment sorted by
  • On Tue, 14 Nov 2006 22:21:20 +0100 (CET) Mugur Rus wrote:
    > Hi guys,
    >
    > I need your help again with the XML-RPC API. I tried to use the browseCategory() function in the
    > following way:
    >
    > $conditions = array(array('cat'=>'dc:type', 'op'=>'=', 'val'=>'Rock'),
    > array('cat'=>'dc:creator', 'op'=>'=', 'val'=>'Santana'));
    > $criteria = array('filetype' => 'audioclip',
    > 'operator' => 'and',
    > 'limit' => 0,
    > 'offset' => 0,
    > 'conditions' => $conditions
    > );
    > $r = $xrc->xr_browseCategory(array('sessid'=>$sessid, 'category'=>'title',
    > 'criteria'=>$criteria));
    > echo "
    \nbrowse:\n";
    > print_r($r);
    > echo "
    \n";
    >
    > Still, I get an empty list all the time; using the same criteria on searchMetadata() displays a
    > list of files. The session is ok because it was used in other functions which returned valid
    > results in the same test script.
    >
    > What did I do wrong? Please give me an example how should the code look like.
    >
    > Thanks,
    > Mugur

    The conditions and criteria looks OK - only one idea: xr_* methods from
    XR_LocStor class expect XMLRPC object, not plain PHP array - it could
    be the problem, if you call it from PHP instead of XMLRPC.

    From PHP should be called GreenBox methods - in this case
    the browseCategory($category, $criteria, $sessid) method
    or eventually (only for testing) the PHP base methods for XMLRPC
    - in this case the browseCategory method from LocStor class.

    Tom