Possible bug in PHP 5.1 b3 SOAP extension

From: Date: Thu, 08 Sep 2005 12:22:43 +0000
Subject: Possible bug in PHP 5.1 b3 SOAP extension
Groups: php.soap 
Request: Send a blank email to php-soap+get-1981@lists.php.net to get a copy of this message
I have a custom SOAP server (programmed in Delphi 7.0) One of the functions is: base64Binary ExportData(int User, string Data, string FormatParams) <message name="ExportData11Request"> <part name="User" type="xs:int"/> <part name="Data" type="xs:string"/> <part name="FormatParams" type="xs:string"/> </message> <message name="ExportData11Response"> <part name="return" type="xs:base64Binary"/> </message> The function is meant to return binary data, in this case a PDF file. With PHP 5.0.5 SOAP extension, this function worked fine, with 5.1 however, it doesn't work as expected (the string returned is corrupted, not to mention too short). $SOAPClient = new SoapClient(SOAPServer); return $SOAPClient->exportData(userId(), $data, $formatParams); <-- Tried this one return mb_convert_encoding($SOAPClient->exportData(userId(), $data, $formatParams), "ASCII", "UTF-8"); <--Tried this one too return mb_convert_encoding($SOAPClient->exportData(userId(), $data, $formatParams), "ASCII", "BASE64"); <--This one works with PHP 5.0.5 I use mbstring extension with internal encoding set to utf-8 (attaching php.ini) I have determined that the problem is in the function to_zval_base64 (php_encoding.c), which employs some new functions transferred to ext/standard/base64.h (this include is not in 5.0.5 source). I'm guessing that the functions in the base64.h (c) use mbstring extension and therefore return a result which is modified from the original binary source. Reverting to 5.0.5 solves the problem. Jure

« previous php.soap (#1981) next »