remotecontrol not working: uncaught exception

Mehr
2 Jahre 11 Monate her #126317 von tvanover
tvanover erstellte das Thema remotecontrol not working: uncaught exception
Hi,

I've followed the guidelines to enable json rpc here:

manual.limesurvey.org/RemoteControl_2_API#add_participants

I created the php example file:

<?php

// without composer this line can be used
// require_once 'path/to/your/rpcclient/jsonRPCClient.php';
// with composer support just add the autoloader
include_once 'vendor/autoload.php';

define( 'LS_BASEURL', ' xxx.be/limesurvey/ '); // adjust this one to your actual LimeSurvey URL
define( 'LS_USER', 'admin' );
define( 'LS_PASSWORD', 'xxxxxx' );

// the survey to process
$survey_id=425522;

// instanciate a new client
$myJSONRPCClient = new \org\jsonrpcphp\JsonRPCClient( LS_BASEURL.'/admin/remotecontrol' );

// receive session key
$sessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD );

// receive all ids and info of groups belonging to a given survey
$groups = $myJSONRPCClient->list_groups( $sessionKey, $survey_id );
print_r($groups, null );

// release the session key
$myJSONRPCClient->release_session_key( $sessionKey );

?>

But when I try to test it, I get this error:

PHP Fatal error: Uncaught exception 'Exception' with message 'Incorrect response id: (request id: 1)' in C:\Inetpub\Venice-Blog\limesurvey\vendor\weberhofer\jsonrpcphp\src\org\jsonrpcphp\JsonRPCClient.php:185
Stack trace:
#0 C:\Inetpub\Venice-Blog\limesurvey\rpc-connect.php(19): org\jsonrpcphp\JsonRPCClient->__call('get_session_key', Array)
#1 C:\Inetpub\Venice-Blog\limesurvey\rpc-connect.php(19): org\jsonrpcphp\JsonRPCClient->get_session_key('admin', 'xxx')
#2 {main}
thrown in C:\Inetpub\Venice-Blog\limesurvey\vendor\weberhofer\jsonrpcphp\src\org\jsonrpcphp\JsonRPCClient.php on line 185

Any ideas? I think the jsonrpc client package was correctly installed (and found by limesurvey). The user / password combo is correct.

I'm running Version 2.06+ Build 150911

Thanks,
Tom

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #126587 von mellorine
mellorine antwortete auf das Thema: remotecontrol not working: uncaught exception
I got the same error when I forgot to enable JSON-RPC in Global Settings. Are you sure you enabled it? Just a thought.

"Go to Global settings, choose the tab 'Services' and select one of the two RPC services (XML-RPC or JSON-RPC) service."
Folgende Benutzer bedankten sich: ashna

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her - 2 Jahre 11 Monate her #126593 von tvanover
tvanover antwortete auf das Thema: remotecontrol not working: uncaught exception
I've found it. base url was wrong (does that mean the example code is wrong, or is it a windows <> unix thing ,

anyway, this is what baseurl should like for me:

xxx.example.org/limesurvey/index.php?r=admin/remotecontrol
Letzte Änderung: 2 Jahre 11 Monate her von DenisChenu. Begründung: example.org is done for this

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #126614 von holch
holch antwortete auf das Thema: remotecontrol not working: uncaught exception
Well, Windows doesn't have url rewriting via htaccess i guess?

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #126629 von DenisChenu
DenisChenu antwortete auf das Thema: remotecontrol not working: uncaught exception
The url shown in your admin GUI is this one or not ?

If the url shown is false : please report a bug

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha