#43045 [NoF->Asn]: SOAP encoding violation on "INF" for type double/float

From: Date: Tue, 30 Sep 2008 19:00:27 +0000
Subject: #43045 [NoF->Asn]: SOAP encoding violation on "INF" for type double/float
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-129368@lists.php.net to get a copy of this message
 ID:               43045
 Updated by:       jani@php.net
 Reported By:      nick at attask dot com
-Status:           No Feedback
+Status:           Assigned
 Bug Type:         SOAP related
 Operating System: Irrelevant
-PHP Version:      5.2.4
+PHP Version:      5.2.6
-Assigned To:      
+Assigned To:      dmitry
 New Comment:

I get the same problem here, sample code available via email if
requied. Basically: WSDL says data is double, return NaN / INF -> this
annoying error about "violation". Yet the same stuff works with other
languages..


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

[2007-10-28 01:00:00] 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".

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

[2007-10-20 15:06:23] johannes@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

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

[2007-10-19 21:04:39] nick at attask dot com

Description:
------------
Bug 39815 (http://bugs.php.net/bug.php?id=39815) reported a
locale-sensitive error in decoding SOAP double values.  The result was a
fix which it seems has broken support for special double values
represented by strings, such as:

INF
-INF
NAN

When a SOAP response sends one of these values (INF in the example
below) with type "double" or "float" in versions 5.2.1 and later, the
result is a SoapFault of "Violation of Encoding rules", when it should
successfully parse the result as a PHP float of value "INF".

This change happened in 5.2.1 in file ext/soap/php_encoding.c. 
Versions 5.2.0 and older correctly produce the "Expected Result" below. 

Reproduce code:
---------------
<?php
if (!$_REQUEST['soap-server']) {
	try {
		$client = new SoapClient(NULL, array(
			"location" => $_SERVER['SCRIPT_URI'] . "?soap-server=1",
			"uri"      => 'urn:TestSOAP',
			"style"    => SOAP_RPC,
			"use"      => SOAP_ENCODED
			));
		$response = $client->__soapCall('test', array());
		var_dump($response->doubleInfinity);
	}
	catch (SoapFault $e) {
		print_r($e);
	}
} else {
	header('Content-Type: text/xml; charset=utf-8');
	?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><testResponse
xmlns="urn:TestSOAP"><s-gensym3><doubleInfinity
xsi:type="xsd:double">INF</doubleInfinity></s-gensym3></testResponse></soap:Body></soap:Envelope><?php
}
?>

Expected result:
----------------
float(INF)

Actual result:
--------------
SoapFault Object
(
    [message:protected] => SOAP-ERROR: Encoding: Violation of encoding
rules
...
    [faultstring] => SOAP-ERROR: Encoding: Violation of encoding rules
    [faultcode] => Client
    [faultcodens] => http://schemas.xmlsoap.org/soap/envelope/
)



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


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



Thread (7 messages)

« previous php.bugs (#129368) next »