<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4223636609917830983</id><updated>2011-09-12T06:10:22.166-07:00</updated><category term='xml rpc drupal pear client example'/><title type='text'>Drupal Technology Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://drupal-dev.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4223636609917830983/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://drupal-dev.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Enterprise Intelligence</name><uri>http://www.blogger.com/profile/05125756378975779605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4223636609917830983.post-224708566917686361</id><published>2009-12-02T19:16:00.001-08:00</published><updated>2009-12-02T19:46:14.505-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xml rpc drupal pear client example'/><title type='text'>Drupal Services Module</title><content type='html'>&lt;span style="font-family:arial;"&gt;We have recently been presented with a requirement to integrate an ERP application with &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.drupal.org/"&gt;Drupal&lt;/a&gt;&lt;span style="font-family:arial;"&gt;. The decision was made to use the &lt;/span&gt;&lt;a style="font-family: arial;" href="http://drupal.org/project/services"&gt;Services module&lt;/a&gt;&lt;span style="font-family:arial;"&gt; and the XML/RPC service.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;When I went to the documentation there seemed to be very little about how to get information in and out using PHP, and a number of people asking for client examples. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Here is a little test page that I did that will return the results of the &lt;/span&gt;&lt;a style="font-family: arial;" href="http://drupal.org/node/132804"&gt;echo sample&lt;/a&gt;&lt;span style="font-family:arial;"&gt; that is on the service website. I decided to use the &lt;/span&gt;&lt;a style="font-family: arial;" href="http://pear.php.net/package/XML_RPC2"&gt;pear xml_rpc2 library&lt;/a&gt;&lt;span style="font-family:arial;"&gt; as it seems to be the most straight forward to use.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: html"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;? php&lt;br /&gt;&lt;br /&gt;// I am using the new pear RPC2 library as it seems the simplest to use&lt;br /&gt;// Go here for more info:&lt;br /&gt;// http://pear.php.net/package/XML_RPC2&lt;br /&gt;&lt;br /&gt;require_once 'XML/RPC2/Client.php';&lt;br /&gt;&lt;br /&gt;// This is the drupal URL for the services module XMLRPC server&lt;br /&gt;$server = 'http://localhost/~bstewart/points/?q=services/xmlrpc';&lt;br /&gt;&lt;br /&gt;// The options we want to pass to the server. Prefix is required. You don't need debug.&lt;br /&gt;// Moreinformation here:&lt;br /&gt;// http://pear.php.net/manual/en/package.webservices.xml-rpc2.client.php&lt;br /&gt;&lt;br /&gt;$options = array(&lt;br /&gt;    'prefix' =&gt; 'echo.',&lt;br /&gt;    'debug' =&gt; TRUE&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;//// You can create and add $options array to this call for debug and other options related to the call.&lt;br /&gt;$client = XML_RPC2_Client::create($server, $options);&lt;br /&gt;//&lt;br /&gt;//// Execute and get the resulting details&lt;br /&gt;$resp = $client-&gt;echo("It Works !!!");&lt;br /&gt;//&lt;br /&gt;&lt;br /&gt;// Display the message onscreen&lt;br /&gt;echo $resp[message];&lt;br /&gt;&lt;br /&gt;?&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4223636609917830983-224708566917686361?l=drupal-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://drupal-dev.blogspot.com/feeds/224708566917686361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://drupal-dev.blogspot.com/2009/12/drupal-services-module.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4223636609917830983/posts/default/224708566917686361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4223636609917830983/posts/default/224708566917686361'/><link rel='alternate' type='text/html' href='http://drupal-dev.blogspot.com/2009/12/drupal-services-module.html' title='Drupal Services Module'/><author><name>Enterprise Intelligence</name><uri>http://www.blogger.com/profile/05125756378975779605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
