Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- SOAP PHP 5: passing big integers
September 5, 2004, 11:02 am
rate this thread
I've been experimenting with PHP 5's SOAP extension and I've run into
this problem: methods that have XSD_LONG parameters fail if a big
integer is passed. Unsigned big integers are always converted to
(negative) signed integers when they are put in the SOAP message:
For example, this produces the correct result:
$this->personID = new SoapVar("20000", XSD_LONG);
But this doesn't:
$this->personID = new SoapVar("2760127000", XSD_LONG);
Any ideas how I could fix this (other than building the SOAP envelope
- Martin H. Kristiansen
September 9, 2004, 12:09 pm
Re: SOAP PHP 5: passing big integers
Chances are that XSD_LONG translates to a 32 bit integer. This means
that the largest positive number you can handle is 2147483647, above
which the number overflows, setting the sign bit as it does and hence
you end up with a negative number.
I'd recommend handling the IDs as strings instead.