diff options
author | Dmitry Stogov <dmitry@php.net> | 2004-08-26 15:26:32 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2004-08-26 15:26:32 +0000 |
commit | 0835c34572d3ae71227b55d00fa86f911dddf739 (patch) | |
tree | a68a4bf58179d0e78c0a323454c4a6f6106194e8 /ext | |
parent | 6078001f12ae5ab5293bb9d8162f53c6295fb2cb (diff) | |
download | php-git-0835c34572d3ae71227b55d00fa86f911dddf739.tar.gz |
Fixed bug #29795 (SegFault with Soap and Amazon's Web Services)
Fixed bug #27994 (segfault with Soapserver when WSDL-Cache is enabled)
Diffstat (limited to 'ext')
-rw-r--r-- | ext/soap/php_encoding.c | 10 | ||||
-rw-r--r-- | ext/soap/tests/bugs/bug29795.phpt | 32 | ||||
-rw-r--r-- | ext/soap/tests/bugs/bug29795.wsdl | 40 |
3 files changed, 82 insertions, 0 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 08e80c223f..05e2d5143c 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2437,6 +2437,9 @@ zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data) 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 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo 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) { diff --git a/ext/soap/tests/bugs/bug29795.phpt b/ext/soap/tests/bugs/bug29795.phpt new file mode 100644 index 0000000000..f32d16a996 --- /dev/null +++ b/ext/soap/tests/bugs/bug29795.phpt @@ -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 diff --git a/ext/soap/tests/bugs/bug29795.wsdl b/ext/soap/tests/bugs/bug29795.wsdl new file mode 100644 index 0000000000..5a4499da0d --- /dev/null +++ b/ext/soap/tests/bugs/bug29795.wsdl @@ -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>
|