dmitry Thu Aug 26 11:26:33 2004 EDT Modified files: /php-src/ext/soap php_encoding.c /php-src/ext/soap/tests/bugs bug29795.phpt bug29795.wsdl Log: Fixed bug #29795 (SegFault with Soap and Amazon's Web Services) Fixed bug #27994 (segfault with Soapserver when WSDL-Cache is enabled) http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.72&r2=1.73&ty=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.72 php-src/ext/soap/php_encoding.c:1.73 --- php-src/ext/soap/php_encoding.c:1.72 Tue Aug 10 12:11:41 2004 +++ php-src/ext/soap/php_encoding.c Thu Aug 26 11:26:32 2004 @@ -17,7 +17,7 @@ | Dmitry Stogov <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: php_encoding.c,v 1.72 2004/08/10 16:11:41 dmitry Exp $ */ +/* $Id: php_encoding.c,v 1.73 2004/08/26 15:26:32 dmitry Exp $ */ #include <time.h> @@ -2437,6 +2437,9 @@ sdlTypePtr type; type = enc->sdl_type; + if (type == NULL) { + return guess_zval_convert(enc, data); + } /*FIXME: restriction support if (type && type->restrictions && data && data->children && data->children->content) { @@ -2500,6 +2503,13 @@ type = enc->sdl_type; + if (type == NULL) { + ret = guess_xml_convert(enc, data, style, parent); + if (style == SOAP_ENCODED) { + set_ns_and_type(ret, enc); + } + return ret; + } /*FIXME: restriction support if (type) { if (type->restrictions && Z_TYPE_P(data) == IS_STRING) { http://cvs.php.net/diff.php/php-src/ext/soap/tests/bugs/bug29795.phpt?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/bugs/bug29795.phpt diff -u /dev/null php-src/ext/soap/tests/bugs/bug29795.phpt:1.2 --- /dev/null Thu Aug 26 11:26:33 2004 +++ php-src/ext/soap/tests/bugs/bug29795.phpt Thu Aug 26 11:26:32 2004 @@ -0,0 +1,32 @@ +--TEST-- +Bug #29795 (SegFault with Soap and Amazon's Web Services) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +class LocalSoapClient extends SoapClient { + + function LocalSoapClient($wsdl, $options) { + $this->SoapClient($wsdl, $options); + } + + function __doRequest($request, $location, $action, $version) { + return <<<EOF +<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" +xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><Price><Amount>3995</Amount><CurrencyCode>USD</CurrencyCode></Price></SOAP-ENV:Body></SOAP-ENV:Envelope> +EOF; + } + +} + +$client = new LocalSoapClient(dirname(__FILE__)."/bug29795.wsdl",array("trace"=>1)); +$ar=$client->GetPrice(); +echo "o"; +$client = new LocalSoapClient(dirname(__FILE__)."/bug29795.wsdl",array("trace"=>1)); +$ar=$client->GetPrice(); +echo "k\n"; +?> +--EXPECT-- +ok http://cvs.php.net/diff.php/php-src/ext/soap/tests/bugs/bug29795.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/bugs/bug29795.wsdl diff -u /dev/null php-src/ext/soap/tests/bugs/bug29795.wsdl:1.2 --- /dev/null Thu Aug 26 11:26:33 2004 +++ php-src/ext/soap/tests/bugs/bug29795.wsdl Thu Aug 26 11:26:32 2004 @@ -0,0 +1,40 @@ +<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://xml.amazon.com/AWSProductData/2004-08-01" targetNamespace="http://xml.amazon.com/AWSProductData/2004-08-01"> + <types> + <xs:schema targetNamespace="http://xml.amazon.com/AWSProductData/2004-08-01" elementFormDefault="qualified"> + <xs:complexType name="Price"> + <xs:sequence> + <xs:element name="Amount" type="xs:integer" minOccurs="0"/> + <xs:element name="CurrencyCode" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:schema> + </types> + <message name="GetPriceRequest"> + </message> + <message name="GetPriceResponse"> + <part name="Price" type="tns:Price"/> + </message> + <portType name="AWSProductDataPortType"> + <operation name="GetPrice"> + <input message="tns:GetPriceRequest"/> + <output message="tns:GetPriceResponse"/> + </operation> + </portType> + <binding name="AWSProductDataBinding" type="tns:AWSProductDataPortType"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="GetPrice"> + <soap:operation soapAction="http://soap.amazon.com"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + </binding> + <service name="AWSProductData"> + <port name="AWSProductDataPort" binding="tns:AWSProductDataBinding"> + <soap:address location="http://aws-beta.amazon.com/onca/soap?Service=AWSProductData"/> + </port> + </service> +</definitions>
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php