1

Topic: Plugin Webservice - Mode response

Is there any place where I modify the response mode of the webservice plugin?

Before I received a well summarized array return, type:

Protocol: xml-rpc, Method: glpi.test, Function: PluginWebservicesMethodCommon::methodTest
Params: none
Compression: Server:/On, Config:1, Agent:?
Duration: 0.058
Response size: 83
Response content: Array
(
    [glpi] => 0.90.5
    [webservices] => 1.6.0
    [pdf] => 1.0.3
)

I now seemingly get the contents of the xml file directly:

+ Calling 'glpi.test' on https://domain.com/plugins/webservices/xmlrpc.php
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
 <param>
  <value>
   <struct>
    <member>
     <name>glpi</name>
     <value>
      <string>0.90.5</string>
     </value>
    </member>
    <member>
     <name>webservices</name>
     <value>
      <string>1.6.0</string>
     </value>
    </member>
    <member>
     <name>pdf</name>
     <value>
      <string>1.0.3</string>
     </value>
    </member>
   </struct>
  </value>
 </param>
</params>
</methodResponse>
+ Bad response

I would like to return it as the first mode (array), since I already have a structure to handle the returns.

I looked at the general settings and the plugin itself, but nothing had any effect on the change (including reinstalling it).

2

Re: Plugin Webservice - Mode response

Webservices still return an array.
What is your request sended?
Versions of plugin and GLPI?

CentOS 6.5 - PHP 5.6 - PHP 7 - MySQL 5.6  + APC + memcached
GLPI 0.90.5 SVN - GLPI 9.1.3 SVN
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

3 (edited by bgcorreia 2017-03-22 17:20:25)

Re: Plugin Webservice - Mode response

Command:

php testxmlrpc.php --host=domain.com --username=user --password=pass --url=plugins/webservices/xmlrpc.php --method=glpi.test

GLPI 0.90.5
Plugin Version: 1.6.0

4

Re: Plugin Webservice - Mode response

In your param url you must indicate glpi
--url=glpi090/plugins/webservices/xmlrpc.php

For me
+ Calling 'glpi.test' on http://localhost/glpi090/plugins/webservices/xmlrpc.php
+ Response: Array
(
    [glpi] => 0.90.5
    [pdf] => 1.0.3
    [webservices] => 1.6.1
    [appliances] => 2.2.1
)

CentOS 6.5 - PHP 5.6 - PHP 7 - MySQL 5.6  + APC + memcached
GLPI 0.90.5 SVN - GLPI 9.1.3 SVN
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

5

Re: Plugin Webservice - Mode response

My glpi directory is the document root of server name "domain.com". There is nothing wrong with the request, I use the same syntax in other versions, and even this one a while back.

I believe the "problem" was caused by someone (not me smile) having installed several plugins on this server, somehow have modified something in the structure, I do not know exactly.

I migrated to version 9.1 (clean installation, just importing the database) using the plugin 1.6.1 and everything is normal.

Thank you

6

Re: Plugin Webservice - Mode response

Thanks for news

CentOS 6.5 - PHP 5.6 - PHP 7 - MySQL 5.6  + APC + memcached
GLPI 0.90.5 SVN - GLPI 9.1.3 SVN
Certifiée ITIL (ITV2F, ITILF, ITILOSA)