note 94700 modified in soapclient.dorequest by danbrown
| From: | danbrown@php.net | Date: | Thu, 19 Nov 2009 16:21:09 +0000 |
| Subject: | note 94700 modified in soapclient.dorequest by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-163078@lists.php.net to get a copy of this message | ||
If you happen to get an error during your request which says "SOAP-ERROR: Encoding: Can't
decode apache map, only Strings or Longs are allowd as keys", the reason seems to be the
response xml using integer for keys and php failling to understand them
Here is something that worked for me (converts integer keys to strings):
<?php
class mySoap extends SoapClient
{
public function __doRequest($request, $location, $action, $version)
{
$result = parent::__doRequest($request, $location, $action, $version);
$result = str_replace('<key xsi:type="xsd:int">', '<key
xsi:type="xsd:string">', $result);
return $result;
}
}
// $soap = new mySoap(...
?>
--was--
If you happen to get an error during your request which says "SOAP-ERROR: Encoding: Can't
decode apache map, only Strings or Longs are allowd as keys", the reason seems to be the
response xml using integer for keys and php failling to understand them
Here is something that worked for me (converts integer keys to strings):
class mySoap extends SoapClient
{
public function __doRequest($request, $location, $action, $version)
{
$result = parent::__doRequest($request, $location, $action, $version);
$result = str_replace('<key xsi:type="xsd:int">', '<key
xsi:type="xsd:string">', $result);
return $result;
}
}
$soap = new mySoap(...
http://php.net/manual/en/soapclient.dorequest.php