Home » Web Services » SOAP » Bug #450
Non-standard characters result in XML error
Details
| Submitted | 2003-12-18 01:59 UTC |
|---|---|
| From | seven at monacor dot no |
| Status | Bogus |
| Package | SOAP |
| PHP Version | 4.3.4 |
| OS | Win 2K Pro / Debian Linux |
| Roadmaps | (Not assigned) |
Comments
[2003-12-18 01:59 UTC] seven at monacor dot no
Description:
------------
I use a WSDL script based upon disco_server.php found in PEAR/docs/SOAP/example/, using SOAP 0.8RC2. While retrieving data from mySQL database (which has been imported from a M$ Access database), I get the following error if the description field has the non standard character ² (superscript 2, not ²) in it, the 2 as in square meters:
soap_fault Object
(
[error_message_prefix] =>
[mode] => 1
[level] => 1024
[code] => Parser
[message] => XML error on line 23 col 59 byte 1096 not well-formed (invalid token)
[userinfo] => <?xml version="1.0" encoding="UTF-8"?>
At line 23 col 59 there is a ² character.
I know non standard characters are no good neither in xml or html, but in large sites with content generated using Mac/Windows software, one shouldn't rule out that the server could serve such content without turning special character into html entities.
Reproduce code:
---------------
easiest way to reproduce is to use disco_server.php with client.php found in PEAR/docs/SOAP/example/, and having disco_server.php to return the character ².
Expected result:
----------------
Since the script displays perfectly with records without special character, and since there could be people passing special characters via WSDL, I expected it to return the description field like usual. Or maybe not, it's still a beta. And I might have missed something from the documentation.
Actual result:
--------------
I get the php warning: Invalid argument supplied for foreach() in file client.php on line xxx
Line xxx in client.php is the part that splits the array values into variables.
The array returned contains all the data, but is bigger than normal.
[2004-03-05 15:17 UTC] seven at monacor dot no
Not really a bug after all, developers should make sure that xml data doesn't contain irregular characters.