#36999 [Asn->Fbk]: xsd:long values clamped to LONG_MAX instead of using double

From: Date: Mon, 10 Apr 2006 11:27:54 +0000
Subject: #36999 [Asn->Fbk]: xsd:long values clamped to LONG_MAX instead of using double
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-95519@lists.php.net to get a copy of this message
ID: 36999 Updated by: dmitry@php.net Reported By: hammondb at yahoo-inc dot com -Status: Assigned +Status: Feedback Bug Type: SOAP related Operating System: RHEL 4 PHP Version: 5.1.2 Assigned To: dmitry New Comment: I cannot reproduce the bug. Doyubles work fine for me. Please provide WSDL and response XML from server. Do you see 3706790240 in the response XML? Previous Comments: ------------------------------------------------------------------------ [2006-04-06 15:51:53] hammondb at yahoo-inc dot com 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 this bug report at http://bugs.php.net/?id=36999&edit=1

« previous php.bugs (#95519) next »