View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016252 | mantisbt | api soap | public | 2013-08-06 04:57 | 2014-02-07 18:24 |
Reporter | zrybola | Assigned To | rombert | ||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.15 | ||||
Target Version | 1.2.16 | Fixed in Version | 1.2.16 | ||
Summary | 0016252: API SOAP provides no answer after MantisBT upgrade | ||||
Description | Recently, I have upgraded MantisBT from 1.2.4 to 1.2.15. This update includes also API SOAP upgrades. We have a Java client using the SOAP webservice of Mantis to create bugs and get project users. However, after the upgrade, the webservice provides no answer for the call of any of the services. To keep my application running after the MantisBT updade, I have had to use the old SOAP API of MantisBT 1.2.4. Does anyone have any idea why the current MantisBT 1.2.15 SOAP API does not work? | ||||
Steps To Reproduce | I have used SoapUI to test the webservice. I tested the webservice calling the service mc_project_get_users. When calling the endpoint of the old Mantis 1.2.4 SOAP API I got the correct answer with the following headers: X-SOAP-Server NuSOAP/0.9.5 (1.123) However, when calling the endpoint of the new MantisBT 1.2.15 SOAP API there is no answer and the headers are like this: Date Tue, 06 Aug 2013 08:08:55 GMT | ||||
Additional Information | We use MantisBT 1.2.15. We use MantisConnect for Java 1.1.1.1 (mantisconnect-client-api-1.1.1.1-src.zip) as it is the most recent version available at the MantisConnect website. This means no change since the last deployment. We use PHP 5.1.6 on httpd-2.2.3. | ||||
Tags | No tags attached. | ||||
Please don't use MantisConnect as it's not affiliated with this project and AFAIK not maintained. If you use Java, you can either generate your own stubs using your tool of choice or reuse the ones from http://search.maven.org/#search|gav|1|g%3A%22biz.futureware.mantis%22%20AND%20a%3A%22mantis-axis-soap-client%22 ( Axis 1 ). Please let me know if you still have problems after switching from MantisConnect. |
|
Thank you very much for that information. I did not find it anywhere. I will try the mantis-axis-soap-client in version 1.2.9 and let you know. |
|
However, the problem does not seem to reside in the API client. I am not even able to call the service using SoapUI to test the API. The answer of the PHP webservice is empty as can be seen in the headers in "steps to reproduce". When I call the service on the previous version 1.2.4 I got the users. When I call the service on the current version 1.2.15, I do get nothing. |
|
Try adding the following line to mc_config_inc.php (create it if it doesn't exist in same directory where you find mc_config_defaults_inc.php) |
|
I created the file mc_config_inc.php in the api/soap directory and added a line $g_mc_use_nusoap = ON; I tried to call the service using the SoapUI and the result is not empty anymore. However, it returns exactly the content of the mc_config_inc.php file. |
|
Change the file to |
|
I am sorry, I forgot about the starting PHP tag :-) Now the API seems to work. I get the answer using both the SoapUI and the application of ours. Thank you very much for your help. |
|
@zrybola, I recommend to use a newer PHP version. @rombert Of course there are differences between PHP versions, e.g. Maybe we should restrict usage of the SOAP extension to PHP versions >= 5.3? |
|
Based on atrol's comment, maybe it would be good to improve the test to set soap default to php-soap only if php >= 5.3 [1] [1] https://github.com/mantisbt/mantisbt/blob/master-1.2.x/api/soap/mc_config_defaults_inc.php#L57 |
|
I agree, but I'd rather test this and see what goes on. PHP 5.1.6 sounds like Centos/RHEL 5, which is still a pretty widely used platform and I would like to see the soap extension working on that. |
|
By running SOAP tests against a Centos5 VM I notice the following error in the logs PHP Fatal error: Uncaught SoapFault exception: [Server] Error Type: SYSTEM NOTICE,\nError Description: Use of undefined constant SOAP_USE_XSI_ARRAY_TYPE - assumed 'SOAP_USE_XSI_ARRAY_TYPE' in /var/www/html/mantisbt/api/soap/mc_api.php:107\nStack trace:\n#0 /var/www/html/mantisbt/api/soap/mc_api.php(530): SoapActions::sendSoapFault('Server', 'Error Type: SYS...')\n#1 /var/www/html/mantisbt/api/soap/mantisconnect.php(120): mc_error_handler(8, 'Use of undefine...', '/var/www/html/m...', 120, Array)\n#2 {main}\n thrown in /var/www/html/mantisbt/api/soap/mc_api.php on line 107 According to the changelog ( http://php.net/ChangeLog-5.php#5.2.2 ) this constant was first added in PHP 5.2.2. To be on the safe side, I've added a defined() check for this constant in addition to checking for the soap extension being available. Although I think it's enough to check just for the constant but I can't be 100% sure. |
|
The check for master is not needed as we have PHP 5.3.2 as minimum required PHP version. |
|
MantisBT: master-1.2.x 1f1ce77f 2013-08-07 12:43 Details Diff |
soap api: make sure we have a compatible soap extension installed Even though the soap extension is installed, versions of PHP older than 5.2.2 do not support all the features we need. To guard against unexpected errors, we now enable the soap extension if the SOAP_USE_XSI_ARRAY_TYPE constant is defined. This constant is used at runtime by the SOAP extension and is a good indicator of a recent enough soap extension. Fixes 0016252: API SOAP provides no answer after MantisBT upgrade |
Affected Issues 0016252 |
|
mod - api/soap/mc_config_defaults_inc.php | Diff File | ||
MantisBT: master 16a6139c 2013-08-07 12:43 Details Diff |
soap api: make sure we have a compatible soap extension installed Even though the soap extension is installed, versions of PHP older than 5.2.2 do not support all the features we need. To guard against unexpected errors, we now enable the soap extension if the SOAP_USE_XSI_ARRAY_TYPE constant is defined. This constant is used at runtime by the SOAP extension and is a good indicator of a recent enough soap extension. Fixes 0016252: API SOAP provides no answer after MantisBT upgrade |
Affected Issues 0016252 |
|
mod - api/soap/mc_config_defaults_inc.php | Diff File |