Posted by shrop on September 4, 2008 at 2:47pm
I am using the services module to setup a web service on one Drupal site and then have another Drupal site pull in the resultant xml data formatted for display. I am specifically using views.getView from the Services module xml-rpc server. It works great so far, but now I am wondering the best method for parsing the XML on the client end Drupal site.
Should I just use simplexml included with PHP and create a node with the PHP parsing code. Seems like there is a need for an XML-RPC client module, but I haven't found an existing project.
Any suggestion on how to parse the XML in a Drupal site and/or example code will be greatly appreciated.
Thanks!
Shrop

Comments
Already there
Drupal actually includes an xmlrpc client in core.
http://api.drupal.org/api/function/xmlrpc/6
It works really well.
Beyond that, I always just use SimpleXML to parse results, although it should be noted that you're then making PHP 5 requirement, whereas Drupal 6 only requires PHP 4. This is becoming pretty common (a lot of contrib modules for 6 now require PHP 5 for this very reason) but its still worth mentioning.
Thanks for everyone's
Thanks for everyone's suggestions. Great community around the services group here. I plan to spend some time here as I am doing a lot of web service integration with other systems on campus and Drupal at www.uncc.edu.
Thanks all!
Shrop
Try FeedAPI
You should take a look at FeedAPI (http://drupal.org/project/feedapi).
Now, if you are just trying to remote data from a View, you could probably avoid Services completely and just have your View provide an RSS feed.
B.McMurray
B.McMurray
Dont forget the FeedAPI Element Mapper!
In order to really utilize the mojo of FeedAPI, you really need to pair it with the great module FeedAPI Element Mapper.
Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology
Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology
SOAP Server & Client
Hello to all drupal developers. Firstly thumbs up for creating such a nice module. It is a great module with less documentation for example I am not able to find single help for creating Webservice as SOAP Client and SOAP Server. It is really a need for today scenario. If anybody know the link or have some knowledge please put all together here so that everybody can have access to that.
Sukh Singh
From my experience
Perhaps I will be labeled a Heretic now, but after several months of analysis on a HUGE project I determined that the services modules were too heavy handed to meet my client's syndication needs. Instead we built several custom modules and used, cck, views, and path-auto to accomplish the task.
We built a set of custom client modules as a development framework for create new feed types. Then we created a dedicated sub-site for syndication that utilized, cck, views, path-auto, and custom modules that extended views to create XML streams that handled multiple arguments.
One key library I used (attached) would parse the XML stream and turn it into a multi-dimensional array for use within my theme templates used to render the output on each sub-site and theme. Perhaps it will be useful for you, I found it invaluable in converting the XML structure and passing it on to my preprocessor functions for the theme templates.
The client was http://www.pdx.edu
and you can view the result here:
http://www.pdx.edu/events/
http://www.pdx.edu/news/
http://www.pdx.edu/faqs/
http://www.pdx.edu/profile/
Robert Foley Jr
Solutions Architect
http://www.robertfoleyjr.com
I am trying with XPath
The queries work logically. It could be permissions.
But it wont update a story when a feed is added.
Chow
What about
What about http://se2.php.net/simplexml ? :)
Parse XML in drupal
use the services module see: http://drupal.org/node/1851202