|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34641 base64binary wrong decode
Submitted: 2005-09-26 10:21 UTC Modified: 2005-09-26 11:27 UTC
From: dev at lechat dot org Assigned:
Status: Closed Package: SOAP related
PHP Version: 5.1.0RC1 OS: XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
16 + 9 = ?
Subscribe to this entry?

 [2005-09-26 10:21 UTC] dev at lechat dot org
With 5.0.5, a SOAP client getting a "base64Binary" datatype is not performing the appropriate decoding.

Since Bug #32139 (base64binary encode/decode) this issue was marked fixed.

With 5.1.0RC1, autodecode is present, but returns a wrong decode.

- PHP 5.0.5 : 
  -> SoapClient doesn't autodecode base64binary, it returns a base64 encoded string.
  -> base64_decode() did a wrong decode.
  -> GET EXPECTED results if use of mb_convert_encoding().

- PHP 5.1.0RC1 :
  -> SoapClient autodecode base64binary,
  -> but return a wrong decoded string

base64binary encoded string to be decode is not short, so I don't put it in this report. Request if necessary. 

Reproduce code:
header('Content-Type: text/xml; charset=UTF-8');
$client = new SoapClient( 
        "", array('trace' => 1)

$param = array(
		'schemaVersion' => 1,
		'user' => array(
			'Username' => "myuser",
			'Password' => "mypassword",
			'CultureID' => 1033));


//PHP 5.0.5 : SoapClient doesn't autodecode base64binary
// return a base64 encoded string :
//PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PENv bmZpZ3VyYXRpb24+PEtleSBuYW1lPSJ.....

//PHP 5.0.5 : base64_decode() did a wrong decode (*)
echo $conf;

//PHP 5.0.5 : GET EXPECTED results if use of mb_convert_encoding()
echo $conf;

//PHP 5.1.0RC1 : SoapClient autodecode base64binary, but return a wrong decoded string ( same as *)
echo $result->LoadConfigurationResult->Configuration;

Expected result:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
	  <Key name="CharacterSetAliases" default="">
	  	  <PropertyList duplicates="true">
	  	  	  <Property name="iso-646" type="string" value="us-ascii" /> 

Actual result:
This is the content of $result->LoadConfigurationResult->Configuration :

<?xml version="1.0" encoding="UTF-8" standalone="no"?><Co??????Ʌѥ????-?䁹?????


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-26 10:52 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-09-26 11:24 UTC] dev at lechat dot org
As requested tried with last CVS Snaphshot, 
and soapclient base64binary auto decode is correct (-;

No more manual decode is necessary.

Thanks you for your work and quick reply.

 [2005-09-26 11:27 UTC]
Fixed -> closed.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 02:01:28 2024 UTC