php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49669 SOAP pass incorrect number for long type
Submitted: 2009-09-25 15:04 UTC Modified: 2009-09-25 16:25 UTC
From: persiancity at gmail dot com Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 5.2.11 OS: Linux
Private report: No CVE-ID: None
 [2009-09-25 15:04 UTC] persiancity at gmail dot com
Description:
------------
I use a SoapClient code to send a number to mysql database on a service server. The field type with bug is xsd:long. when I pass a integer value larger than 2147483647 to this field I get inccorect value on the service server database (All numbers = 2147483647).
 
I get correct result when send data from a 64bit server and inccorect result when send from 32bit server. but I am not sure it is cause of server type. I have not access to soap service server to know what is it.

Reproduce code:
---------------
$value= 3147483647;
$result = $this->client->register_number((int)$value); // result in database is: 2147483647 !!
 
// the mysql database field type is unsigned bigint

Expected result:
----------------
result in database is: 2147483647 !!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-25 15:06 UTC] persiancity at gmail dot com
I should add that I also tried converting to string:
 
$result = $this->client->register_number((string)$value); 
 
with no chance.
 [2009-09-25 16:25 UTC] sjoerd@php.net
Thank you for your bug report.

This problem has already been reported to the bug tracker by someone else.

Open:
Bug #48717 Cannot pass datatype long (> 2147483647) in SOAP requests

Other:
Bug #40099 Cannot pass long (> 2147483647) in SOAP requests
Bug #30045 Cannot pass big integers (> 2147483647) in SOAP requests

 [2010-11-05 15:22 UTC] doebrentei at hotmail dot com
I use Macintosh with MAMP and PHP 5.2.13 and 5.3 and I have the same problem.
I set the value type to float but I think this is not a final solution.

settype($variable,"float")
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC