#45025 [NEW]: Encoding: Violation of encoding rules
| From: | ol777 at oldi dot ru | Date: | Fri, 16 May 2008 20:48:16 +0000 |
| Subject: | #45025 [NEW]: Encoding: Violation of encoding rules | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-125058@lists.php.net to get a copy of this message | ||
From: ol777 at oldi dot ru
Operating system: Windows2000
PHP version: 5.2.6
PHP Bug Type: SOAP related
Bug description: Encoding: Violation of encoding rules
Description:
------------
I have "Encoding: Violation of encoding rules", when I try get object
(<m:ErrorCode>0</m:ErrorCode><m:ErrorMessage>no</m:ErrorMessage>
<m:ErrorDebugMessage>no</m:ErrorDebugMessage>) as result from SOAP server.
When SOAP server return result as object:
--------
... <m:return xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<m:ErrorCode>0</m:ErrorCode> <m:ErrorMessage>no</m:ErrorMessage>
<m:ErrorDebugMessage>no</m:ErrorDebugMessage> </m:return> ... )
---------
- I have "Encoding: Violation of encoding rules"
But, when SOAP server return result as plain string ("Test"):
---------
... <m:return xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Test</m:return>
...
---------
- there is no error.
On PHP 5.2.5 I have same error and my Apache 2.2 has crash, on PHP 5.2.6 I
only have error
Reproduce code:
---------------
<?
$parameters = array("ID_Client"=>"1",
"CardNumber"=>"q", "DateFrom"=>
"20080421000000", "DateTo"=>q);
try {
$soap = new SoapClient( "http://10.0.0.1/ws/mysoap.1cws?wsdl" ,
array(
"login" => "mylogin",
"password" => "mypass",
"trace" => 1,
"exceptions" => 1)
);
$result = $soap->GetOrders($parameters);
} catch (SoapFault $fault){
echo "faultcode: ".$fault->faultcode.", faultstring:
".iconv('utf-8',
'windows-1251',$fault->faultstring)."<br>";
echo = '<h2>Request:</h2>
' . htmlspecialchars(iconv('utf-8',
'windows-1251',$soap->__getLastRequest()), ENT_QUOTES) . '
<h2>Answer:</h2>
' . htmlspecialchars(iconv('utf-8',
'windows-1251',$soap->__getLastResponse()), ENT_QUOTES) . '<br>';
?>
Actual result:
--------------
faultcode: Client, faultstring: SOAP-ERROR: Encoding: Violation of
encoding rules
Request:
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://localhost/ws/myoldi"><SOAP-ENV:Body><ns1:GetOrders><ns1:ID_Client>1</ns1:ID_Client><ns1:CardNumber>q</ns1:CardNumber><ns1:DateFrom>20080421000000</ns1:DateFrom><ns1:DateTo>q</ns1:DateTo></ns1:GetOrders></SOAP-ENV:Body></SOAP-ENV:Envelope>
Answer:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/> <soap:Body> <m:GetOrdersResponse
xmlns:m="http://localhost/ws/myoldi">
<m:return
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<m:ErrorCode>0</m:ErrorCode> <m:ErrorMessage>no</m:ErrorMessage>
<m:ErrorDebugMessage>no</m:ErrorDebugMessage> </m:return>
</m:GetOrdersResponse></soap:Body> </soap:Envelope>
--
Edit bug report at http://bugs.php.net/?id=45025&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45025&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45025&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45025&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45025&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45025&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45025&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45025&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45025&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45025&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45025&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45025&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45025&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45025&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45025&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45025&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45025&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45025&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45025&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45025&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45025&r=mysqlcfg