Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Problem with JSON get_session_key - SOLVED -

  • erichn
  • erichn's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 6 months ago #231739 by erichn
Problem with JSON get_session_key was created by erichn
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.3.31
Own server or LimeSurvey hosting: Root server
Survey theme/template: n.u.
==================
One more question comes up when using old code from release 2.05. RPC2 is used with JSON. This runs fine:

$myJSONRPCClient = new JsonRPCClient( LS_BASEURL.'/index.php/admin/remotecontrol' );

and returns to me:

object(JsonRPCClient)#1 (6) { ["debug":"JsonRPCClient":private]=> bool(false) ["url":"JsonRPCClient":private]=> string(53) " xxx.de/q/index.php/admin/remotecontrol " ["proxy":"JsonRPCClient":private]=> NULL ["id":"JsonRPCClient":private]=> int(1) ["notification":"JsonRPCClient":private]=> bool(false) ["enableCurl":"JsonRPCClient":private]=> bool(true) }

The next instruction failes.

$sessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD, $plugin = 'Authdb');

and I get this response:

Warning: Trying to access array offset on value of type null in /var/www/vhosts/xxx.de/httpdocs/b/f/JsonRPCClient.php on line 192

Warning: Trying to access array offset on value of type null in /var/www/vhosts/xxx.de/httpdocs/b/f/JsonRPCClient.php on line 193

Fatal error: Uncaught Exception: Incorrect response id: (request id: 1) in /var/www/vhosts/xxx.de/httpdocs/b/f/JsonRPCClient.php:193 Stack trace: #0 /var/www/vhosts/xxx.de/httpdocs/b/f/survey-list.php(60): JsonRPCClient->__call() #1 {main} thrown in /var/www/vhosts/xxx.de/httpdocs/b/f/JsonRPCClient.php on line 193


- Limesurvey is located in httpdocs/b/f/.
- Username and password are checked multiple times.
- Tried it with and without the plugin-Parameter.
- Tried the new (?) JSON from weberhofer, as mentioned in the docs

This works on the old LimeSurvey and I'am out of ideas. Could someone give me a hint?

I'm sorry for having so much questions with such a seemingly simple task. I hope that I must not go back too many steps because I am running out of time.

Thanks in advance,
Erich

 

Please Log in to join the conversation.

  • erichn
  • erichn's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 6 months ago #231778 by erichn
Several problems helped together:

- use of old JSON-Client - new weberhofer-client had to be used
- use of old JSON-call with '/index.php/admin/remotecontrol' (never understood how this works). "/index.php" had to be removed
- some confusion with http/https

Now it seems, that at least the use of JSON is OK.

Thanks to everyone that had a thought about my problem,
Erich

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose