dmitry Fri Aug 31 09:36:14 2007 UTC
Modified files:
/php-src/ext/soap soap.c
/php-src/ext/soap/tests/bugs bug42086.phpt bug42086.wsdl
Log:
Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic
compliant wsdl)
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.226&r2=1.227&diff_format=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.226 php-src/ext/soap/soap.c:1.227
--- php-src/ext/soap/soap.c:1.226 Wed Aug 1 10:39:49 2007
+++ php-src/ext/soap/soap.c Fri Aug 31 09:36:14 2007
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: soap.c,v 1.226 2007/08/01 10:39:49 dmitry Exp $ */
+/* $Id: soap.c,v 1.227 2007/08/31 09:36:14 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -3655,7 +3655,17 @@
}
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;
@@ -3696,7 +3706,11 @@
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) {
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42086.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/soap/tests/bugs/bug42086.phpt
diff -u /dev/null php-src/ext/soap/tests/bugs/bug42086.phpt:1.2
--- /dev/null Fri Aug 31 09:36:14 2007
+++ php-src/ext/soap/tests/bugs/bug42086.phpt Fri Aug 31 09:36:14 2007
@@ -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>
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42086.wsdl?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/soap/tests/bugs/bug42086.wsdl
diff -u /dev/null php-src/ext/soap/tests/bugs/bug42086.wsdl:1.2
--- /dev/null Fri Aug 31 09:36:14 2007
+++ php-src/ext/soap/tests/bugs/bug42086.wsdl Fri Aug 31 09:36:14 2007
@@ -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>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php