PHP XML-RPC Client

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by tomhung on August 14, 2008 at 11:47pm

Well there seems to be a lack of simple examples or documentation on connecting a PHP XML-RPC client to Drupal Services. If this example exists, I could not find it.

Here is my example code:
http://gregbosen.org/blog/drupal-services-php-xml-rpc-example

Please comment on it, if you have suggestions.

I wonder if this should be on the Example page in the handbook?

G

Comments

Indeed some non-flex

Posted by amitaibu on August 15, 2008 at 10:06pm

Indeed some non-flex examples are missing in Services docs, nice job. Maybe worth changing the code to be more Drupal (i.e. coding standards). btw, maybe this thread about integration with Rules module would interest you - http://groups.drupal.org/node/10376

Nice job indeed!

Posted by greg.harvey on November 27, 2008 at 2:15pm

Excellent post. This needs to be a Drupal HOWTO, or at least linked to from the Services documentation. I'll create the link now, if I can. I should be able to - I'm have the documentation editor role. =)

Edit: posted in the Examples section: http://drupal.org/node/339845

I'm totally open to cleaning

Posted by tomhung on August 25, 2008 at 9:00pm

I'm totally open to cleaning this example up. I just got it working and wanted to post it. I will post our Perl client when its done too.

G

mini-module

Posted by amitaibu on August 28, 2008 at 1:38pm

cool. maybe part of the cleaning up is making it as a Drupal module?

This really isn't suited for

Posted by tomhung on September 2, 2008 at 11:57pm

This really isn't suited for a Drupal Module. This is more of code for an external php application that needs to use Drupal & its content.

We are using it as a GUI for a non Drupal application. IE. the user can CRUD their settings, and check log messages, and system status via drupal. But the real meat of the system is in PERL or PHP.

G

Hi Tomhung, I create another

Posted by dudskie on September 3, 2008 at 3:59am

Hi Tomhung,

I create another folder under my localhost called "php-xmlrpc" and then save a file called sample.php (attached a file here.). But it seems it does not work to me. What's lacking with this. Thanks.

I have already a folder named "drupal", and there I have setup my drupal installation under my localhost. Works fine. Permissions are setted properly already.

i'm guessing its a path problem

Posted by tomhung on September 3, 2008 at 3:44pm
$c = new xmlrpc_client("drupal/?q=services/xmlrpc", "localhost", 80);

this could be "drupal/xmlrpc.php"

it may be different if your clean urls are on. "drupal/services/xmlrpc"

check your paths, I had to play with this to get it to work.

i did find one thing... you must do a system.connect get the session, then send session to user.login and get a logged in session, then send that session to node.load.

http://gregbosen.org/blog/drupal-services-php-xml-rpc-example this is my best explanation of how to do this...

I hope this helps...

Hi Tomhung, I am doing your

Posted by dudskie on September 7, 2008 at 2:21pm

Hi Tomhung,

I am doing your advised but it does not work. It displays the "else" error, it does not work.

API Key

Posted by rigard on September 9, 2008 at 10:23am

It might have to do with you api key. If you are using an api key, the system.connect won't work as in the example.
Replace the lines with the following, or deactivate your api_key. Hope this is where your problem is.

$m = new xmlrpcmsg('system.connect',
array(
php_xmlrpc_encode([place api_key here])
)
);

Still does not work. Hi,

Posted by dudskie on September 20, 2008 at 7:41pm

Still does not work. Hi, tomhung, have you tried tested it in your localhost?

where did this code go? the

Posted by gateway69 on March 19, 2010 at 7:25pm

where did this code go? the page no longer works, anyone have this and got it working, im just trying to do a simple connect from php --> services, using an api key, and pulling some data in..

help :)

im not using flash working on something else.

Where is the code?

Posted by rahulsaini8 on October 4, 2010 at 4:20am

HINT: seems like we would

Posted by d34dman on January 3, 2012 at 6:27am

HINT: seems like we would have to go to the college market coffee house. :)

Services

Group organizers

Group categories

Group notifications

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

AltStyle によって変換されたページ (->オリジナル) /