| Anonymous | Login | Signup for a new account | 2013-05-18 19:23 EDT | ![]() |
| Main | My View | View Issues | Change Log | Roadmap | Wiki | ManTweet | Repositories |
| View Issue Details [ Jump to Notes ] [ Wiki ] [ Related Changesets ] | [ Issue History ] [ Print ] | ||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||
| 0014157 | mantisbt | api soap | public | 2012-04-16 08:07 | 2013-04-06 08:28 | ||||
| Reporter | chrstph | ||||||||
| Assigned To | rombert | ||||||||
| Priority | low | Severity | minor | Reproducibility | always | ||||
| Status | closed | Resolution | fixed | ||||||
| Platform | PHP 5.4 | OS | OS Version | ||||||
| Product Version | 1.2.10 | ||||||||
| Target Version | 1.2.13 | Fixed in Version | 1.2.13 | ||||||
| Summary | 0014157: Array to string conversion error on soap request with PHP 5.4 | ||||||||
| Description | I try to complete my installation of Mylyn 3.6 with Mantis 1.2.10. To check the error received in Eclipse, I test the webservice with SOAPUI4.0.1 I check the service "mc_projects_get_user_accessible" via the URL mantis/api/soap/mantisconnect.php. When I send this envelope: <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" [^] xmlns:xsd="http://www.w3.org/2001/XMLSchema" [^] xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" [^] xmlns:man="http://futureware.biz/mantisconnect"> [^] <soapenv:Header/> <soapenv:Body> <man:mc_projects_get_user_accessible soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> [^] <username xsi:type="xsd:string">usr</username> <password xsi:type="xsd:string">pwd</password> </man:mc_projects_get_user_accessible> </soapenv:Body> </soapenv:Envelope I receive this error: <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" [^] xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" [^] 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:Body> <SOAP-ENV:Fault> <faultcode xsi:type="xsd:string">Server</faultcode> <faultactor xsi:type="xsd:string"/> <faultstring xsi:type="xsd:string"><![CDATA[Error Type: SYSTEM NOTICE, Error Description: Array to string conversion, Stack Trace: nusoap.php L5763 serializeType(<string>'return', <string>'tns:ProjectDataArray', <Array> { [0] => <Array> { ['id'] => 1, ['name'] => 'mylyn-test', ['status'] => <Array> { ['id'] => '10', ['name'] => 'development' }, ['enabled'] => '1', ['view_state'] => <Array> { ['id'] => '10', ['name'] => 'public' }, ['access_min'] => <Array> { ['id'] => '10', ['name'] => 'viewer' }, ['file_path'] => '', ['description'] => '', ['subprojects'] => <Array> { } }, [1] => <Array> { ['id'] => 2, ['name'] => 'sandbox', ['status'] => <Array> { ['id'] => '10', ['name'] => 'development' }, ['enabled'] => '1', ['view_state'] => <Array> { ['id'] => '10', ['name'] => 'public' }, ['access_min'] => <Array> { ['id'] => '10', ['name'] => 'viewer' }, ['file_path'] => '', ['description'] => '', ['subprojects'] => <Array> { } } }, <string>'encoded', <boolean>false) nusoap.php L4133 serializeRPCParameters(<string>'mc_projects_get_user_accessible', <string>'output', <Array> { [0] => <Array> { [0] => <Array> { ['id'] => 1, ['name'] => 'mylyn-test', ['status'] => <Array> { ['id'] => '10', ['name'] => 'development' }, ['enabled'] => '1', ['view_state'] => <Array> { ['id'] => '10', ['name'] => 'public' }, ['access_min'] => <Array> { ['id'] => '10', ['name'] => 'viewer' }, ['file_path'] => '', ['description'] => '', ['subprojects'] => <Array> { } }, [1] => <Array> { ['id'] => 2, ['name'] => 'sandbox', ['status'] => <Array> { ['id'] => '10', ['name'] => 'development' }, ['enabled'] => '1', ['view_state'] => <Array> { ['id'] => '10', ['name'] => 'public' }, ['access_min'] => <Array> { ['id'] => '10', ['name'] => 'viewer' }, ['file_path'] => '', ['description'] => '', ['subprojects'] => <Array> { } } } }) nusoap.php L3721 serialize_return() mantisconnect.php L1717 service(<string>'<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" [^] xmlns:xsd="http://www.w3.org/2001/XMLSchema" [^] xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" [^] xmlns:man="http://futureware.biz/mantisconnect"> [^] <soapenv:Header/> <soapenv:Body> <man:mc_projects_get_user_accessible soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> [^] <username xsi:type="xsd:string">usr</username> <password xsi:type="xsd:string">pwd</password> </man:mc_projects_get_user_accessible> </soapenv:Body> </soapenv:Envelope>')]]></faultstring> <detail xsi:type="xsd:string"/> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelop> I'm trying to find into the mantis configuration if I missed something but in case, I report a possible bug ? The web client and the server are running on the same host, PHP seems running with a memory limit set to 128M. | ||||||||
| Steps To Reproduce | SOAPUI4, call mc_projects_get_user_accessible with a valid user/password. | ||||||||
| Tags | No tags attached. | ||||||||
| Attached Files | |||||||||
Relationships |
|||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||
Notes |
|
|
rombert (developer) 2012-04-17 11:59 |
I don't see anything obviously wrong in the stack trace so I'm not sure what triggered the notice. What version of PHP are you running? |
|
chrstph (reporter) 2012-04-18 07:16 |
Windows: XP (localhost: web client, soapui and server) Apache: 2.2 PHP: 5.4.0 SOAP UI: 4.0.1 |
|
rombert (developer) 2012-04-18 08:06 |
This might be an PHP 5.4.0 issue . Can you try with PHP 5.3.x ? |
|
chrstph (reporter) 2012-04-19 03:31 |
Hi, It's working with 5.3.10, didn't tried with 5.4.1RC2 Thanks for your time. |
|
rombert (developer) 2012-04-19 05:05 |
If the problem is PHP 5.4 we should fix this in the near future, but it's not such high priority. |
|
qingwl (reporter) 2012-05-28 04:20 |
Hi, I got the same errors when trying on most of the methods, e.g. 'mc_enum_project_status' on PHP 5.3.2. |
|
rombert (developer) 2012-05-28 15:02 |
(In reply to comment 0014157:0031910) > Hi, > > I got the same errors when trying on most of the methods, e.g. > 'mc_enum_project_status' on PHP 5.3.2. Can you confirm that it's 5.3.2 ? I've been running the SOAP API on PHP 5.3.x for months with no issues. |
|
vboctor (administrator) 2012-06-02 18:46 |
@rombert, I've marked 0014290 as a duplicate of this one. The user had issues with 5.4 that got fixed when downgrading to an older PHP version. Any idea why we are having this issue? Thoughts about a fix? |
|
rombert (developer) 2012-06-05 15:19 |
I'm not sure where to start ; I don't have a php 5.4 box for testing but I might get around to it next week. A good discussion of the technical issue can be found at https://github.com/symfony/symfony/issues/2585 [^] . |
|
rombert (developer) 2012-06-13 16:40 |
The fix for bug 0014341 should prevent system notices from halting SOAP call execution. Can you retry with 1.2.11 on PHP 5.4? |
|
papoanaya (reporter) 2012-06-24 18:23 edited on: 2012-06-24 18:27 |
Hi: I got hit with this problem when Arch Linux upgraded to PHP 2.4. Being that a downgrade was not an option, I decided to go to the bottom of it. The problem seems to be on the debug statement when it tries to convert an array to a string around line 6139 in serializeType in nusoap.php. The debug statement is in comments in the note, because is the one causing the error problems. Most likely it should be resolved with an application of implode on the right variable type. But being that I do not need to run debug, a comment on the statement will do it for me. Code included: $rows = sizeof($value); $contents = ''; foreach($value as $k => $v) { // PROBLEM STATEMENT //$this->debug("serializing array element: $k, $v of type: $typeDef[arrayType]"); // PROBLEM STATEMENT //if (strpos($typeDef['arrayType'], ':') ) { if (!in_array($typeDef['arrayType'],$this->typemap['http://www.w3.org/2001/XMLSchema' [^]])) { $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use); } else { $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use); } ... |
|
rombert (developer) 2012-06-25 08:26 |
Great, thanks for letting us know. I think we should look into patching this ourselves before nusoap comes up with a new release. |
|
skeyby (reporter) 2012-09-11 09:11 |
I can confirm the problem (PHP 5.4.6 under FreeBSD) and, most important, I can confirm the fix. The exact line for mantis 1.2.11 is 6132: removing the debug statement resolved all the problems. |
|
dennis (reporter) 2012-10-11 23:26 |
yes, it's php 5.4.x issue. I have the same issue. |
|
rombert (developer) 2012-11-01 16:20 |
Rather than take the burden of maintaining a fork of nusoap, I plan to 'fix' this by allowing you to use the php5 soap extension instead of nusoap. Would such an approach work for you? |
|
rombert (developer) 2012-11-12 17:18 |
The next version supports using the php5 soap extension if it is present, and by definition this supports PHP 5.4. |
|
dust (reporter) 2012-11-14 03:45 |
I found bug related to this problem, at mc_api.php Any russian letters removes by regex. Simple fix: /** * Removes any invalid character from the string per XML 1.0 specification * * @param string $p_input * @return string the sanitized XML */ function mci_sanitize_xml_string ( $p_input ) { - return preg_replace( '/[^\x9\xA\xD\x20-\xD7FF\xE000-\xFFFD\x{10000}-\x{10FFFF}]/u', '', $p_input); + return htmlspecialchars($p_input); } |
|
rombert (developer) 2012-11-14 03:55 |
Thanks for reporting this error! I don't think we can apply your fix, as nusoap/the soap extension already do this encoding and it's not effective for our problem. But I'll try to make the regex not reomve russian letters. |
|
dregad (developer) 2012-11-15 13:34 edited on: 2012-11-15 13:34 |
Hey guys, I took me a while to research why the regex was not working, but I think I have finally got it, thanks to [1] - it appears that PHP / PCRE does not recognize the \xNNNN syntax, you have to use the \x{NNNN} constructs all the time Could you please try with the following regex: [^\x9\xA\xD\x20-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]+/u Let me know how it goes. [1] http://stackoverflow.com/questions/2728070/how-do-i-replace-characters-not-in-range-0x5e10-0x7f35-with-in-php/2728372#2728372 [^] |
|
rombert (developer) 2012-11-15 15:03 |
The fix works fine for my test ( Russian, Mandarin Chinese ). Thanks! |
|
papoanaya (reporter) 2012-11-19 18:53 |
Rombert: Sorry for the delay, using the PHP5 soap extension rather than nusoap.php is fine with me. I did not see any objections and the issue is marked as fixed. I'll look forward to it on the next release. :) Thanks. Luis |
|
grangeway (developer) 2013-04-05 17:56 |
Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch |
Related Changesets |
|||
|
MantisBT: master 7ae2d9ae
Timestamp: 2012-11-15 20:01:22 Author: rombert [ Details ] [ Diff ] |
Fix replacing of invalid XML characters Fixes 0014157: Array to string conversion error on soap request with PHP 5.4 |
||
| mod - api/soap/mc_api.php | [ Diff ] [ File ] | ||
|
MantisBT: master-1.2.x 500a0fce
Timestamp: 2012-11-15 20:01:22 Author: rombert [ Details ] [ Diff ] |
Fix replacing of invalid XML characters Fixes 0014157: Array to string conversion error on soap request with PHP 5.4 |
||
| mod - api/soap/mc_api.php | [ Diff ] [ File ] | ||
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-04-16 08:07 | chrstph | New Issue | |
| 2012-04-17 11:59 | rombert | Note Added: 0031677 | |
| 2012-04-17 11:59 | rombert | Status | new => feedback |
| 2012-04-17 11:59 | rombert | Description Updated | View Revisions |
| 2012-04-18 07:16 | chrstph | Note Added: 0031683 | |
| 2012-04-18 07:16 | chrstph | Status | feedback => new |
| 2012-04-18 08:06 | rombert | Note Added: 0031684 | |
| 2012-04-18 08:06 | rombert | Status | new => feedback |
| 2012-04-18 08:06 | rombert | Platform | => PHP 5.4 |
| 2012-04-19 03:31 | chrstph | Note Added: 0031690 | |
| 2012-04-19 03:31 | chrstph | Status | feedback => new |
| 2012-04-19 05:05 | rombert | Note Added: 0031691 | |
| 2012-04-19 05:05 | rombert | Priority | normal => low |
| 2012-04-19 05:05 | rombert | Severity | block => minor |
| 2012-04-19 05:05 | rombert | Status | new => acknowledged |
| 2012-04-19 05:05 | rombert | Target Version | => 1.2.11 |
| 2012-04-19 05:05 | rombert | Summary | Array to string conversion error on soap request => Array to string conversion error on soap request with PHP 5.4 |
| 2012-05-28 04:20 | qingwl | Note Added: 0031910 | |
| 2012-05-28 15:02 | rombert | Note Added: 0031915 | |
| 2012-06-02 18:44 | vboctor | Relationship added | has duplicate 0014290 |
| 2012-06-02 18:46 | vboctor | Note Added: 0031984 | |
| 2012-06-05 15:19 | rombert | Note Added: 0032026 | |
| 2012-06-06 23:54 | jreese | Target Version | 1.2.11 => 1.2.12 |
| 2012-06-13 16:40 | rombert | Note Added: 0032092 | |
| 2012-06-13 16:40 | rombert | Status | acknowledged => feedback |
| 2012-06-24 18:23 | papoanaya | Note Added: 0032165 | |
| 2012-06-24 18:27 | papoanaya | Note Edited: 0032165 | View Revisions |
| 2012-06-25 08:26 | rombert | Note Added: 0032173 | |
| 2012-09-11 09:11 | skeyby | Note Added: 0032820 | |
| 2012-10-11 23:26 | dennis | Note Added: 0033170 | |
| 2012-11-01 16:20 | rombert | Note Added: 0033406 | |
| 2012-11-10 19:04 | dregad | Target Version | 1.2.12 => 1.2.13 |
| 2012-11-12 17:18 | rombert | Relationship added | related to 0014871 |
| 2012-11-12 17:18 | rombert | Note Added: 0034305 | |
| 2012-11-12 17:18 | rombert | Assigned To | => rombert |
| 2012-11-12 17:18 | rombert | Status | feedback => resolved |
| 2012-11-12 17:18 | rombert | Resolution | open => fixed |
| 2012-11-12 17:18 | rombert | Fixed in Version | => 1.2.13 |
| 2012-11-14 03:45 | dust | Note Added: 0034309 | |
| 2012-11-14 03:55 | rombert | Note Added: 0034310 | |
| 2012-11-14 03:55 | rombert | Status | resolved => assigned |
| 2012-11-14 03:55 | rombert | Resolution | fixed => reopened |
| 2012-11-15 13:34 | dregad | Note Added: 0034326 | |
| 2012-11-15 13:34 | dregad | Note Edited: 0034326 | View Revisions |
| 2012-11-15 13:37 | dregad | Relationship added | related to 0014744 |
| 2012-11-15 15:03 | rombert | Changeset attached | => MantisBT master 7ae2d9ae |
| 2012-11-15 15:03 | rombert | Status | assigned => resolved |
| 2012-11-15 15:03 | rombert | Changeset attached | => MantisBT master-1.2.x 500a0fce |
| 2012-11-15 15:03 | rombert | Note Added: 0034329 | |
| 2012-11-19 18:53 | papoanaya | Note Added: 0034351 | |
| 2013-01-22 09:46 | dregad | Resolution | reopened => fixed |
| 2013-01-22 09:46 | dregad | Description Updated | View Revisions |
| 2013-01-22 09:47 | dregad | Status | resolved => closed |
| 2013-01-28 11:33 | rombert | Relationship added | has duplicate 0015435 |
| 2013-03-27 09:03 | rombert | Relationship added | has duplicate 0015687 |
| 2013-04-05 17:56 | grangeway | Status | closed => acknowledged |
| 2013-04-05 17:56 | grangeway | Note Added: 0036129 | |
| 2013-04-05 19:33 | grangeway | Relationship added | related to 0015721 |
| 2013-04-06 03:39 | dregad | Status | acknowledged => resolved |
| 2013-04-06 07:21 | grangeway | Status | resolved => acknowledged |
| 2013-04-06 08:28 | grangeway | Status | acknowledged => closed |
| MantisBT 1.2.16dev master-1.2.x-8c2bd07 [^]
Copyright © 2000 - 2013 MantisBT Team
Time: 0.1436 seconds. memory usage: 3,053 KB |