I am using Drupal 6 with services 6.x-2.0x and using beecolony module when i making a call to log in to my drupal site through drupal web service from a non-drupal site(mobile app) it asks me to pass on session id .. we don't get session id until i logged in to my drupal site...

How to use this web services !!!

CommentFileSizeAuthor
#4 kesav.png110.33 KBkesav20

Comments

FeBus982’s picture

Status: Active » Postponed (maintainer needs more info)

Hi kesav20,
You should use first the method "system.connect" (provided by Services) to do an anonymous connection and receive session informations.
Then you should use the method "user.login" (also provided by Services) to login and get user permissions and update session.
Now you should be able to use beecolony methods.

You can look at this example http://drupal.org/node/762998 in php.

Alternatively http://drupal.org/node/1213270#comment-4739674 take this attachment to see an example written by me in python.

Hope this helps.

kesav20’s picture

Hi FeBus982,

I have used your Example code in php Just changed the domain,password and username but it throws an error...

Fatal error: Call to undefined function xmlrpc() in C:\wamp\www\kesa.php on line 4

Here is your code:

$xmlrpc_url = 'http://www.xxxxx.com/services/xmlrpc';

$anon_session = xmlrpc($xmlrpc_url, 'system.connect');

// Use anon session id to login with authentication
$user = 'xxx';
$password = 'xxx';
$authenticated_session = xmlrpc($xmlrpc_url, 'user.login', $anon_session['sessid'], $user, $password);

// Now we have an anuthenticated session, and when this ID is passed to services, it will run under that user's permissions
$xmlrpc_result = xmlrpc($xmlrpc_url, 'user.get', $authenticated_session['sessid'], 1);
if ($xmlrpc_result === FALSE) {
  print '<pre>' . print_r(xmlrpc_error(), TRUE) . '<pre>';
}
else {
  print '<pre>' . print_r($xmlrpc_result, TRUE) . '<pre>';
}

Where do i made a mistake....

FeBus982’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

This is an example to be used in a drupal site, xmlrpc() function is part of Drupal.

Sorry but i can't help you with php, you should read documentation about xml-rpc communication and php implementation.

Try there http://bit.ly/LJSMME ;)

kesav20’s picture

Status: Closed (works as designed) » Active
StatusFileSize
new110.33 KB

it worked !!!
now login,logout are working fine!!!
how to make a new order using beeColonyUser.newOrder
it asks me to pass on two arguments session ID and order
I have passed sessionID .. now how to pass on order (struct)..