2

I'm trying to get the list of certain type nodes using xmlrpc and POST method. I'm constructing xml like this:

<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>node.index</methodName>
<params>
   <param>
      <value>
         <string>0</string>
      </value>
   </param>
   <param>
      <value>
         <string>*</string>
      </value>
   </param>
   <param>
      <value>
         <string>type=forum</string>
      </value>
   </param>
</params>
</methodCall>

yet in return I get nodes of various types. I guess that type=forum is bad. What is correct syntax of this parameter?

0

I usually call node.index this way

$nodes = xmlrpc($this->server_endpoint, Array('node.index' => Array(0,'nid,uuid,vid', array('type' => $contentType), PHP_INT_MAX)), $this->headers);

the parameters being:

  1. Page number (usually I set it to zero and set the number of nodes per page to PHP_INT_MAX. This because I found page support buggy in a previous version, I haven't retested it recently)
  2. Array with fields to retrieve (only that you find in the node DB table are available. Careful with it, less fields means better request speed)
  3. Array with content type(s) to retrieve
  4. Number of nodes in the index list per page

I dont'know how exacly goes in XML, but I think that it should be easy enough to adapt to that syntax, if necessary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.