#48717 [Opn]: Cannot pass datatype long (> 2147483647) in SOAP requests

From: Date: Fri, 25 Sep 2009 16:51:47 +0000
Subject: #48717 [Opn]: Cannot pass datatype long (> 2147483647) in SOAP requests
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-142879@lists.php.net to get a copy of this message
 ID:               48717
 Updated by:       sjoerd@php.net
 Reported By:      rob at zcore dot org
 Status:           Open
 Bug Type:         SOAP related
 Operating System: Debian GNU/Linux
 PHP Version:      5.2.10
 New Comment:

I can not reproduce it with PHP 5.2 HEAD. Can you check with a sniffer,
or with __getLastRequest/Response if the error also occurs in the
request?


Previous Comments:
------------------------------------------------------------------------

[2009-09-25 16:42:45] persiancity at gmail dot com

I have the same problem ( http://bugs.php.net/bug.php?id=49669 ) but
float replacement not working!

------------------------------------------------------------------------

[2009-07-15 14:18:50] rob at zcore dot org

Sorry, this one is way toooo dirty.

------------------------------------------------------------------------

[2009-07-14 13:59:07] ghostbaer at gmx dot de

Hi,

a very dirty workaround is to download the wsdl an rewrite it locally
to another datatype. Changing this line:

<xs:element name="id" type="xs:long"></xs:element>

to

<xs:element name="id" type="xs:float"></xs:element>

should work at least. But it's a very, very, VERY, VERY, VEWY, VEWY,
VEWYVEWYVEWY dirty workaround and you'll got to hell for this or even
worse!

------------------------------------------------------------------------

[2009-06-29 11:06:13] rob at zcore dot org

Description:
------------
For some reason

Array
(
    [0] => dummy Object
        (
            [id] => 10047678003
            [pass] => XxX
        )

)

is transformed to

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://impl.ejb.flog.zcore.org/">
  <SOAP-ENV:Body>
    <ns1:authenticate>
      <id>2147483647</id>
      <pass>XxX</pass>
    </ns1:authenticate>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

while it's based on this XSD snipplet:

<xs:complexType name="authenticate">
<xs:sequence>
<xs:element name="id" type="xs:long"></xs:element>
<xs:element name="pass" type="xs:string"
minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>



Expected result:
----------------
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://impl.ejb.flog.zcore.org/">
  <SOAP-ENV:Body>
    <ns1:authenticate>
      <id>10047678003</id>
      <pass>XxX</pass>
    </ns1:authenticate>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Actual result:
--------------
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://impl.ejb.flog.zcore.org/">
  <SOAP-ENV:Body>
    <ns1:authenticate>
      <id>2147483647</id>
      <pass>XxX</pass>
    </ns1:authenticate>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48717&edit=1



Thread (17 messages)

« previous php.bugs (#142879) next »