View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
09372Bug reportsRemoteControlpublic2014-12-10 09:21
Reporteruser36100Assigned Toc_schmitz  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary09372: get responses in use xml-rpc and export_responses method
Description

When i try to get response with export_responses method in xml-rpc i have an error xmlrpx malformed response.
I think this error due to the tag <base64> and </base64> are missing in the function xmlrpc_echo_stream in BigData.php file.

Steps To Reproduce

Where i use export_responses method in xml-rpc communication.

TagsNo tags attached.
Attached Files
exportresponses.txt (558 bytes)   
		$limesurvey_server =  $this->container->getParameter('limesurvey_server');
		$webServiceUrl = $this->container->getParameter('webServiceUrl');
		$limesurvey_login = $this->container->getParameter('limesurvey_login');
		$limesurvey_password = $this->container->getParameter('limesurvey_password');

		$client = new Client($webServiceUrl);
		$sessionKey = $client->call('get_session_key',array($limesurvey_login,$limesurvey_password));
		$limesurvey_responses  = $client->call('export_responses',array($sessionKey,$surveyId,'csv','fr','all','code','log'));

exportresponses.txt (558 bytes)   
Bug heat6
Complete LimeSurvey version number (& build)Version 2.05+ Build 141113
I will donate to the project if issue is resolvedNo
Browserfirefox
Database type & versionmysql-server-5.5
Server OS (if known)debian wheezy
Webserver software & version (if known)apache2 2.2.22
PHP Version5.4.35

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2014-11-26 10:41

administrator   ~31099

Please attach a small example script, thank you.

user36100

2014-11-26 11:19

  ~31102

