View Issue Details

IDProjectCategoryView StatusLast Update
0009148mantisbtapi soappublic2009-06-26 12:06
Reporterbugalood Assigned Tograngeway  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
OSLinux UbuntuOS Version8.04 Hardy Heron 
Product Version1.2.0a1 
Summary0009148: The mc_project_add service seems to be broken
Description

We upgraded to Mantis 1.2.0a1 in our test environment and we discovered that the mc_project_add function in the SOAP API seems to be broken. The error seems to come from NuSoap but we are not sure.

Steps To Reproduce

PHP Client code :

$wsdl = 'http://localhost/mantis120/api/soap/mantisconnect.php?wsdl';
$client = new SoapClient($wsdl);

try
{
$status = array('id' => '10');
$viewstate = array('id' => '10');
$access_min = array('id' => '10');

$projectData = array('name' => 'youpie 6',
'status' => $status,
'enabled' => true,
'view_state' => $viewstate,
'access_min' => $access_min,
'file_path' => '',
'description' => 'test');

$issues = $client->mc_project_add('administrator', 'xxxxxx', $projectData);
}
catch (SoapFault $ex)
{
echo $ex;
}

Additional Information

Thrown Fault :

SoapFault exception: [Server] Error Type: SYSTEM NOTICE,
Error Description:
Array to string conversion,
Stack Trace:
Arrayutility_api.php L133 trim(<Array> { ['id'] => 10 })
mc_project_api.php L620 is_blank(<Array> { ['id'] => 10 })
UnknownFile L? mc_project_add(<string>'administrator', <string>'xxxxxx', <Array> { ['name'] => 'youpie 6', ['status'] => <Array> { ['id'] => 10 }, ['enabled'] => true, ['view_state'] => <Array> { ['id'] => 10 }, ['access_min'] => <Array> { ['id'] => 10 }, ['file_path'] => '', ['description'] => 'test' })
nusoap.php L3997 call_user_func_array(<string>'mc_project_add', <Array> { [0] => 'administrator', [1] => 'geramo', [2] => <Array> { ['name'] => 'youpie 6', ['status'] => <Array> { ['id'] => 10 }, ['enabled'] => true, ['view_state'] => <Array> { ['id'] => 10 }, ['access_min'] => <Array> { ['id'] => 10 }, ['file_path'] => '', ['description'] => 'test' } })
nusoap.php L3686 invoke_method()
mantisconnect.php L1418 service(<string>'<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://futureware.biz/mantisconnect" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:mc_project_add><username xsi:type="xsd:string">administrator</username><password xsi:type="xsd:string">xxxxxx</password><project xsi:type="ns1:ProjectData"><name xsi:type="xsd:string">youpie 6</name><status xsi:type="ns1:ObjectRef"><id xsi:type="xsd:integer">10</id></status><enabled xsi:type="xsd:boolean">true</enabled><view_state xsi:type="ns1:ObjectRef"><id xsi:type="xsd:integer">10</id></view_state><access_min xsi:type="ns1:ObjectRef"><id xsi:type="xsd:integer">10</id></access_min><file_path xsi:type="xsd:string"></file_path><description xsi:type="xsd:string">test</description></project></ns1:mc_project_add></SOAP-ENV:Body></SOAP-ENV:Envelope>
')
in E:\xampp\htdocs\tests\performance\perf-test-project-add.php:28
Stack trace:
#0 [internal function]: SoapClient->__call('mc_project_add', Array)
0000001 E:\xampp\htdocs\tests\performance\perf-test-project-add.php(28): SoapClient->mc_project_add('administrator', 'xxxxxx', Array)
0000002 {main}1.00108599663

TagsNo tags attached.

Activities

giallu

giallu

2008-05-14 09:12

reporter   ~0017826

I updated the additional info since it had your password in clear. you may want to change it in your server anyway.

bugalood

bugalood

2008-05-14 10:15

reporter   ~0017827

Damn ! Thanks a lot dude :D !

giallu

giallu

2008-05-14 10:18

reporter   ~0017828

was this working in version 1.1? I had a quick look and I can't see how it could...

The failure is because we call is_blank() from utility_api on an array instead of a string, but I can't see anything changed since the SOAP api was imported.

bugalood

bugalood

2008-05-14 10:24

reporter   ~0017829

Yes it works well on a 1.1.1 version. We were a bit disapointed too because we didn't see any change between 1.2.0a1 and 1.1.1 in WSDL Files using Winmerge.

I will test it again on a 1.1.1 version and I'll keep you in touch !

bugalood

bugalood

2008-05-14 10:30

reporter   ~0017830

The code that we provided has been tested again on a 1.1.1 version, and it worked perfectly. Generation time 1.18481302261 :D !

bugalood

bugalood

2008-05-17 19:53

reporter   ~0017859

Last edited: 2008-05-17 19:55

Couldn't be this issue tagged as confirmed when you said you did not understand how it could work ? Thanks again for your concern about this bug.

giallu

giallu

2008-05-18 05:21

reporter   ~0017863

Sure, though we need to fix it rather than confirm :)

grangeway

grangeway

2008-11-29 20:12

reporter   ~0020137

Hello,

From what I can tell, this issue has already been fixed.

I've just spent some time 'tidying up' the project add function to be a bit more resilient to problems.

Paul

Related Changesets

MantisBT: master 4e978815

2008-11-29 20:11

Paul Richards


Details Diff
Tidy up project add functionality in mantis connect. This has been done whilst reviewing issue 0009148: The mc_project_add service seems to be broken which appears to already have been fixed. Affected Issues
0009148
mod - api/soap/mantisconnect.php Diff File
mod - api/soap/mc_project_api.php Diff File