开发者

How to connect to the drupal site with xmlrpc from Android?

In the beginning I want to become authorised on a Drupal site, but I cannot connect with "system.connect", as a result I receive null. H开发者_StackOverflow中文版ow can I do that? Thanks in advance.


From all what i know till now you need to have xmlrpc method library first in your project and then you can use xml rpc methods to connect to drupal site call methods and add paramteres


You will probably want to use services, it supports xmlrpc by default while Steps to make a mobile application using drupal as a back end or service deals with REST mainly the setup is virtually the same. You can change the JSON code from there to use the Apache XMLRPC android library.


The text below is related to xmlrpc.

You need to define your endpoint. Setup name, protocol (xmlrpc), allowed resources (nodes, users, comments, files, etc). And enable "Session authorization" checkbox. Without it, all remote requests will be executed as anonymous user.

To authorize, you call "user.login" method with username and password arguments. And if call is succeeded, store sessid and session_name values of returned method structure.

Then send value

session_name+"="+sessid

as cookie in all subsequent calls to identify the session.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