473,388 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

SOAP PHP 5: passing big integers

Hello,

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);

SOAP result:
<personID xsi:type="xsd:long">20000</personID>
But this doesn't:
$this->personID = new SoapVar("2760127000", XSD_LONG);
<personID xsi:type="xsd:long">-1534840296</personID>

Any ideas how I could fix this (other than building the SOAP envelope
manually)?

Thanks,
Paul
Jul 17 '05 #1
1 3151
"Paul" <pa****************@hotmail.com> wrote in message news:<i_x_c.305410$M95.33925@pd7tw1no>...
Hello,

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);

SOAP result:
<personID xsi:type="xsd:long">20000</personID>
But this doesn't:
$this->personID = new SoapVar("2760127000", XSD_LONG);
<personID xsi:type="xsd:long">-1534840296</personID>

Any ideas how I could fix this (other than building the SOAP envelope
manually)?


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.

Cheers
Martin
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
1
by: Dr. Frankenchurn | last post by:
I have a question regarding SOAP. A basic "Hello World" web service was written then requested from an IIS server via TELNET. When a malformed request was sent, a SOAP exception was returned,...
4
by: pepcag | last post by:
I used http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconalteringsoapmessageusingsoapextensions.asp as a template to create a very simple web method with soap...
0
by: systemutvecklare | last post by:
Hi I can't find out how to send an array of objects with the built in SOAP in PHP5. My code looks like this: ****BEGIN CODE**** $id = new GuidVO(); $ids = array($id); $soap_param = new...
2
by: serge calderara | last post by:
Dear all, Within a web service you are able to receive or send soap header values. Does the soap header could be a place to pass web service parameter function ? If this is the case, wjat is...
6
by: Vinit | last post by:
Hi I am passing an arraylist to a c#/.net webmethod from a perl client using soap:lite. The trace shows the elements in the xml request. The arraylist input in the webmethod however does not...
0
by: kencana | last post by:
hi All, I got problem in passing data (more than one) from soap client to the soap server. but if i only passing one data at a time, it works successfully.. The following is the error message i...
3
by: magister pips | last post by:
Hello, I have encountered some strange behaviour when using the XMLHTTP Request object in Javascript to return xml from a C# Webservice Method. I create a SOAP envelope and send it off to the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.