FW: SoapServer and integer types question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard

I'm sure you're correct about the int size being at the root of the problem.  However, shouldn't the SoapServer component behave properly (i.e. return correct numeric values for the given schema type) regardless of the system architecture?

It's pretty clear that the overflow is inside SoapServer.  I've sent an example of the behavior to the list.  It clearly shows that 'xsd:long' is overflowing.  If I understand correctly, 'xsd:long' is supposed to be about +/- 2^63.  The underlying system architecture shouldn't matter.

Thanks for your attention,

Bruce

> From: rquadling@googlemail.com
> Date: Thu, 28 Jan 2010 08:57:35 +0000
> Subject: Re:  SoapServer and integer types question
> To: bruce1828@hotmail.com
> CC: soap@lists.php.net
> 
> 2010/1/27 Bruce Bailey <bruce1828@hotmail.com>:
> >
> > Paweł
> >
> > This seems like a potentially useful workaround (like your strings suggestion).  I would expect for SoapServer to either work as expected or have its limitations documented, with suggested workarounds.
> >
> > In any case, I really appreciate the help.
> >
> > Regards,
> >
> > Bruce
> >
> >> Date: Wed, 27 Jan 2010 19:34:21 +0100
> >> From: bkrupa@proton.eu.org
> >> To: bruce1828@hotmail.com
> >> Subject: Re:  SoapServer and integer types question
> >>
> >> the other solution is to divide one huge integer into two ones.
> >> X=2^32*A+B
> >> in this way you can pass 64 bit integer using two 32 bit ones.
> >>
> >> The real problem is not in soap server or client as you may
> >> easily pass strings instead of integers, but in
> >> managing huge integers in your code.
> >>
> >> You can use GMP for integers of any length arithmetics.
> >>
> >> take care,
> >>
> >> pk
> >>
> >>
> >> Bruce Bailey pisze:
> >> > Thanks all for your replies.  According to my limited understanding of schemas, xs:long types would need 64 bits to represent.  However, SoapServer doesn't seem to recognize that.  Wouldn't that be considered a defect?  Should I enter a defect here?
> >> >
> >> > Thanks,
> >> >
> >> > Bruce
> >> >
> >> >
> >> >> Date: Tue, 26 Jan 2010 19:18:09 +0100
> >> >> From: bkrupa@proton.eu.org
> >> >> To: bruce1828@hotmail.com
> >> >> Subject: Re:  SoapServer and integer types question
> >> >>
> >> >> just string ;)
> >> >>
> >> >> Bruce Bailey pisze:
> >> >>
> >> >>> Hi
> >> >>>
> >> >>> I'm using the SoapServer class (in PHP5.2.3) and noticing what seems like incorrect behavior.
> >> >>>
> >> >>> When I have 10 digit (or greater) integer values returned from the SoapServer, they seem to overflow.
> >> >>>
> >> >>> For example:
> >> >>>
> >> >>> Schema type (from WSDL):                                  xs:long (or xs:int or xs:integer)
> >> >>> Returned value (from network trace):         <value>2147483647</value>
> >> >>>
> >> >>> Expected value:                                     <value>3605736641</value>
> >> >>>
> >> >>>
> >> >>> Is this correct behavior?
> >> >>>
> >> >>> I find that if I use xs:decimal for the type, I get my expected value back from SoapServer, but I'm concerned that there are unexpected consequences waiting for me in the future.
> >> >>>
> >> >>> What have other people done in this type of situation?
> >> >>>
> >> >>> Thanks in advance,
> >> >>>
> >> >>> Bruce
> >> >>>
> >> >>> _________________________________________________________________
> >> >>> Hotmail: Powerful Free email with security by Microsoft.
> >> >>> http://clk.atdmt.com/GBL/go/196390710/direct/01/
> >> >>>
> >> >>>
> >> >
> >> > _________________________________________________________________
> >> > Hotmail: Free, trusted and rich email service.
> >> > http://clk.atdmt.com/GBL/go/196390708/direct/01/
> >> >
> >>
> >
> > _________________________________________________________________
> > Hotmail: Trusted email with Microsoft's powerful SPAM protection.
> > http://clk.atdmt.com/GBL/go/196390706/direct/01/
> 
> I think the issue is pretty simple. The maximum value an integer can
> hold is dependent upon the system architecture. On a 32bit system, the
> signed value is as you are seeing.
> 
> On a 64bit system the signed value is 9,223,372,036,854,775,807 (nearly 10^19).
> 
> I would guess this is pretty standard for any language/os.
> 
> 
> The BCMath Arbitrary Precision Mathematics extension is also an option
> for simple maths.
> 
> 
> 
> 
> -- 
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/201469227/direct/01/

[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux