#30045 [Asn->Csd]: Cannot pass big integers (> 2147483647) in SOAP requests
| From: | dmitry@php.net | Date: | Tue, 14 Sep 2004 12:19:09 +0000 |
| Subject: | #30045 [Asn->Csd]: Cannot pass big integers (> 2147483647) in SOAP requests | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66170@lists.php.net to get a copy of this message | ||
ID: 30045
Updated by: dmitry@php.net
Reported By: paulmonk at shaw dot ca
-Status: Assigned
+Status: Closed
Bug Type: SOAP related
Operating System: Windows 2000
PHP Version: 5.0.1
Assigned To: dmitry
New Comment:
Fixed in CVS HEAD and PHP_5_0.
ext/soap doesn't validate integer type constranits and it cannot handle
integer numbers those cannot fit into C double.
Previous Comments:
------------------------------------------------------------------------
[2004-09-10 10:26:29] derick@php.net
Can you shed some light on this DMitry?
------------------------------------------------------------------------
[2004-09-10 10:08:59] paulmonk at shaw dot ca
If PHP doesn't understand integers larger than 2147483647, why is it
that unsigned longs work as expected up to 17179869184 (and beyond)? In
that case, one would expect long values up to at least 8589934592 to be
supported. Please note that I'm talking specifically about passing
different data types to the SOAP extension, not PHP's handling of
integers.
How does one assign a long value? If the XSD_LONG constant exists,
there should be some way to pass a long.
------------------------------------------------------------------------
[2004-09-10 09:19:34] derick@php.net
No bug here, PHP simply doesn't understand integers larger than
2147483647.
------------------------------------------------------------------------
[2004-09-10 03:34:09] paulmonk at shaw dot ca
Description:
------------
It seems that xsd:long values > 2147483647 are not represented
correctly in SOAP requests/responses. Looks like they are being treated
as PHP integers. (Unsigned longs work fine.)
Reproduce code:
---------------
When I pass the following parameters in a SoapClient::__call():
$long1 = new SoapVar(2147483647, XSD_LONG);
$long2 = new SoapVar(2147483648, XSD_LONG);
$long3 = new SoapVar(4294967296, XSD_LONG);
$long4 = new SoapVar(8589934592, XSD_LONG);
$long5 = new SoapVar(17179869184, XSD_LONG);
$ulong1 = new SoapVar(2147483647, XSD_UNSIGNEDLONG);
$ulong2 = new SoapVar(2147483648, XSD_UNSIGNEDLONG);
$ulong3 = new SoapVar(4294967296, XSD_UNSIGNEDLONG);
$ulong4 = new SoapVar(8589934592, XSD_UNSIGNEDLONG);
$ulong5 = new SoapVar(17179869184, XSD_UNSIGNEDLONG);
Expected result:
----------------
The parameters in the SOAP request should be:
...
<long1 xsi:type="xsd:long">2147483647</long1>
<long2 xsi:type="xsd:long">2147483648</long2>
<long3 xsi:type="xsd:long">4294967296</long3>
<long4 xsi:type="xsd:long">8589934592</long4>
<long5 xsi:type="xsd:long">17179869184</long5>
<ulong1 xsi:type="xsd:unsignedLong">2147483647</ulong1>
<ulong2 xsi:type="xsd:unsignedLong">2147483648</ulong2>
<ulong3 xsi:type="xsd:unsignedLong">4294967296</ulong3>
<ulong4 xsi:type="xsd:unsignedLong">8589934592</ulong4>
<ulong5 xsi:type="xsd:unsignedLong">17179869184</ulong5>
Actual result:
--------------
The actual parameters in the SOAP request are:
...
<long1 xsi:type="xsd:long">2147483647</long1>
<long2 xsi:type="xsd:long">-2147483648</long2>
<long3 xsi:type="xsd:long">0</long3>
<long4 xsi:type="xsd:long">0</long4>
<long5 xsi:type="xsd:long">0</long5>
<ulong1 xsi:type="xsd:unsignedLong">2147483647</ulong1>
<ulong2 xsi:type="xsd:unsignedLong">2147483648</ulong2>
<ulong3 xsi:type="xsd:unsignedLong">4294967296</ulong3>
<ulong4 xsi:type="xsd:unsignedLong">8589934592</ulong4>
<ulong5 xsi:type="xsd:unsignedLong">17179869184</ulong5>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30045&edit=1