php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42223 SoapServer truncates XML document if Server Class includes UTF8 file
Submitted: 2007-08-06 19:33 UTC Modified: 2007-08-31 10:55 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: j8859 at clix dot pt Assigned: dmitry (profile)
Status: Not a bug Package: SOAP related
PHP Version: 5.2.4RC1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: j8859 at clix dot pt
New email:
PHP Version: OS:

 

 [2007-08-06 19:33 UTC] j8859 at clix dot pt
Description:
------------
SoapServer truncates XML document if the Server Class includes a UTF8 file.
The error only occurs if the XML document returned is larger than 8000 bytes. In this case, tha XML document is truncated in the last 3 bytes.

The BOM [Byte-Order Mark] also is 3 bytes long, could it be related with the bug?


Reproduce code:
---------------
There are a lot of files involved.
Download them from: http://web.ioio.info/wstest/wstest.zip
You can see the bug here: http://web.ioio.info/wstest/client.php

You can download the ZIP file, extract it to an Apache directory, correct all addresses: change "web.ioio.info/wstest" for your own address in all files, and try the following in the TestWS.php file:

1)
uncomment [require_once "util-ANSI.php";]
comment [require_once "util-UTF8.php";]
-> The error doesn't occur

2)
On line 14, replace "800" by "700" (the XML document will be smaller than 8000 bytes)
-> The error doesn't occur


Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope 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:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:testResponse><return xsi:type="xsd:string">0123456789
...(800 times: 0123456789)... 0123456789</return></SOAP-ENV:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>


Actual result:
--------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope 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:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:testResponse><return xsi:type="xsd:string">0123456789
...(800 times: 0123456789)... 
0123456789</return></SOAP-ENV:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelop

-> Misses the last 3 chars: "e>\n"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-31 10:55 UTC] dmitry@php.net
Just look into util-UTF8.php and remove first three bytes.
It seems like a UTF-8 prefix for some Windows editor.
 [2011-07-19 03:06 UTC] dsimon at roullier dot com
I had the same problem, because of the encoding of my PHP file containing
my web service (and SoapServer call).

Encoding the file in UTF-8 (Without BOM !) solved my problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 10:01:28 2024 UTC