Hi.
I work with symfony 2 and i use symfony-rpc-bundle (https://github.com/skolodyazhnyy/symfony-rpc-bundle). In my file you can see that i call the export_response method with 'call' function. After this call i have an 'The XML document has not valid XML-RPC content' error ( you can see this error in https://github.com/skolodyazhnyy/symfony-rpc-bundle/blob/master/XmlRpc/Implementation.php).
Actually i must add tag in BigDate.php file in xmlrpc_echo_stream function like this :

    protected static function xmlrpc_echo_stream($data)
    {
        echo &quot;&lt;base64>&quot;;
        $data->render();
        echo &quot;&lt;/base64>&quot;;
    }

Thanks a lot for your response.

c_schmitz

c_schmitz

2014-11-26 16:46

administrator   ~31103

Last edited: 2014-11-26 17:03

The function does not advertise to give back base64 but a simple string, which happens to be base64, but that should not be the problem.
Do you state somewhere in your client that base64 is expected?

I see that in the XML_RPC response the type is not advertised.
The XML-RPC specs says though:

"If no type is indicated, the type is string."

I assume that your XML-RPC client is not behaving properly.

user36100

2014-11-26 17:06

  ~31104

Yes, a simple string but encoded in base64 like an encoded file.
When the tags are specified , the rpcbundle can decode in base64 and i can read the limesurvey response.
In first you can see the decoding processus in https://github.com/skolodyazhnyy/symfony-rpc-bundle/blob/master/XmlRpc/Implementation.php (line 229).
Then you can see the real decoding in https://github.com/skolodyazhnyy/symfony-rpc-bundle/blob/master/XmlRpc/ValueType/BlobType.php (line 34)

Thanks a lot.

c_schmitz

c_schmitz

2014-11-26 17:15

administrator   ~31105

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=14665

c_schmitz

c_schmitz

2014-11-26 17:16

administrator   ~31106

Implemented a small fix to indicate the type explicitly as string.

c_schmitz

c_schmitz

2014-11-26 17:17

administrator   ~31107

Fix committed to 2.06 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=14666

c_schmitz

c_schmitz

2014-11-26 17:18

administrator   ~31108

I have to force it to string, as it would break existing integrations, otherwise.
You will have to decode the base64 in your application separately (which should not be much of a problem)

user36100

2014-11-26 17:50

  ~31109

Thanks a lot.

It works!

Best regards.

user36100

2014-11-26 18:00

  ~31110

For The XML-RPC specs

I will suggest this specs to the bundle devlopper.

Thanks again.

alibert

alibert

2014-12-02 08:43

reporter   ~31136

Hi!

I am using the JSON-RPC interface and this change broke my code.
Suddenly a '<string>' is added to the front of the response and '</string>' is added to the back.

base64_decode fails on this.

It is not documented to do so. So why change this?
We are customers of "Limeservice", having currently 4-6 Surveys open and rely on a stable environment. Please don't fix things that are not broken, according to the documentation.

Can you explain this to me?

Thanks.

PS:Otherwise Limesurvey is great.

c_schmitz

c_schmitz

2014-12-02 11:29

administrator   ~31137

Last edited: 2014-12-02 11:30

alibert, it is a valid response, as I wrote before the XML-RPC specs say "If no type is indicated, the type is string." So I just added something that can or cannot be there according to specs.

If your XML-RPC client is not properly implemented then yes, stuff will break. But it is not to blame on LimeSurvey.

user36100

2014-12-02 11:45

  ~31140

Hi alibert and C schmitz.
I asked the xml-rpc symfony bundle developer for these changes and i hope receive a positive response. Then if these tags make problems, you can delete them.

c_schmitz

c_schmitz

2014-12-10 09:21

administrator   ~31227

Version 2.05+ Build 141210 released

Related Changesets

LimeSurvey: master 733d98f9

2014-11-26 16:15:08

c_schmitz

Details Diff
Fixed issue 09372: RemoteControl export_responses breaks with some XML-RPC clients Affected Issues
09372
mod - application/libraries/BigData.php Diff File

LimeSurvey: 2.06 d3804be6

2014-11-26 16:15:08

c_schmitz

Details Diff
Fixed issue 09372: RemoteControl export_responses breaks with some XML-RPC clients Affected Issues
09372
mod - application/libraries/BigData.php Diff File

Issue History

Date Modified Username Field Change
2014-11-25 14:30 user36100 New Issue
2014-11-26 10:41 c_schmitz Note Added: 31099
2014-11-26 10:41 c_schmitz Assigned To => c_schmitz
2014-11-26 10:41 c_schmitz Status new => feedback
2014-11-26 11:19 user36100 Note Added: 31102
2014-11-26 11:19 user36100 Status feedback => assigned
2014-11-26 12:48 user36100 Issue Monitored: user36100
2014-11-26 12:48 user36100 File Added: exportresponses.txt
2014-11-26 16:46 c_schmitz Note Added: 31103
2014-11-26 17:02 c_schmitz Note Edited: 31103
2014-11-26 17:03 c_schmitz Note Edited: 31103
2014-11-26 17:03 c_schmitz Status assigned => feedback
2014-11-26 17:06 user36100 Note Added: 31104
2014-11-26 17:06 user36100 Status feedback => assigned
2014-11-26 17:15 c_schmitz Changeset attached => LimeSurvey master 733d98f9
2014-11-26 17:15 c_schmitz Note Added: 31105
2014-11-26 17:15 c_schmitz Resolution open => fixed
2014-11-26 17:16 c_schmitz Note Added: 31106
2014-11-26 17:16 c_schmitz Status assigned => resolved
2014-11-26 17:16 c_schmitz Fixed in Version => 2.05+
2014-11-26 17:17 c_schmitz Changeset attached => LimeSurvey 2.06 d3804be6
2014-11-26 17:17 c_schmitz Note Added: 31107
2014-11-26 17:18 c_schmitz Note Added: 31108
2014-11-26 17:50 user36100 Note Added: 31109
2014-11-26 18:00 user36100 Note Added: 31110
2014-12-02 08:43 alibert Note Added: 31136
2014-12-02 11:29 c_schmitz Note Added: 31137
2014-12-02 11:30 c_schmitz Note Edited: 31137
2014-12-02 11:45 user36100 Note Added: 31140
2014-12-10 09:21 c_schmitz Note Added: 31227
2014-12-10 09:21 c_schmitz Status resolved => closed