Hello,
I'm having big problems in setting up the XML-RPC server on my Drupal 6 website.
I think I have set everything correctly:
_Enabled Services, Key Authentication, XMLRPC Server, User Service and System Service Modules
_Set permissions for those modules
_Set API Key for the websites I want to use to connect (enabled Authentication with the Keys, flagged Use Keys, Use sessid)
And now I'm trying to connect to my Drupal site from another website, but all I get is the "XML-RPC server accepts POST requests only." notice every time I try to connect.
I tried to connect to xmlrpc.php instead of /services/xmlrpc and it partially worked (user.login always fails with 'wrong username or password'), but I read that I should use http://mysite.com/services/xmlrpc and not http://mysite.com/xmlrpc.php
I don't think the problem is with the code I'm using to connect, because I directly copied it from you HandBook here: http://drupal.org/node/339845
I even tried to use a different code found here: http://groups.drupal.org/node/21302
I always get "XML-RPC server accepts POST requests only.", but I don't get it if I try to connect with the xmlrpc.php file.
Can someone help me? I've been trying this the whole day with no results.
I should also mention that I have /a lot/ of modules enabled on my site, maybe there is one that is interfering, but I can't try to disable them one by one, they're too many.
If you want to try, this is the address: http://test.guildofmessengers.com/services/xmlrpc
Comments
Comment #1
marcingy commentedThat error is from drupal core xmlrpc does infact only accepot posts.
Comment #2
Stefano commentedYes, but I used only POST requests and it keeps replying that it only accepts POST requests.
The code I used uses POST requests...I know it for sure because connecting to xmlrpc.php with the same code worked (and also because it's the same code you have on your Handbook)
Any idea why it replies in that way?
I looked at the XMLRPC Server module code and I saw that it includes drupal core's xmlrpc files, but somehow they trigger this error when they are included in this module and not when they are included in xmlrpc.php
Comment #3
marcingy commentedThis error is hit early in boot strap, so the issue is likely something related to the data you are sending and support issues are never critical.
Comment #4
Stefano commentedI see.
Sorry for the critical...it is critical for me, not for Services XD
So...let's see, this is the code I'm using:
Server always replies with "XML-RPC server accepts POST requests only."
in /includes/xmlrpcs.inc, the check that triggers the error is: (at line 56)
but it doesn't make any bell ring in my head :/
EDIT: I also used another Drupal installation to connect. Using xmlrpc() gives the same results
Comment #5
Stefano commentedComment #6
Stefano commentedI was finally able to track the problem.
ALWAYS use a language prefix in the URL pointing to the server...otherwise drupal will try to guess which language it should use and if it finds one it will redirect. And when you get redirected all the POST content is lost.
I had this problem amplified because my website uses /en/ as language prefix for English which is the default language...so if you don't use a language prefix you will always get redirected.