#42488 [NEW]: SoapServer reports an encoding error and the error itself breaks

From: Date: Thu, 30 Aug 2007 14:15:16 +0000
Subject: #42488 [NEW]: SoapServer reports an encoding error and the error itself breaks
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-116894@lists.php.net to get a copy of this message
From: edman007 at edman007 dot com Operating system: Linux PHP version: 5CVS-2007-08-30 (snap) PHP Bug Type: SOAP related Bug description: SoapServer reports an encoding error and the error itself breaks Description: ------------ when a function passes a string that is not UTF-8 compliant back to SoapServer as part of a response SoapServer throws and error saying (or i guess its suppose to) that it could not encode it. However the error message reports the error message itself, not the problematic string as the cause of the error, and then finishes off with a small portion of the problematic string, resulting in a very hard to understand error message that also does not really say where it failed. Reproduce code: --------------- ---client.php-- <?php ini_set('soap.wsdl_cache_enabled', 0); $soap = new SoapClient('./something.wsdl'); try { echo $soap->getBadUTF(); } catch (SoapFault $e){ echo $e->faultstring; } ?> ---server.php--- <?php ini_set('soap.wsdl_cache_enabled', 0); $soap = new SoapServer('./something.wsdl'); function getBadUTF(){ return "stuff\x93thing"; } $soap->addFunction('getBadUTF'); $soap->handle(); ?> ---something.wsdl--- <?xml version="1.0"?> <wsdl:definitions name="OSCAdmin" targetNamespace="http://www.example.com/" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:tns="http://www.example.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> <wsdl:message name="getBadUTF"> <wsdl:part name="out" type="xsd:string"/> </wsdl:message> <wsdl:portType name="demoPortType"> <wsdl:operation name="getBadUTF"> <wsdl:output message="tns:getBadUTF"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="demoSoapBinding" type="tns:demoPortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="getBadUTF"> <soap:operation soapAction=""/> <wsdl:output name="out"> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="demoService"> <wsdl:port name="demoPort" binding="tns:demoSoapBinding"> <soap:address location="http://localhost/server.php"/> </wsdl:port> </wsdl:service> </wsdl:definitions> Expected result: ---------------- SOAP-ERROR: Encoding: string 'stuff"thing' Actual result: -------------- SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'SOAP-ERROR: Encoding: string 'st -- Edit bug report at http://bugs.php.net/?id=42488&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42488&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42488&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42488&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42488&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42488&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42488&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42488&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42488&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42488&r=support Expected behavior: http://bugs.php.net/fix.php?id=42488&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42488&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42488&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42488&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42488&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42488&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42488&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42488&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42488&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42488&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42488&r=mysqlcfg

« previous php.bugs (#116894) next »