From: hammondb at yahoo-inc dot com
Operating system: RHEL 4
PHP version: 5.1.2
PHP Bug Type: SOAP related
Bug description: xsd:long values clamped to LONG_MAX instead of using double
Description:
------------
SoapClient in WSDL mode with classmap option creates object attribute
mapped to a xsd:long in the WSDL as a long with value LONG_MAX when the
returned value from a SOAP call is outside the range of a signed long
(4-byte) integer.
The code and bug #30045 says that when ERANGE occurs in strtol a double is
used instead. However, the value is still set to LONG_MAX (what strtol
returns when errno is ERANGE).
ext/soap's php_encoding.c seems to be where the error is located.
relevant section of WSDL:
<xsd:complexType name="Campaign">
<xsd:sequence>
<xsd:element minOccurs="0" name="ID" type="xsd:long"/>
[snip]
The value of a returned ID from a SOAP call that returns a Campaign
ComplexType is 3706790240 but the value of my Campaign object's ID
attribute is 2147483647 (LONG_MAX).
Reproduce code:
---------------
$s = new SoapClient($wsdlPath, array('trace' => 1, 'exceptions' => 1));
try {
$res = $s->doSomething();
echo $res->out->ID . "\n";
} catch (SoapFault $fault) {
die($fault->faultstring);
}
Expected result:
----------------
3706790240
Actual result:
--------------
2147483647
--
Edit bug report at http://bugs.php.net/?id=36999&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36999&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36999&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36999&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36999&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36999&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36999&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36999&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36999&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36999&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36999&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36999&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36999&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36999&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36999&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36999&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36999&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36999&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36999&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36999&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36999&r=mysqlcfg