|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37126 Invalid conversion from php string to xsd:long
Submitted: 2006-04-18 18:29 UTC Modified: 2006-04-26 01:00 UTC
Avg. Score:4.7 ± 0.5
Reproduced:6 of 6 (100.0%)
Same Version:3 (50.0%)
Same OS:5 (83.3%)
From: karthikm at yahoo-inc dot com Assigned:
Status: No Feedback Package: SOAP related
PHP Version: 5.1.2 OS: Windows XP, Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: karthikm at yahoo-inc dot com
New email:
PHP Version: OS:


 [2006-04-18 18:29 UTC] karthikm at yahoo-inc dot com
longs represented as php string variables do not get converted correctly to soap parameter declared as xsd:long. But, longs represented as php numbers work correctly. 

$idValue = '572527773301459002' shows up incorrectly as

where as,

$idValue = 572527773301459002 shows up correctly as

Reproduce code:
$client = new SoapClient(
	array( 	"trace" => true,
			"exceptions" => true,
			"location" => "http://localhost:8144/MyService",
$idValue = '572527773301459002';
$obj = array(
	'ID' => $idValue,
$retObj = $client->__soapCall(
		array( $obj )

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions xmlns:wsdl=""
        <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="">
            <xsd:element name="operation">
                        <xsd:element name="ID" type="xsd:long"/>
            <xsd:element name="operationResponse">
                        <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true" type="xsd:string"/>
    <wsdl:message name="operationResponse">
        <wsdl:part element="tns:operationResponse" name="parameters"/>
    <wsdl:message name="operationRequest">
        <wsdl:part element="tns:operation" name="parameters"/>
    <wsdl:portType name="MyService">
        <wsdl:operation name="operation">
            <wsdl:input message="tns:operationRequest" name="operationRequest"/>
            <wsdl:output message="tns:operationResponse" name="operationResponse"/>
    <wsdl:binding name="MyServiceHttpBinding" type="tns:MyService">
        <wsdlsoap:binding style="document" transport=""/>
        <wsdl:operation name="operation">
            <wsdlsoap:operation soapAction=""/>
            <wsdl:input name="operationRequest">
                <wsdlsoap:body use="literal"/>
            <wsdl:output name="operationResponse">
                <wsdlsoap:body use="literal"/>
    <wsdl:service name="MyServiceService">
        <wsdl:port binding="tns:MyServiceHttpBinding" name="MyService">
            <wsdlsoap:address location="https://localhost/MyService"/>

Expected result:
<?xml version="1.0" encoding="UTF-8"?>
   <SOAP-ENV:Envelope xmlns:SOAP-ENV=""

Actual result:
<?xml version="1.0" encoding="UTF-8"?>
   <SOAP-ENV:Envelope xmlns:SOAP-ENV=""


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-18 21:25 UTC]
Please try using this CVS snapshot:
For Windows:

 [2006-04-26 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-05-13 03:23 UTC] karthikm at yahoo dot com
Checked in all version upto 6.0 releases from and with the php_soap.dlls gotten from 

All versions seem to have the same issue.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Sep 29 15:01:25 2023 UTC