}
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;
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) {
--- /dev/null
+--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>
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>\r
+\r
+<!-- WSDL file generated by Zend Studio. -->\r
+\r
+<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/">\r
+ <types>\r
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xml.avaya.com/ws/device-management/distributed-enterprise">\r
+ <xsd:complexType name="firstFunctionClassParam">\r
+ <xsd:all>\r
+ <xsd:element name="param" type="xsd:string"/>\r
+ <xsd:element name="vectparam" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:all>\r
+ </xsd:complexType>\r
+ <xsd:complexType name="firstFunctionClassParamResponse">\r
+ <xsd:all>\r
+ <xsd:element name="param" type="xsd:string"/>\r
+ </xsd:all>\r
+ </xsd:complexType>\r
+ <xsd:complexType name="firstFunctionWithoutParamResponse">\r
+ <xsd:all>\r
+ <xsd:element name="param" type="xsd:string"/>\r
+ </xsd:all>\r
+ </xsd:complexType>\r
+ <xsd:complexType name="secondFunctionClassParam">\r
+ <xsd:all>\r
+ <xsd:element name="param" type="xsd:string"/>\r
+ <xsd:element name="vectparam" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:all>\r
+ </xsd:complexType>\r
+ <xsd:complexType name="secondFunctionClassParamResponse">\r
+ <xsd:all>\r
+ <xsd:element name="param" type="xsd:string"/>\r
+ </xsd:all>\r
+ </xsd:complexType>\r
+ <xsd:complexType name="secondFunctionWithoutParamResponse">\r
+ <xsd:all>\r
+ <xsd:element name="param" type="xsd:string"/>\r
+ </xsd:all>\r
+ </xsd:complexType>\r
+ </xsd:schema>\r
+ </types>\r
+ <message name="firstFunctionClassParam">\r
+ <part name="firstFunctionClassParam" type="typens:firstFunctionClassParam"/>\r
+ </message>\r
+ <message name="firstFunctionClassParamResponse">\r
+ <part name="firstFunctionClassParamReturn" type="typens:firstFunctionClassParamResponse"/>\r
+ </message>\r
+ <message name="firstFunctionWithoutParam"/>\r
+<!--\r
+ <message name="firstFunctionWithoutParam">\r
+ <part name="firstFunctionWithoutParam"/>\r
+ </message>\r
+-->\r
+ <message name="firstFunctionWithoutParamResponse">\r
+ <part name="firstFunctionWithoutParamReturn" type="typens:firstFunctionWithoutParamResponse"/>\r
+ </message>\r
+ <message name="secondFunctionClassParam">\r
+ <part name="secondFunctionClassParam" type="typens:secondFunctionClassParam"/>\r
+ </message>\r
+ <message name="secondFunctionClassParamResponse">\r
+ <part name="secondFunctionClassParamReturn" type="typens:secondFunctionClassParamResponse"/>\r
+ </message>\r
+ <message name="secondFunctionWithoutParam"/>\r
+ <message name="secondFunctionWithoutParamResponse">\r
+ <part name="secondFunctionWithoutParamReturn" type="typens:secondFunctionWithoutParamResponse"/>\r
+ </message>\r
+ <portType name="wsImpPortType">\r
+ <operation name="firstFunctionClassParam">\r
+ <documentation>\r
+ Enter description here...\r
+ </documentation>\r
+ <input message="typens:firstFunctionClassParam"/>\r
+ <output message="typens:firstFunctionClassParamResponse"/>\r
+ </operation>\r
+ <operation name="firstFunctionWithoutParam">\r
+ <documentation>\r
+ Enter description here...\r
+ </documentation>\r
+ <input message="typens:firstFunctionWithoutParam"/>\r
+ <output message="typens:firstFunctionWithoutParamResponse"/>\r
+ </operation>\r
+ <operation name="secondFunctionClassParam">\r
+ <documentation>\r
+ Enter description here...\r
+ </documentation>\r
+ <input message="typens:secondFunctionClassParam"/>\r
+ <output message="typens:secondFunctionClassParamResponse"/>\r
+ </operation>\r
+ <operation name="secondFunctionWithoutParam">\r
+ <documentation>\r
+ Enter description here...\r
+ </documentation>\r
+ <input message="typens:secondFunctionWithoutParam"/>\r
+ <output message="typens:secondFunctionWithoutParamResponse"/>\r
+ </operation>\r
+ </portType>\r
+ <binding name="wsImpBinding" type="typens:wsImpPortType">\r
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>\r
+ <operation name="firstFunctionClassParam">\r
+ <soap:operation soapAction="urn:wsImpAction"/>\r
+ <input>\r
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>\r
+ </input>\r
+ <output>\r
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>\r
+ </output>\r
+ </operation>\r
+ <operation name="firstFunctionWithoutParam">\r
+ <soap:operation soapAction="urn:wsImpAction"/>\r
+ <input>\r
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>\r
+ </input>\r
+ <output>\r
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>\r
+ </output>\r
+ </operation>\r
+ <operation name="secondFunctionClassParam">\r
+ <soap:operation soapAction="urn:wsImpAction"/>\r
+ <input>\r
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>\r
+ </input>\r
+ <output>\r
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>\r
+ </output>\r
+ </operation>\r
+ <operation name="secondFunctionWithoutParam">\r
+ <soap:operation soapAction="urn:wsImpAction"/>\r
+ <input>\r
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>\r
+ </input>\r
+ <output>\r
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>\r
+ </output>\r
+ </operation>\r
+ </binding>\r
+ <service name="LBAService">\r
+ <port name="wsImpPort" binding="typens:wsImpBinding">\r
+ <soap:address location="test://"/>\r
+ </port>\r
+ </service>\r
+</definitions>\r