Format of the node object in the node.save method form (in services admin interface)

Events happening in the community are now at Drupal community events on www.drupal.org.
geraud's picture

I would like to test the node.save method of the "node" service in the browser of the "services" admin interface.
(/admin/build/services/browse/node.save)

In order to do that, I have to provide the form with an object that will be added to Drupal (if everything works correctly).

But I can't figure out what the format of this node-object should be (array, json,...). What is the syntax ?

Any help would be appreciated.

Cheers

Comments

Array

sethcohn's picture

It needs to be an array. Essentially, a print_r on the node object will show you the format it expects, however some fields are fussy and require something more akin to the fields returned by the node editing form (view source on the node/add page for the content type, to see the fields it expects. Examples of exceptions would include checkboxes which need [keys] rather than [value], despite that the node ends up with [value] in the array.

Not sure of the exact format to drop into the browser of the admin interface, i suspect that the single text line isn't sufficient for testing purposes.

If you want to generate xml (good for testing custom services), I'm using the debugger from http://phpxmlrpc.sourceforge.net
If you have a Mac (I don't), some drupalers recommend http://ditchnet.org/xmlrpc/ I have NOT found a tool for Windows, Linux, or Firefox Extension that does the same thing as cleanly.

If you want to generate php code to call the xmlrpc, try http://keithdevens.com/software/xmlrpc for a good package)
(source: http://pingv.com/blog/john-fiala/200708/quick-and-dirty-xmlrpc-clients-t...

Any way someone could post an example?

capoeirista's picture

Have tried several ways to represent the array with no luck. I'd be grateful for a successful example. Thanks...

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: