Thanks for the prompt reply. >> return $SOAPClient->exportData(userId(), $data, $formatParams); <--Tried I believe i tried it (see the above line from the original msg). Am I missing something? I would also like to say again: >> I use mbstring extension with internal encoding set to utf-8 Thanks, Jure _____ From: Dmitry Stogov [mailto:dmitry@zend.com] Sent: Thursday, September 08, 2005 2:39 PM To: 'Jure Erzno?nik'; soap@lists.php.net Subject: RE: Possible bug in PHP 5.1 b3 SOAP extension Hi Jure, SOAP in PHP5.1 should do base64 encoding/decoding by himself (automatic). So exportData() should return decoded PDF file. Please check. Thanks. Dmitry. -----Original Message----- From: Jure Erznoћnik [mailto:jure.erznoznik@jantar.si] Sent: Thursday, September 08, 2005 4:23 PM To: soap@lists.php.net Subject: Possible bug in PHP 5.1 b3 SOAP extension 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