dmitry Mon Jul 19 09:58:10 2004 EDT
Added files:
/php-src/ext/soap/tests/bugs bug29109.phpt bug29109.wsdl
bug29236.phpt bug29236.wsdl
Modified files:
/php-src NEWS
/php-src/ext/soap php_sdl.c
Log:
Fixed bugs #29109 and #29236. (WSDL cache failure)
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1765&r2=1.1766&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1765 php-src/NEWS:1.1766
--- php-src/NEWS:1.1765 Mon Jul 19 08:53:28 2004
+++ php-src/NEWS Mon Jul 19 09:58:10 2004
@@ -1,6 +1,8 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2004, PHP 5.1.0
+- Fixed bug #29236 (memory error when wsdl-cache is enabled). (Dmitry)
+- Fixed bug #29109 (SoapFault exception: [WSDL] Out of memory). (Dmitry)
- Fixed bug #29061 (soap extension segfaults). (Dmitry)
- Added zlib stream filter suport. (Sara)
- Changed the implementation of TRUE, FALSE, and NULL from constants to
http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.70&r2=1.71&ty=u
Index: php-src/ext/soap/php_sdl.c
diff -u php-src/ext/soap/php_sdl.c:1.70 php-src/ext/soap/php_sdl.c:1.71
--- php-src/ext/soap/php_sdl.c:1.70 Mon Jul 5 17:31:35 2004
+++ php-src/ext/soap/php_sdl.c Mon Jul 19 09:58:10 2004
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_sdl.c,v 1.70 2004/07/05 21:31:35 iliaa Exp $ */
+/* $Id: php_sdl.c,v 1.71 2004/07/19 13:58:10 dmitry Exp $ */
#include "php_soap.h"
#include "libxml/uri.h"
@@ -1459,14 +1459,12 @@
binding->name = sdl_deserialize_string(&in);
binding->location = sdl_deserialize_string(&in);
WSDL_CACHE_GET_1(binding->bindingType,sdlBindingType,&in);
- if (binding->bindingType == BINDING_SOAP) {
- if (*in != 0) {
- sdlSoapBindingPtr soap_binding =
binding->bindingAttributes = emalloc(sizeof(sdlSoapBinding));
-
WSDL_CACHE_GET_1(soap_binding->style,sdlEncodingStyle,&in);
-
WSDL_CACHE_GET_1(soap_binding->transport,sdlTransport,&in);
- } else {
- WSDL_CACHE_SKIP(1,&in);
- }
+ if (binding->bindingType == BINDING_SOAP && *in != 0) {
+ sdlSoapBindingPtr soap_binding = binding->bindingAttributes
= emalloc(sizeof(sdlSoapBinding));
+
WSDL_CACHE_GET_1(soap_binding->style,sdlEncodingStyle,&in);
+
WSDL_CACHE_GET_1(soap_binding->transport,sdlTransport,&in);
+ } else {
+ WSDL_CACHE_SKIP(1,&in);
}
bindings[i] = binding;
}
@@ -1490,18 +1488,16 @@
} else {
func->binding = bindings[binding_num-1];
}
- if (func->binding && func->binding->bindingType == BINDING_SOAP) {
- if (*in != 0) {
- sdlSoapBindingFunctionPtr binding =
func->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunction));
- memset(binding, 0, sizeof(sdlSoapBindingFunction));
- WSDL_CACHE_GET_1(binding->style,sdlEncodingStyle,&in);
- binding->soapAction = sdl_deserialize_string(&in);
- sdl_deserialize_soap_body(&binding->input, encoders,
types, &in);
- sdl_deserialize_soap_body(&binding->output, encoders,
types, &in);
- } else {
- WSDL_CACHE_SKIP(1, &in);
- func->bindingAttributes = NULL;
- }
+ if (func->binding && func->binding->bindingType == BINDING_SOAP && *in
!= 0) {
+ sdlSoapBindingFunctionPtr binding = func->bindingAttributes =
emalloc(sizeof(sdlSoapBindingFunction));
+ memset(binding, 0, sizeof(sdlSoapBindingFunction));
+ WSDL_CACHE_GET_1(binding->style,sdlEncodingStyle,&in);
+ binding->soapAction = sdl_deserialize_string(&in);
+ sdl_deserialize_soap_body(&binding->input, encoders, types,
&in);
+ sdl_deserialize_soap_body(&binding->output, encoders, types,
&in);
+ } else {
+ WSDL_CACHE_SKIP(1, &in);
+ func->bindingAttributes = NULL;
}
func->requestParameters = sdl_deserialize_parameters(encoders, types,
&in);
http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug29109.phpt?r=1.1&p=1
Index: php-src/ext/soap/tests/bugs/bug29109.phpt
+++ php-src/ext/soap/tests/bugs/bug29109.phpt
--TEST--
Bug #29109 (Uncaught SoapFault exception: [WSDL] Out of memory)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$client = new SoapClient(dirname(__FILE__)."/bug29109.wsdl");
var_dump($client->__getFunctions());
?>
--EXPECT--
array(3) {
[0]=>
string(53) "HelloWorldResponse HelloWorld(HelloWorld $parameters)"
[1]=>
string(19) "string HelloWorld()"
[2]=>
string(19) "string HelloWorld()"
}
http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug29109.wsdl?r=1.1&p=1
Index: php-src/ext/soap/tests/bugs/bug29109.wsdl
+++ php-src/ext/soap/tests/bugs/bug29109.wsdl
<?xml version="1.0" encoding="windows-1257"?>
<definitions xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:s0="http://tempuri.org/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" name="test"
targetNamespace="http://tempuri.org/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xs:schema elementFormDefault="qualified"
targetNamespace="http://tempuri.org/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="HelloWorld">
<xs:complexType />
</xs:element>
<xs:element name="HelloWorldResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1"
name="HelloWorldResult" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="string" type="xs:string" />
</xs:schema>
</types>
<message name="HelloWorldSoapIn">
<part name="parameters" element="s0:HelloWorld" />
</message>
<message name="HelloWorldSoapOut">
<part name="parameters" element="s0:HelloWorldResponse" />
</message>
<message name="HelloWorldHttpGetIn" />
<message name="HelloWorldHttpGetOut">
<part name="Body" element="s0:string" />
</message>
<message name="HelloWorldHttpPostIn" />
<message name="HelloWorldHttpPostOut">
<part name="Body" element="s0:string" />
</message>
<portType name="testSoap">
<operation name="HelloWorld">
<input message="s0:HelloWorldSoapIn" />
<output message="s0:HelloWorldSoapOut" />
</operation>
</portType>
<portType name="testHttpGet">
<operation name="HelloWorld">
<input message="s0:HelloWorldHttpGetIn" />
<output message="s0:HelloWorldHttpGetOut" />
</operation>
</portType>
<portType name="testHttpPost">
<operation name="HelloWorld">
<input message="s0:HelloWorldHttpPostIn" />
<output message="s0:HelloWorldHttpPostOut" />
</operation>
</portType>
<binding name="testSoap" type="s0:testSoap">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="HelloWorld">
<soap:operation soapAction="http://tempuri.org/HelloWorld"
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<binding name="testHttpGet" type="s0:testHttpGet">
<http:binding verb="GET" />
<operation name="HelloWorld">
<http:operation location="/HelloWorld" />
<input>
<http:urlEncoded />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
</binding>
<binding name="testHttpPost" type="s0:testHttpPost">
<http:binding verb="POST" />
<operation name="HelloWorld">
<http:operation location="/HelloWorld" />
<input>
<mime:content part="" type="application/x-www-form-urlencoded"
/>
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
</binding>
<service name="test">
<port name="testSoap" binding="s0:testSoap">
<soap:address location="http://localhost:81/test.asmx" />
</port>
<port name="testHttpGet" binding="s0:testHttpGet">
<http:address location="http://localhost:81/test.asmx" />
</port>
<port name="testHttpPost" binding="s0:testHttpPost">
<http:address location="http://localhost:81/test.asmx" />
</port>
</service>
</definitions>
http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug29236.phpt?r=1.1&p=1
Index: php-src/ext/soap/tests/bugs/bug29236.phpt
+++ php-src/ext/soap/tests/bugs/bug29236.phpt
--TEST--
Bug #29236 (memory error when wsdl-cache is enabled)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?
$client = new SoapClient(dirname(__FILE__)."/bug29236.wsdl");
var_dump($client->__getFunctions());
?>
--EXPECT--
array(4) {
[0]=>
string(59) "StartSessionResponse StartSession(StartSession $parameters)"
[1]=>
string(62) "VerifySessionResponse VerifySession(VerifySession $parameters)"
[2]=>
string(41) "LogoutResponse Logout(Logout $parameters)"
[3]=>
string(62) "GetSystemInfoResponse GetSystemInfo(GetSystemInfo $parameters)"
}
http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug29236.wsdl?r=1.1&p=1
Index: php-src/ext/soap/tests/bugs/bug29236.wsdl
+++ php-src/ext/soap/tests/bugs/bug29236.wsdl
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://isis.ais.ucla.edu/ws/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://isis.ais.ucla.edu/ws/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema elementFormDefault="qualified"
targetNamespace="http://isis.ais.ucla.edu/ws/">
<s:element name="StartSession">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="uclaId" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="userIpAddr" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="StartSessionResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="iwsResponse" nillable="true"
type="s0:IwsResponse" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="IwsResponse">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="sessionInfo" nillable="true"
type="s0:IwsSession" />
<s:element minOccurs="1" maxOccurs="1" name="errorInfo" nillable="true"
type="s0:IwsErrorCollection" />
</s:sequence>
<s:attribute name="action" type="s0:ActionEnum" />
<s:attribute name="hasErrors" type="s:boolean" />
<s:attribute name="transactionId" type="s:long" />
</s:complexType>
<s:complexType name="IwsSession">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userAttributes"
type="s0:ArrayOfIwsUserAttribute" />
<s:element minOccurs="0" maxOccurs="1" name="accounts"
type="s0:ArrayOfIwsAccount" />
<s:element minOccurs="1" maxOccurs="1" name="ticket" nillable="true"
type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="uclaId" nillable="true"
type="s:string" />
</s:sequence>
<s:attribute name="status" type="s0:SessionStatus" />
</s:complexType>
<s:complexType name="ArrayOfIwsUserAttribute">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="attribute"
type="s0:IwsUserAttribute" />
</s:sequence>
</s:complexType>
<s:complexType name="IwsUserAttribute">
<s:attribute name="name" type="s:string" />
<s:attribute name="value" type="s:string" />
</s:complexType>
<s:complexType name="ArrayOfIwsAccount">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="account"
type="s0:IwsAccount" />
</s:sequence>
</s:complexType>
<s:complexType name="IwsAccount">
<s:attribute name="loginId" type="s:string" />
<s:attribute name="type" type="s0:LoginType" />
<s:attribute name="status" type="s0:AccountStatus" />
</s:complexType>
<s:simpleType name="LoginType">
<s:restriction base="s:string">
<s:enumeration value="BruinOnline" />
<s:enumeration value="ACF2" />
<s:enumeration value="QDB" />
<s:enumeration value="UID" />
<s:enumeration value="CommonLogon" />
<s:enumeration value="RACF" />
</s:restriction>
</s:simpleType>
<s:simpleType name="AccountStatus">
<s:restriction base="s:string">
<s:enumeration value="Unknown" />
<s:enumeration value="Active" />
<s:enumeration value="Authenticated" />
<s:enumeration value="AuthenticatedWithCachedCredential" />
<s:enumeration value="NotAuthenticated" />
<s:enumeration value="PermmanentlySuspended" />
<s:enumeration value="TemporarilySuspended" />
<s:enumeration value="PasswordResetRequired" />
<s:enumeration value="InvalidID" />
</s:restriction>
</s:simpleType>
<s:simpleType name="SessionStatus">
<s:restriction base="s:string">
<s:enumeration value="Uninitialized" />
<s:enumeration value="Active" />
<s:enumeration value="ActiveWithCachedCredential" />
<s:enumeration value="ActiveWithMultipleCredentials" />
<s:enumeration value="Expired" />
</s:restriction>
</s:simpleType>
<s:complexType name="IwsErrorCollection">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="errors"
type="s0:ArrayOfIwsError" />
</s:sequence>
<s:attribute name="count" type="s:int" />
</s:complexType>
<s:complexType name="ArrayOfIwsError">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="error"
type="s0:IwsError" />
</s:sequence>
</s:complexType>
<s:complexType name="IwsError">
<s:attribute name="errorCode" type="s:int" />
<s:attribute name="detail" type="s:string" />
</s:complexType>
<s:simpleType name="ActionEnum">
<s:restriction base="s:string">
<s:enumeration value="GetInfo" />
<s:enumeration value="Start" />
<s:enumeration value="Verify" />
<s:enumeration value="Logout" />
</s:restriction>
</s:simpleType>
<s:element name="wsConsumerCredential" type="s0:WsConsumerCredential" />
<s:complexType name="WsConsumerCredential">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="id" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="VerifySession">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ticket" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="userIpAddr" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="returnExtendedAttributes"
type="s:boolean" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="VerifySessionResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="iwsResponse" nillable="true"
type="s0:IwsResponse" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Logout">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ticket" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="userIpAddr" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="LogoutResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="iwsResponse" nillable="true"
type="s0:IwsResponse" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetSystemInfo">
<s:complexType />
</s:element>
<s:element name="GetSystemInfoResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetSystemInfoResult"
type="s0:ArrayOfIwsAttribute" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfIwsAttribute">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="IwsAttribute"
type="s0:IwsAttribute" />
</s:sequence>
</s:complexType>
<s:complexType name="IwsAttribute">
<s:attribute name="name" type="s:string" />
<s:attribute name="value" type="s:string" />
</s:complexType>
</s:schema>
</types>
<message name="StartSessionSoapIn">
<part name="parameters" element="s0:StartSession" />
</message>
<message name="StartSessionSoapOut">
<part name="parameters" element="s0:StartSessionResponse" />
</message>
<message name="StartSessionwsConsumerCredential">
<part name="wsConsumerCredential" element="s0:wsConsumerCredential" />
</message>
<message name="VerifySessionSoapIn">
<part name="parameters" element="s0:VerifySession" />
</message>
<message name="VerifySessionSoapOut">
<part name="parameters" element="s0:VerifySessionResponse" />
</message>
<message name="VerifySessionwsConsumerCredential">
<part name="wsConsumerCredential" element="s0:wsConsumerCredential" />
</message>
<message name="LogoutSoapIn">
<part name="parameters" element="s0:Logout" />
</message>
<message name="LogoutSoapOut">
<part name="parameters" element="s0:LogoutResponse" />
</message>
<message name="LogoutwsConsumerCredential">
<part name="wsConsumerCredential" element="s0:wsConsumerCredential" />
</message>
<message name="GetSystemInfoSoapIn">
<part name="parameters" element="s0:GetSystemInfo" />
</message>
<message name="GetSystemInfoSoapOut">
<part name="parameters" element="s0:GetSystemInfoResponse" />
</message>
<message name="GetSystemInfowsConsumerCredential">
<part name="wsConsumerCredential" element="s0:wsConsumerCredential" />
</message>
<portType name="IsisSoap">
<operation name="StartSession">
<input message="s0:StartSessionSoapIn" />
<output message="s0:StartSessionSoapOut" />
</operation>
<operation name="VerifySession">
<input message="s0:VerifySessionSoapIn" />
<output message="s0:VerifySessionSoapOut" />
</operation>
<operation name="Logout">
<input message="s0:LogoutSoapIn" />
<output message="s0:LogoutSoapOut" />
</operation>
<operation name="GetSystemInfo">
<input message="s0:GetSystemInfoSoapIn" />
<output message="s0:GetSystemInfoSoapOut" />
</operation>
</portType>
<portType name="IsisHttpGet" />
<portType name="IsisHttpPost" />
<binding name="IsisSoap" type="s0:IsisSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="StartSession">
<soap:operation soapAction="http://isis.ais.ucla.edu/ws/StartSession"
style="document" />
<input>
<soap:body use="literal" />
<soap:header d5p1:required="true"
message="s0:StartSessionwsConsumerCredential" part="wsConsumerCredential"
use="literal" xmlns:d5p1="http://schemas.xmlsoap.org/wsdl/" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="VerifySession">
<soap:operation soapAction="http://isis.ais.ucla.edu/ws/VerifySession"
style="document" />
<input>
<soap:body use="literal" />
<soap:header d5p1:required="true"
message="s0:VerifySessionwsConsumerCredential" part="wsConsumerCredential"
use="literal" xmlns:d5p1="http://schemas.xmlsoap.org/wsdl/" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Logout">
<soap:operation soapAction="http://isis.ais.ucla.edu/ws/Logout" style="document"
/>
<input>
<soap:body use="literal" />
<soap:header d5p1:required="true" message="s0:LogoutwsConsumerCredential"
part="wsConsumerCredential" use="literal"
xmlns:d5p1="http://schemas.xmlsoap.org/wsdl/" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="GetSystemInfo">
<soap:operation soapAction="http://isis.ais.ucla.edu/ws/GetSystemInfo"
style="document" />
<input>
<soap:body use="literal" />
<soap:header d5p1:required="true"
message="s0:GetSystemInfowsConsumerCredential" part="wsConsumerCredential"
use="literal" xmlns:d5p1="http://schemas.xmlsoap.org/wsdl/" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<binding name="IsisHttpGet" type="s0:IsisHttpGet">
<http:binding verb="GET" />
</binding>
<binding name="IsisHttpPost" type="s0:IsisHttpPost">
<http:binding verb="POST" />
</binding>
<service name="Isis">
<port name="IsisSoap" binding="s0:IsisSoap">
<soap:address location="http://isisdev1.tig.ucla.edu/iws/v4.asmx" />
</port>
<port name="IsisHttpGet" binding="s0:IsisHttpGet">
<http:address location="http://isisdev1.tig.ucla.edu/iws/v4.asmx" />
</port>
<port name="IsisHttpPost" binding="s0:IsisHttpPost">
<http:address location="http://isisdev1.tig.ucla.edu/iws/v4.asmx" />
</port>
</service>
</definitions>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php