I still didn't get from the docs how can I access, using services, data from one site to another.

Comments

amitaibu’s picture

Comment #1

amitaibu
Primary language Hebrew
Location Israel
commented

I found this module http://drupal.org/project/get_server. Apart if this, is there another way?

amitaibu’s picture

Comment #2

amitaibu
Primary language Hebrew
Location Israel
commented

Ok, took me some time but I found the answer. The key is in drupal_http_request(),

amitaibu’s picture

Comment #3

amitaibu
Primary language Hebrew
Location Israel
commented
Status: Active » Fixed
amitaibu’s picture

Comment #4

amitaibu
Primary language Hebrew
Location Israel
commented
Title: How to access a service on another site » Syntax to access a service via POST
Status: Fixed » Active

What is the correct syntax, the following doesn't work for me:

 $data = drupal_http_request('http://localhost/d5/services/xmlrpc', array(), 'POST', array('method' => 'node.load', 'nid' => '1'));
amitaibu’s picture

Comment #5

amitaibu
Primary language Hebrew
Location Israel
commented

I tried this, still I get parser error:

 $request = http_build_query(array('method' => 'node.load', 'nid' => '1'));
 $data = drupal_http_request('http://localhost/d5/services/xmlrpc', array(), 'POST', $request);
 dpm($data);
amitaibu’s picture

Comment #6

amitaibu
Primary language Hebrew
Location Israel
commented
Status: Active » Closed (fixed)

Syntax should use xmlrpc()

$result = xmlrpc('http://example.com', 'node.load', 1, array());

amitaibu’s picture

Comment #7

amitaibu
Primary language Hebrew
Location Israel
commented
Title: Syntax to access a service via POST » Syntax to access a service via xmlrpc

. (double posting)