diff options
author | Dmitry Stogov <dmitry@php.net> | 2007-08-31 09:36:02 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2007-08-31 09:36:02 +0000 |
commit | fdf96bed473466d398dc2da6b6d39731074da710 (patch) | |
tree | c3156b2c30b5a77121806adb9789597a2beb4634 | |
parent | 77c36cd2598899bc6a4a628988cf7a01001f141e (diff) | |
download | php-git-fdf96bed473466d398dc2da6b6d39731074da710.tar.gz |
Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic compliant wsdl)
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/soap/soap.c | 18 | ||||
-rwxr-xr-x | ext/soap/tests/bugs/bug42086.phpt | 31 | ||||
-rwxr-xr-x | ext/soap/tests/bugs/bug42086.wsdl | 141 |
4 files changed, 190 insertions, 2 deletions
@@ -8,6 +8,8 @@ PHP NEWS - Fixed bug #42452 (PDO classes do not expose Reflection API information). (Hannes) - Fixed bug #42326 (SoapServer crash). (Dmitry) +- Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic + compliant wsdl). (Dmitry) 30 Aug 2007, PHP 5.2.4 - Removed --enable-versioning configure option. (Jani) diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 1eb3abe638..a27626110e 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -3248,7 +3248,17 @@ static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, i } trav = trav->next; } - if (num_of_params > 0) { + + if (num_of_params == 1 && + function && + function->binding && + function->binding->bindingType == BINDING_SOAP && + ((sdlSoapBindingFunctionPtr)function->bindingAttributes)->style == SOAP_DOCUMENT && + (function->requestParameters == NULL || + zend_hash_num_elements(function->requestParameters) == 0) && + strcmp(params->name, function->functionName) == 0) { + num_of_params = 0; + } else if (num_of_params > 0) { tmp_parameters = safe_emalloc(num_of_params, sizeof(zval *), 0); trav = params; @@ -3289,7 +3299,11 @@ static sdlFunctionPtr find_function(sdlPtr sdl, xmlNodePtr func, zval* function_ if (function && function->binding && function->binding->bindingType == BINDING_SOAP) { sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes; if (fnb->style == SOAP_DOCUMENT) { - function = NULL; + if (func->children != NULL || + (function->requestParameters != NULL && + zend_hash_num_elements(function->requestParameters) > 0)) { + function = NULL; + } } } if (sdl != NULL && function == NULL) { diff --git a/ext/soap/tests/bugs/bug42086.phpt b/ext/soap/tests/bugs/bug42086.phpt new file mode 100755 index 0000000000..6edc06f879 --- /dev/null +++ b/ext/soap/tests/bugs/bug42086.phpt @@ -0,0 +1,31 @@ +--TEST-- +Bug #42086 (SoapServer return Procedure '' not present for WSIBasic compliant wsdl) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- +<?php +$request = <<<EOF +<?xml version="1.0" encoding="UTF-8"?> +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><firstFunctionWithoutParam/></SOAP-ENV:Body></SOAP-ENV:Envelope> +EOF; + +class firstFunctionWithoutParamResponse { + public $param; +} + +function firstFunctionWithoutParam() { + $ret = new firstFunctionWithoutParamResponse(); + $ret->param = "firstFunctionWithoutParam"; + return $ret; +} + +$server = new SoapServer(dirname(__FILE__).'/bug42086.wsdl', + array('features'=>SOAP_SINGLE_ELEMENT_ARRAYS)); +$server->addFunction('firstFunctionWithoutParam'); +$server->handle($request); +?> +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><firstFunctionWithoutParamReturn><param>firstFunctionWithoutParam</param></firstFunctionWithoutParamReturn></SOAP-ENV:Body></SOAP-ENV:Envelope> diff --git a/ext/soap/tests/bugs/bug42086.wsdl b/ext/soap/tests/bugs/bug42086.wsdl new file mode 100755 index 0000000000..5ec3d956ca --- /dev/null +++ b/ext/soap/tests/bugs/bug42086.wsdl @@ -0,0 +1,141 @@ +<?xml version='1.0' encoding='UTF-8'?>
+
+<!-- WSDL file generated by Zend Studio. -->
+
+<definitions name="LBAService" targetNamespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" xmlns:typens="http://xml.avaya.com/ws/device-management/distributed-enterprise" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xml.avaya.com/ws/device-management/distributed-enterprise">
+ <xsd:complexType name="firstFunctionClassParam">
+ <xsd:all>
+ <xsd:element name="param" type="xsd:string"/>
+ <xsd:element name="vectparam" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="firstFunctionClassParamResponse">
+ <xsd:all>
+ <xsd:element name="param" type="xsd:string"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="firstFunctionWithoutParamResponse">
+ <xsd:all>
+ <xsd:element name="param" type="xsd:string"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="secondFunctionClassParam">
+ <xsd:all>
+ <xsd:element name="param" type="xsd:string"/>
+ <xsd:element name="vectparam" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="secondFunctionClassParamResponse">
+ <xsd:all>
+ <xsd:element name="param" type="xsd:string"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="secondFunctionWithoutParamResponse">
+ <xsd:all>
+ <xsd:element name="param" type="xsd:string"/>
+ </xsd:all>
+ </xsd:complexType>
+ </xsd:schema>
+ </types>
+ <message name="firstFunctionClassParam">
+ <part name="firstFunctionClassParam" type="typens:firstFunctionClassParam"/>
+ </message>
+ <message name="firstFunctionClassParamResponse">
+ <part name="firstFunctionClassParamReturn" type="typens:firstFunctionClassParamResponse"/>
+ </message>
+ <message name="firstFunctionWithoutParam"/>
+<!--
+ <message name="firstFunctionWithoutParam">
+ <part name="firstFunctionWithoutParam"/>
+ </message>
+-->
+ <message name="firstFunctionWithoutParamResponse">
+ <part name="firstFunctionWithoutParamReturn" type="typens:firstFunctionWithoutParamResponse"/>
+ </message>
+ <message name="secondFunctionClassParam">
+ <part name="secondFunctionClassParam" type="typens:secondFunctionClassParam"/>
+ </message>
+ <message name="secondFunctionClassParamResponse">
+ <part name="secondFunctionClassParamReturn" type="typens:secondFunctionClassParamResponse"/>
+ </message>
+ <message name="secondFunctionWithoutParam"/>
+ <message name="secondFunctionWithoutParamResponse">
+ <part name="secondFunctionWithoutParamReturn" type="typens:secondFunctionWithoutParamResponse"/>
+ </message>
+ <portType name="wsImpPortType">
+ <operation name="firstFunctionClassParam">
+ <documentation>
+ Enter description here...
+ </documentation>
+ <input message="typens:firstFunctionClassParam"/>
+ <output message="typens:firstFunctionClassParamResponse"/>
+ </operation>
+ <operation name="firstFunctionWithoutParam">
+ <documentation>
+ Enter description here...
+ </documentation>
+ <input message="typens:firstFunctionWithoutParam"/>
+ <output message="typens:firstFunctionWithoutParamResponse"/>
+ </operation>
+ <operation name="secondFunctionClassParam">
+ <documentation>
+ Enter description here...
+ </documentation>
+ <input message="typens:secondFunctionClassParam"/>
+ <output message="typens:secondFunctionClassParamResponse"/>
+ </operation>
+ <operation name="secondFunctionWithoutParam">
+ <documentation>
+ Enter description here...
+ </documentation>
+ <input message="typens:secondFunctionWithoutParam"/>
+ <output message="typens:secondFunctionWithoutParamResponse"/>
+ </operation>
+ </portType>
+ <binding name="wsImpBinding" type="typens:wsImpPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="firstFunctionClassParam">
+ <soap:operation soapAction="urn:wsImpAction"/>
+ <input>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </input>
+ <output>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </output>
+ </operation>
+ <operation name="firstFunctionWithoutParam">
+ <soap:operation soapAction="urn:wsImpAction"/>
+ <input>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </input>
+ <output>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </output>
+ </operation>
+ <operation name="secondFunctionClassParam">
+ <soap:operation soapAction="urn:wsImpAction"/>
+ <input>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </input>
+ <output>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </output>
+ </operation>
+ <operation name="secondFunctionWithoutParam">
+ <soap:operation soapAction="urn:wsImpAction"/>
+ <input>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </input>
+ <output>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="LBAService">
+ <port name="wsImpPort" binding="typens:wsImpBinding">
+ <soap:address location="test://"/>
+ </port>
+ </service>
+</definitions>
|