You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2017-03-21 00:47:37

bgcorreia
Member
Registered: 2014-03-26
Posts: 7

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).

Offline

#2 2017-03-22 00:49:19

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,273

Re: Plugin Webservice - Mode response

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


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#3 2017-03-22 17:20:00

bgcorreia
Member
Registered: 2014-03-26
Posts: 7

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

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

Offline

#4 2017-03-22 21:20:48

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,273

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 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#5 2017-03-23 03:14:31

bgcorreia
Member
Registered: 2014-03-26
Posts: 7

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

Offline

#6 2017-03-24 19:53:03

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,273

Re: Plugin Webservice - Mode response

Thanks for news


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

Board footer

Powered by FluxBB