diff --git a/thirdparty/pear/SOAP/Base.php b/thirdparty/pear/SOAP/Base.php index 78491dc..bd508dc 100644 --- a/thirdparty/pear/SOAP/Base.php +++ b/thirdparty/pear/SOAP/Base.php @@ -374,6 +374,22 @@ class SOAP_Base extends SOAP_Base_Object 'http://schemas.xmlsoap.org/soap/encoding/' => 'SOAP-ENC'); } + function isValidField($fieldname, $type) + { + foreach($this->_wsdl->complexTypes as $nss) + { + foreach($nss as $ns) + { + if (array_key_exists($fieldname, $ns['elements'])) + { + return true; + } + } + } + return false; + } + + /** * Sets the schema version used in the SOAP message. * @@ -473,7 +489,10 @@ class SOAP_Base extends SOAP_Base_Object $xmlout_value .= $this->_serializeValue(get_object_vars($vars[$k]), $k, false, $this->_section5 ? null : $elNamespace); } } else { - $xmlout_value .= $this->_serializeValue($vars[$k], $k, false, $this->_section5 ? null : $elNamespace); + if ($this->isValidField($k, $type)) + { + $xmlout_value .= $this->_serializeValue($vars[$k], $k, false, $this->_section5 ? null : $elNamespace); + } } } } @@ -518,12 +537,12 @@ class SOAP_Base extends SOAP_Base_Object } $xmlout_offset = ' SOAP-ENC:offset="[0]"'; - if (!$arrayType) { + if (!$arrayType) { /* $numtypes = count($array_types); if ($numtypes == 1) { $arrayType = $array_type; - } + } */ // Using anyType is more interoperable. if ($array_type == 'Struct') {