#34748 [Com]: soap: wrong encoding return
| From: | even at phoniax dot no | Date: | Tue, 05 Sep 2006 18:24:12 +0000 |
| Subject: | #34748 [Com]: soap: wrong encoding return | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-101780@lists.php.net to get a copy of this message | ||
ID: 34748
Comment by: even at phoniax dot no
Reported By: flobee at gmail dot com
Status: No Feedback
Bug Type: SOAP related
Operating System: xp/*nix
PHP Version: 5.1.0RC1
New Comment:
I have the same problem in 5.1.4 on a CentOS server.
You can use this WSDL for testing:
http://webservices.iptelefoni.no/?class=OrderManager&wsdl
The output from __getLastRequest outputs that it requests
encoding in UTF-8.
Even when I PEAR's Soap Client (which _do_ send the correct
encoding) the PHP 5.1.4 SoapServer returns the XML in utf8
encoding.
Both server and client has been set the option for encoding
to ISO-8859-1.
Previous Comments:
------------------------------------------------------------------------
[2005-10-14 01:00:04] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2005-10-06 15:30:36] tony2001@php.net
And where can I find the a.wsdl ?
------------------------------------------------------------------------
[2005-10-06 15:22:06] flobee at gmail dot com
[server]
theServerClass {
function __construct() { }
function set($in) {
return array('code'=>'â¬â¬â¬');
}
}
$server = new SoapServer('a.wsdl',array('encoding'=>'ISO-8859-1'));
$server->setClass('theServerClass');
$server->handle();
[client]
$cli = new SoapClient('a.wsdl',
array('encoding'=>'ISO-8859-1','soap_version'=> SOAP_1_2,
'trace'=>
1));
$result = $cli->set('somthing');
print_r($cli->__getLastResponse());
...
xml-Response: <?xml version="1.0" encoding="UTF-8"?>
but IS ISO-8859-1
set encoding to utf-8 the "â¬" will throw a SoapFault.
------------------------------------------------------------------------
[2005-10-06 13:34:31] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2005-10-06 07:11:49] flobee at gmail dot com
Description:
------------
request and Response are always set to utf-8 even when server and
client are set to ISO-8859-1 :-(
the good: it's handled to be ISO-8859-1 or will throw a SoapFault.
Reproduce code:
---------------
$a =new SoapClient($wsdl, array('encoding'=>'ISO-8859-1');
$b=new SoapServer($wsdl , array('encoding'=>'ISO-8859-1'));
xml-Request : <?xml version="1.0" encoding="UTF-8"?>...
xml-Response: <?xml version="1.0" encoding="UTF-8"?>...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34748&edit=1