cvs: pear /SOAP Client.php Disco.php Server.php Transport.php WSDL.php /SOAP/Server Email.php /SOAP/Transport HTTP.php SMTP.php TCP.php
| From: | Jan Schneider | Date: | Sun, 25 Feb 2007 12:34:00 +0000 |
| Subject: | cvs: pear /SOAP Client.php Disco.php Server.php Transport.php WSDL.php /SOAP/Server Email.php /SOAP/Transport HTTP.php SMTP.php TCP.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-44873@lists.php.net to get a copy of this message | ||
yunosh Sun Feb 25 12:34:00 2007 UTC
Modified files:
/pear/SOAP Client.php Disco.php Server.php Transport.php WSDL.php
/pear/SOAP/Server Email.php
/pear/SOAP/Transport HTTP.php SMTP.php TCP.php
Log:
Remove unused variables and other small tweaks.
http://cvs.php.net/viewvc.cgi/pear/SOAP/Client.php?r1=1.88&r2=1.89&diff_format=u Index: pear/SOAP/Client.php diff -u pear/SOAP/Client.php:1.88 pear/SOAP/Client.php:1.89 --- pear/SOAP/Client.php:1.88 Fri Jan 26 00:30:47 2007 +++ pear/SOAP/Client.php Sun Feb 25 12:34:00 2007 @@ -589,7 +589,6 @@ $nparams = array(); if (isset($opData['input']['parts']) && count($opData['input']['parts'])) { - $i = 0; foreach ($opData['input']['parts'] as $name => $part) { $xmlns = ''; $attrs = array(); @@ -620,7 +619,6 @@ $type_namespace = null; } $qname->namespace = $type_namespace; - $type = $qname->name; $pqname = $name; if ($xmlns) { $pqname = '{' . $xmlns . '}' . $name; http://cvs.php.net/viewvc.cgi/pear/SOAP/Disco.php?r1=1.17&r2=1.18&diff_format=u Index: pear/SOAP/Disco.php diff -u pear/SOAP/Disco.php:1.17 pear/SOAP/Disco.php:1.18 --- pear/SOAP/Disco.php:1.17 Tue Jan 23 10:28:13 2007 +++ pear/SOAP/Disco.php Sun Feb 25 12:34:00 2007 @@ -209,7 +209,7 @@ } else { $ctype['complexContent']['attr'] = ''; $ctype['complexContent']['restriction']['attr']['base'] = 'SOAP-ENC:Array'; - foreach ($_vartype as $array_var => $array_type) { + foreach ($_vartype as $array_type) { list($_vartypens, $_vartype) = $this->_getTypeNs($array_type); $ctype['complexContent']['restriction']['attribute']['attr']['ref'] = 'SOAP-ENC:arrayType'; $ctype['complexContent']['restriction']['attribute']['attr']['wsdl:arrayType'] = $_vartypens . ':' . $_vartype . '[]'; @@ -372,8 +372,8 @@ function _ifComplexTypeExists($typesArray, $type_name) { if (is_array($typesArray)) { - foreach ($typesArray as $index => $type_data) { - if ($typesArray[$index]['attr']['name'] == $type_name) { + foreach ($typesArray as $type_data) { + if ($type_data['attr']['name'] == $type_name) { return true; } } http://cvs.php.net/viewvc.cgi/pear/SOAP/Server.php?r1=1.75&r2=1.76&diff_format=u Index: pear/SOAP/Server.php diff -u pear/SOAP/Server.php:1.75 pear/SOAP/Server.php:1.76 --- pear/SOAP/Server.php:1.75 Fri Jan 26 17:20:07 2007 +++ pear/SOAP/Server.php Sun Feb 25 12:34:00 2007 @@ -122,7 +122,7 @@ * * @see http://www.php.net/set_error_handler */ - function _errorHandler($errno, $errmsg, $filename, $linenum, $vars) + function _errorHandler($errno, $errmsg, $filename, $linenum) { /* The error handler should ignore '0' errors, eg. hidden by @ - see * the set_error_handler manual page. (thanks to Alan Knowles). */ @@ -604,8 +604,8 @@ } /* If there are input parameters required. */ - if ($sig = $map['in']) { - $this->input_value = count($sig); + if ($map['in']) { + $this->input_value = count($map['in']); $this->return_type = false; if (is_array($map['out'])) { $this->return_type = count($map['out']) > 1 @@ -614,12 +614,12 @@ } if (is_array($params)) { /* Validate the number of parameters. */ - if (count($params) == count($sig)) { + if (count($params) == count($map['in'])) { /* Make array of param types. */ foreach ($params as $param) { $p[] = strtolower($param->type); } - $sig_t = array_values($sig); + $sig_t = array_values($map['in']); /* Validate each param's type. */ for ($i = 0; $i < count($p); $i++) { /* If SOAP types do not match, it's still fine if the @@ -639,12 +639,12 @@ return true; } else { /* Wrong number of params. */ - $this->_raiseSoapFault('SOAP request contained incorrect number of parameters. method "' . $this->methodname . '" required ' . count($sig) . ' and request provided ' . count($params), '', '', 'Client'); + $this->_raiseSoapFault('SOAP request contained incorrect number of parameters. method "' . $this->methodname . '" required ' . count($map['in']) . ' and request provided ' . count($params), '', '', 'Client'); return false; } } else { /* No params. */ - $this->_raiseSoapFault('SOAP request contained incorrect number of parameters. method "' . $this->methodname . '" requires ' . count($sig) . ' parameters, and request provided none.', '', '', 'Client'); + $this->_raiseSoapFault('SOAP request contained incorrect number of parameters. method "' . $this->methodname . '" requires ' . count($map['in']) . ' parameters, and request provided none.', '', '', 'Client'); return false; } } http://cvs.php.net/viewvc.cgi/pear/SOAP/Transport.php?r1=1.29&r2=1.30&diff_format=u Index: pear/SOAP/Transport.php diff -u pear/SOAP/Transport.php:1.29 pear/SOAP/Transport.php:1.30 --- pear/SOAP/Transport.php:1.29 Thu Jun 1 11:02:20 2006 +++ pear/SOAP/Transport.php Sun Feb 25 12:34:00 2007 @@ -132,7 +132,7 @@ /* Handle other transport types */ $transport_type = strtoupper($urlparts['scheme']); } - $transport_include = 'SOAP/Transport/' . $transport_type . '.php'; + $transport_include = 'SOAP/Transport/' . basename($transport_type) . '.php'; $res = @include_once($transport_include); if (!$res) { $fault = SOAP_Base_Object::_raiseSoapFault("No Transport for {$urlparts['scheme']}"); http://cvs.php.net/viewvc.cgi/pear/SOAP/WSDL.php?r1=1.99&r2=1.100&diff_format=u Index: pear/SOAP/WSDL.php diff -u pear/SOAP/WSDL.php:1.99 pear/SOAP/WSDL.php:1.100 --- pear/SOAP/WSDL.php:1.99 Fri Jan 26 00:18:17 2007 +++ pear/SOAP/WSDL.php Sun Feb 25 12:34:00 2007 @@ -209,10 +209,8 @@ * Fills the WSDL array tree with data from a WSDL file. * * @param string $wsdl_uri URL to WSDL file. - * @param array $proxy Contains options for HTTP_Request class - * @see HTTP_Request. */ - function parseURL($wsdl_uri, $proxy = array()) + function parseURL($wsdl_uri) { $parser =& new $this->wsdlParserClass($wsdl_uri, $this, $this->docs); @@ -380,7 +378,7 @@ } // Overloading lowercases function names :( - foreach ($this->services[$this->service]['ports'] as $port => $portAttrs) { + foreach ($this->services[$this->service]['ports'] as $portAttrs) { foreach (array_keys($this->bindings[$portAttrs['binding']]['operations']) as $op) { if (strcasecmp($op, $operation) == 0) { $operation = $op; @@ -415,7 +413,7 @@ $checkmessages = array(); // Find what messages use this datatype. foreach ($this->messages as $messagename => $message) { - foreach ($message as $partname => $part) { + foreach ($message as $part) { if ($part['type'] == $datatype) { $checkmessages[] = $messagename; break; @@ -423,8 +421,7 @@ } } // Find the operation that uses this message. - $dataHandler = null; - foreach($this->portTypes as $portname => $porttype) { + foreach($this->portTypes as $porttype) { foreach ($porttype as $opname => $opinfo) { foreach ($checkmessages as $messagename) { if ($opinfo['input']['message'] == $messagename) { @@ -678,7 +675,6 @@ // The type or element refered to is used for // parameters. $elattrs = null; - $element = $_argtype['element']; $el = $this->elements[$_argtype['namespace']][$_argtype['type']]; if ($el['complex']) { @@ -861,7 +857,7 @@ if ($name && $type) { // XXX TODO: // look up the name in the wsdl and validate the type. - foreach ($this->complexTypes as $ns => $types) { + foreach ($this->complexTypes as $types) { if (isset($types[$type])) { if (isset($types[$type]['type'])) { list($arraytype_ns, $arraytype, $array_depth) = isset($types[$type]['arrayType']) @@ -1965,15 +1961,21 @@ */ var $wsdl = null; - /** Constructor + /** + * Constructor. * - * @param $objects Reference to the object or array of objects to parse - * @param $wsdl Reference to the SOAP_WSDL object to populate - * @param $targetNamespace The target namespace of schema types etc. - * @param $service_name Name of the WSDL <service> - * @param $service_desc Optional description of the WSDL <service> + * @param object|array $objects Reference to the object or array of + * objects to parse. + * @param SOAP_WSDL $wsdl Reference to the SOAP_WSDL object to + * populate. + * @param string $targetNamespace The target namespace of schema types + * etc. + * @param string $service_name Name of the WSDL <service>. + * @param string $service_desc Optional description of the WSDL + * <service>. */ - function SOAP_WSDL_ObjectParser(&$objects, &$wsdl, $targetNamespace, $service_name, $service_desc = '') + function SOAP_WSDL_ObjectParser(&$objects, &$wsdl, $targetNamespace, + $service_name, $service_desc = '') { parent::SOAP_Base('WSDLOBJECTPARSER'); @@ -1986,11 +1988,14 @@ $wsdl_ref = (is_array($objects)? $objects : array(&$objects)); foreach ($wsdl_ref as $ref_item) { - if (!is_object($ref_item)) - return $this->_raiseSoapFault('Invalid web service object passed to object parser', 'urn:' . get_class($object)); + if (!is_object($ref_item)) { + $this->_raiseSoapFault('Invalid web service object passed to object parser'); + continue; + } - if ($this->_parse($ref_item, $targetNamespace, $service_name) != true) + if (!$this->_parse($ref_item, $targetNamespace, $service_name)) { break; + } } // Build bindings from abstract data. @@ -2163,24 +2168,25 @@ } /** - * Take all the abstract WSDL data and build concrete bindings and + * Takes all the abstract WSDL data and builds concrete bindings and * services (destructive). * - * XXX Current implementation discards $service_desc. - * - * @param $schemaNamespace Namespace for types etc. - * @param $service_name Name of the WSDL <service> - * @param $service_desc Optional description of the WSDL <service> * @access private + * @todo Current implementation discards $service_desc. + * + * @param string $schemaNamespace Namespace for types etc. + * @param string $service_name Name of the WSDL <service>. + * @param string $service_desc Optional description of the WSDL + * <service>. */ - function _generateBindingsAndServices($schemaNamespace, $service_name, $service_desc = '') + function _generateBindingsAndServices($schemaNamespace, $service_name, + $service_desc = '') { // Populate tree with bindings information // XXX Current implementation only supports one binding that // matches the single portType and all of its operations. // XXX Is this the correct use of $schemaNamespace here? // *** <wsdl:binding> *** - $this->wsdl->bindings[$service_name . 'Binding'] = array( 'type' => $service_name . 'Port', 'namespace' => $this->tnsPrefix, http://cvs.php.net/viewvc.cgi/pear/SOAP/Server/Email.php?r1=1.17&r2=1.18&diff_format=u Index: pear/SOAP/Server/Email.php diff -u pear/SOAP/Server/Email.php:1.17 pear/SOAP/Server/Email.php:1.18 --- pear/SOAP/Server/Email.php:1.17 Mon Jan 22 11:50:13 2007 +++ pear/SOAP/Server/Email.php Sun Feb 25 12:34:00 2007 @@ -95,11 +95,9 @@ /* If neither matches, we'll just try it anyway. */ if (stristr($data, 'Content-Type: application/dime')) { $this->_decodeDIMEMessage($data, $this->headers, $attachments); - $useEncoding = 'DIME'; } elseif (stristr($data, 'MIME-Version:')) { /* This is a mime message, let's decode it. */ $this->_decodeMimeMessage($data, $this->headers, $attachments); - $useEncoding = 'Mime'; } else { /* The old fallback, but decodeMimeMessage handles things fine. */ $this->_parseEmail($data); @@ -145,8 +143,7 @@ /* Get the character encoding of the incoming request treat incoming * data as UTF-8 if no encoding set. */ - if (!$response && - !$this->_getContentEncoding($this->headers['content-type'])) { + if (!$this->_getContentEncoding($this->headers['content-type'])) { $this->xml_encoding = SOAP_DEFAULT_ENCODING; /* An encoding we don't understand, return a fault. */ $this->_raiseSoapFault('Unsupported encoding, use one of ISO-8859-1, US-ASCII, UTF-8', '', '', 'Server'); @@ -167,7 +164,7 @@ } else { /* Default is DIME. */ $soap_msg = $this->_makeDIMEMessage($soap_msg); - $header['Content-Type'] = 'application/dime'; + $soap_msg['headers']['Content-Type'] = 'application/dime'; } if (PEAR::isError($soap_msg)) { return $this->raiseSoapFault($soap_msg); http://cvs.php.net/viewvc.cgi/pear/SOAP/Transport/HTTP.php?r1=1.52&r2=1.53&diff_format=u Index: pear/SOAP/Transport/HTTP.php diff -u pear/SOAP/Transport/HTTP.php:1.52 pear/SOAP/Transport/HTTP.php:1.53 --- pear/SOAP/Transport/HTTP.php:1.52 Sun Jan 21 17:47:17 2007 +++ pear/SOAP/Transport/HTTP.php Sun Feb 25 12:34:00 2007 @@ -334,8 +334,7 @@ // SOAP faults. $this->_parseHeaders($match[1]); - list($protocol, $code, $msg) = sscanf($this->result_headers[0], - '%s %s %s'); + list(, $code, $msg) = sscanf($this->result_headers[0], '%s %s %s'); unset($this->result_headers[0]); switch($code) { http://cvs.php.net/viewvc.cgi/pear/SOAP/Transport/SMTP.php?r1=1.27&r2=1.28&diff_format=u Index: pear/SOAP/Transport/SMTP.php diff -u pear/SOAP/Transport/SMTP.php:1.27 pear/SOAP/Transport/SMTP.php:1.28 --- pear/SOAP/Transport/SMTP.php:1.27 Fri Jan 26 00:18:17 2007 +++ pear/SOAP/Transport/SMTP.php Sun Feb 25 12:34:00 2007 @@ -156,7 +156,6 @@ $val = new SOAP_Value('Fault', 'Struct', $sval); } - $mqname = new QName($method, $namespace); $methodValue = new SOAP_Value('Response', 'Struct', array($val)); $this->incoming_payload = $this->makeEnvelope($methodValue, @@ -189,16 +188,16 @@ function _validateUrl() { if (!is_array($this->urlparts)) { - $this->_raiseSoapFault("Unable to parse URL $url"); + $this->_raiseSoapFault("Unable to parse URL $this->url"); return false; } if (!isset($this->urlparts['scheme']) || strcasecmp($this->urlparts['scheme'], 'mailto') != 0) { - $this->_raiseSoapFault("Unable to parse URL $url"); + $this->_raiseSoapFault("Unable to parse URL $this->url"); return false; } if (!isset($this->urlparts['path'])) { - $this->_raiseSoapFault("Unable to parse URL $url"); + $this->_raiseSoapFault("Unable to parse URL $this->url"); return false; } return true; http://cvs.php.net/viewvc.cgi/pear/SOAP/Transport/TCP.php?r1=1.11&r2=1.12&diff_format=u Index: pear/SOAP/Transport/TCP.php diff -u pear/SOAP/Transport/TCP.php:1.11 pear/SOAP/Transport/TCP.php:1.12 --- pear/SOAP/Transport/TCP.php:1.11 Mon Jun 19 15:52:30 2006 +++ pear/SOAP/Transport/TCP.php Sun Feb 25 12:34:00 2007 @@ -136,11 +136,11 @@ function _validateUrl() { if (!is_array($this->urlparts) ) { - $this->_raiseSoapFault("Unable to parse URL $url"); + $this->_raiseSoapFault("Unable to parse URL $this->url"); return false; } if (!isset($this->urlparts['host'])) { - $this->_raiseSoapFault("No host in URL $url"); + $this->_raiseSoapFault("No host in URL $this->url"); return false; } if (!isset($this->urlparts['path']) || !$this->urlparts['path']) {
http://cvs.php.net/viewvc.cgi/pear/SOAP/Client.php?r1=1.88&r2=1.89&diff_format=u Index: pear/SOAP/Client.php diff -u pear/SOAP/Client.php:1.88 pear/SOAP/Client.php:1.89 --- pear/SOAP/Client.php:1.88 Fri Jan 26 00:30:47 2007 +++ pear/SOAP/Client.php Sun Feb 25 12:34:00 2007 @@ -589,7 +589,6 @@ $nparams = array(); if (isset($opData['input']['parts']) && count($opData['input']['parts'])) { - $i = 0; foreach ($opData['input']['parts'] as $name => $part) { $xmlns = ''; $attrs = array(); @@ -620,7 +619,6 @@ $type_namespace = null; } $qname->namespace = $type_namespace; - $type = $qname->name; $pqname = $name; if ($xmlns) { $pqname = '{' . $xmlns . '}' . $name; http://cvs.php.net/viewvc.cgi/pear/SOAP/Disco.php?r1=1.17&r2=1.18&diff_format=u Index: pear/SOAP/Disco.php diff -u pear/SOAP/Disco.php:1.17 pear/SOAP/Disco.php:1.18 --- pear/SOAP/Disco.php:1.17 Tue Jan 23 10:28:13 2007 +++ pear/SOAP/Disco.php Sun Feb 25 12:34:00 2007 @@ -209,7 +209,7 @@ } else { $ctype['complexContent']['attr'] = ''; $ctype['complexContent']['restriction']['attr']['base'] = 'SOAP-ENC:Array'; - foreach ($_vartype as $array_var => $array_type) { + foreach ($_vartype as $array_type) { list($_vartypens, $_vartype) = $this->_getTypeNs($array_type); $ctype['complexContent']['restriction']['attribute']['attr']['ref'] = 'SOAP-ENC:arrayType'; $ctype['complexContent']['restriction']['attribute']['attr']['wsdl:arrayType'] = $_vartypens . ':' . $_vartype . '[]'; @@ -372,8 +372,8 @@ function _ifComplexTypeExists($typesArray, $type_name) { if (is_array($typesArray)) { - foreach ($typesArray as $index => $type_data) { - if ($typesArray[$index]['attr']['name'] == $type_name) { + foreach ($typesArray as $type_data) { + if ($type_data['attr']['name'] == $type_name) { return true; } } http://cvs.php.net/viewvc.cgi/pear/SOAP/Server.php?r1=1.75&r2=1.76&diff_format=u Index: pear/SOAP/Server.php diff -u pear/SOAP/Server.php:1.75 pear/SOAP/Server.php:1.76 --- pear/SOAP/Server.php:1.75 Fri Jan 26 17:20:07 2007 +++ pear/SOAP/Server.php Sun Feb 25 12:34:00 2007 @@ -122,7 +122,7 @@ * * @see http://www.php.net/set_error_handler */ - function _errorHandler($errno, $errmsg, $filename, $linenum, $vars) + function _errorHandler($errno, $errmsg, $filename, $linenum) { /* The error handler should ignore '0' errors, eg. hidden by @ - see * the set_error_handler manual page. (thanks to Alan Knowles). */ @@ -604,8 +604,8 @@ } /* If there are input parameters required. */ - if ($sig = $map['in']) { - $this->input_value = count($sig); + if ($map['in']) { + $this->input_value = count($map['in']); $this->return_type = false; if (is_array($map['out'])) { $this->return_type = count($map['out']) > 1 @@ -614,12 +614,12 @@ } if (is_array($params)) { /* Validate the number of parameters. */ - if (count($params) == count($sig)) { + if (count($params) == count($map['in'])) { /* Make array of param types. */ foreach ($params as $param) { $p[] = strtolower($param->type); } - $sig_t = array_values($sig); + $sig_t = array_values($map['in']); /* Validate each param's type. */ for ($i = 0; $i < count($p); $i++) { /* If SOAP types do not match, it's still fine if the @@ -639,12 +639,12 @@ return true; } else { /* Wrong number of params. */ - $this->_raiseSoapFault('SOAP request contained incorrect number of parameters. method "' . $this->methodname . '" required ' . count($sig) . ' and request provided ' . count($params), '', '', 'Client'); + $this->_raiseSoapFault('SOAP request contained incorrect number of parameters. method "' . $this->methodname . '" required ' . count($map['in']) . ' and request provided ' . count($params), '', '', 'Client'); return false; } } else { /* No params. */ - $this->_raiseSoapFault('SOAP request contained incorrect number of parameters. method "' . $this->methodname . '" requires ' . count($sig) . ' parameters, and request provided none.', '', '', 'Client'); + $this->_raiseSoapFault('SOAP request contained incorrect number of parameters. method "' . $this->methodname . '" requires ' . count($map['in']) . ' parameters, and request provided none.', '', '', 'Client'); return false; } } http://cvs.php.net/viewvc.cgi/pear/SOAP/Transport.php?r1=1.29&r2=1.30&diff_format=u Index: pear/SOAP/Transport.php diff -u pear/SOAP/Transport.php:1.29 pear/SOAP/Transport.php:1.30 --- pear/SOAP/Transport.php:1.29 Thu Jun 1 11:02:20 2006 +++ pear/SOAP/Transport.php Sun Feb 25 12:34:00 2007 @@ -132,7 +132,7 @@ /* Handle other transport types */ $transport_type = strtoupper($urlparts['scheme']); } - $transport_include = 'SOAP/Transport/' . $transport_type . '.php'; + $transport_include = 'SOAP/Transport/' . basename($transport_type) . '.php'; $res = @include_once($transport_include); if (!$res) { $fault = SOAP_Base_Object::_raiseSoapFault("No Transport for {$urlparts['scheme']}"); http://cvs.php.net/viewvc.cgi/pear/SOAP/WSDL.php?r1=1.99&r2=1.100&diff_format=u Index: pear/SOAP/WSDL.php diff -u pear/SOAP/WSDL.php:1.99 pear/SOAP/WSDL.php:1.100 --- pear/SOAP/WSDL.php:1.99 Fri Jan 26 00:18:17 2007 +++ pear/SOAP/WSDL.php Sun Feb 25 12:34:00 2007 @@ -209,10 +209,8 @@ * Fills the WSDL array tree with data from a WSDL file. * * @param string $wsdl_uri URL to WSDL file. - * @param array $proxy Contains options for HTTP_Request class - * @see HTTP_Request. */ - function parseURL($wsdl_uri, $proxy = array()) + function parseURL($wsdl_uri) { $parser =& new $this->wsdlParserClass($wsdl_uri, $this, $this->docs); @@ -380,7 +378,7 @@ } // Overloading lowercases function names :( - foreach ($this->services[$this->service]['ports'] as $port => $portAttrs) { + foreach ($this->services[$this->service]['ports'] as $portAttrs) { foreach (array_keys($this->bindings[$portAttrs['binding']]['operations']) as $op) { if (strcasecmp($op, $operation) == 0) { $operation = $op; @@ -415,7 +413,7 @@ $checkmessages = array(); // Find what messages use this datatype. foreach ($this->messages as $messagename => $message) { - foreach ($message as $partname => $part) { + foreach ($message as $part) { if ($part['type'] == $datatype) { $checkmessages[] = $messagename; break; @@ -423,8 +421,7 @@ } } // Find the operation that uses this message. - $dataHandler = null; - foreach($this->portTypes as $portname => $porttype) { + foreach($this->portTypes as $porttype) { foreach ($porttype as $opname => $opinfo) { foreach ($checkmessages as $messagename) { if ($opinfo['input']['message'] == $messagename) { @@ -678,7 +675,6 @@ // The type or element refered to is used for // parameters. $elattrs = null; - $element = $_argtype['element']; $el = $this->elements[$_argtype['namespace']][$_argtype['type']]; if ($el['complex']) { @@ -861,7 +857,7 @@ if ($name && $type) { // XXX TODO: // look up the name in the wsdl and validate the type. - foreach ($this->complexTypes as $ns => $types) { + foreach ($this->complexTypes as $types) { if (isset($types[$type])) { if (isset($types[$type]['type'])) { list($arraytype_ns, $arraytype, $array_depth) = isset($types[$type]['arrayType']) @@ -1965,15 +1961,21 @@ */ var $wsdl = null; - /** Constructor + /** + * Constructor. * - * @param $objects Reference to the object or array of objects to parse - * @param $wsdl Reference to the SOAP_WSDL object to populate - * @param $targetNamespace The target namespace of schema types etc. - * @param $service_name Name of the WSDL <service> - * @param $service_desc Optional description of the WSDL <service> + * @param object|array $objects Reference to the object or array of + * objects to parse. + * @param SOAP_WSDL $wsdl Reference to the SOAP_WSDL object to + * populate. + * @param string $targetNamespace The target namespace of schema types + * etc. + * @param string $service_name Name of the WSDL <service>. + * @param string $service_desc Optional description of the WSDL + * <service>. */ - function SOAP_WSDL_ObjectParser(&$objects, &$wsdl, $targetNamespace, $service_name, $service_desc = '') + function SOAP_WSDL_ObjectParser(&$objects, &$wsdl, $targetNamespace, + $service_name, $service_desc = '') { parent::SOAP_Base('WSDLOBJECTPARSER'); @@ -1986,11 +1988,14 @@ $wsdl_ref = (is_array($objects)? $objects : array(&$objects)); foreach ($wsdl_ref as $ref_item) { - if (!is_object($ref_item)) - return $this->_raiseSoapFault('Invalid web service object passed to object parser', 'urn:' . get_class($object)); + if (!is_object($ref_item)) { + $this->_raiseSoapFault('Invalid web service object passed to object parser'); + continue; + } - if ($this->_parse($ref_item, $targetNamespace, $service_name) != true) + if (!$this->_parse($ref_item, $targetNamespace, $service_name)) { break; + } } // Build bindings from abstract data. @@ -2163,24 +2168,25 @@ } /** - * Take all the abstract WSDL data and build concrete bindings and + * Takes all the abstract WSDL data and builds concrete bindings and * services (destructive). * - * XXX Current implementation discards $service_desc. - * - * @param $schemaNamespace Namespace for types etc. - * @param $service_name Name of the WSDL <service> - * @param $service_desc Optional description of the WSDL <service> * @access private + * @todo Current implementation discards $service_desc. + * + * @param string $schemaNamespace Namespace for types etc. + * @param string $service_name Name of the WSDL <service>. + * @param string $service_desc Optional description of the WSDL + * <service>. */ - function _generateBindingsAndServices($schemaNamespace, $service_name, $service_desc = '') + function _generateBindingsAndServices($schemaNamespace, $service_name, + $service_desc = '') { // Populate tree with bindings information // XXX Current implementation only supports one binding that // matches the single portType and all of its operations. // XXX Is this the correct use of $schemaNamespace here? // *** <wsdl:binding> *** - $this->wsdl->bindings[$service_name . 'Binding'] = array( 'type' => $service_name . 'Port', 'namespace' => $this->tnsPrefix, http://cvs.php.net/viewvc.cgi/pear/SOAP/Server/Email.php?r1=1.17&r2=1.18&diff_format=u Index: pear/SOAP/Server/Email.php diff -u pear/SOAP/Server/Email.php:1.17 pear/SOAP/Server/Email.php:1.18 --- pear/SOAP/Server/Email.php:1.17 Mon Jan 22 11:50:13 2007 +++ pear/SOAP/Server/Email.php Sun Feb 25 12:34:00 2007 @@ -95,11 +95,9 @@ /* If neither matches, we'll just try it anyway. */ if (stristr($data, 'Content-Type: application/dime')) { $this->_decodeDIMEMessage($data, $this->headers, $attachments); - $useEncoding = 'DIME'; } elseif (stristr($data, 'MIME-Version:')) { /* This is a mime message, let's decode it. */ $this->_decodeMimeMessage($data, $this->headers, $attachments); - $useEncoding = 'Mime'; } else { /* The old fallback, but decodeMimeMessage handles things fine. */ $this->_parseEmail($data); @@ -145,8 +143,7 @@ /* Get the character encoding of the incoming request treat incoming * data as UTF-8 if no encoding set. */ - if (!$response && - !$this->_getContentEncoding($this->headers['content-type'])) { + if (!$this->_getContentEncoding($this->headers['content-type'])) { $this->xml_encoding = SOAP_DEFAULT_ENCODING; /* An encoding we don't understand, return a fault. */ $this->_raiseSoapFault('Unsupported encoding, use one of ISO-8859-1, US-ASCII, UTF-8', '', '', 'Server'); @@ -167,7 +164,7 @@ } else { /* Default is DIME. */ $soap_msg = $this->_makeDIMEMessage($soap_msg); - $header['Content-Type'] = 'application/dime'; + $soap_msg['headers']['Content-Type'] = 'application/dime'; } if (PEAR::isError($soap_msg)) { return $this->raiseSoapFault($soap_msg); http://cvs.php.net/viewvc.cgi/pear/SOAP/Transport/HTTP.php?r1=1.52&r2=1.53&diff_format=u Index: pear/SOAP/Transport/HTTP.php diff -u pear/SOAP/Transport/HTTP.php:1.52 pear/SOAP/Transport/HTTP.php:1.53 --- pear/SOAP/Transport/HTTP.php:1.52 Sun Jan 21 17:47:17 2007 +++ pear/SOAP/Transport/HTTP.php Sun Feb 25 12:34:00 2007 @@ -334,8 +334,7 @@ // SOAP faults. $this->_parseHeaders($match[1]); - list($protocol, $code, $msg) = sscanf($this->result_headers[0], - '%s %s %s'); + list(, $code, $msg) = sscanf($this->result_headers[0], '%s %s %s'); unset($this->result_headers[0]); switch($code) { http://cvs.php.net/viewvc.cgi/pear/SOAP/Transport/SMTP.php?r1=1.27&r2=1.28&diff_format=u Index: pear/SOAP/Transport/SMTP.php diff -u pear/SOAP/Transport/SMTP.php:1.27 pear/SOAP/Transport/SMTP.php:1.28 --- pear/SOAP/Transport/SMTP.php:1.27 Fri Jan 26 00:18:17 2007 +++ pear/SOAP/Transport/SMTP.php Sun Feb 25 12:34:00 2007 @@ -156,7 +156,6 @@ $val = new SOAP_Value('Fault', 'Struct', $sval); } - $mqname = new QName($method, $namespace); $methodValue = new SOAP_Value('Response', 'Struct', array($val)); $this->incoming_payload = $this->makeEnvelope($methodValue, @@ -189,16 +188,16 @@ function _validateUrl() { if (!is_array($this->urlparts)) { - $this->_raiseSoapFault("Unable to parse URL $url"); + $this->_raiseSoapFault("Unable to parse URL $this->url"); return false; } if (!isset($this->urlparts['scheme']) || strcasecmp($this->urlparts['scheme'], 'mailto') != 0) { - $this->_raiseSoapFault("Unable to parse URL $url"); + $this->_raiseSoapFault("Unable to parse URL $this->url"); return false; } if (!isset($this->urlparts['path'])) { - $this->_raiseSoapFault("Unable to parse URL $url"); + $this->_raiseSoapFault("Unable to parse URL $this->url"); return false; } return true; http://cvs.php.net/viewvc.cgi/pear/SOAP/Transport/TCP.php?r1=1.11&r2=1.12&diff_format=u Index: pear/SOAP/Transport/TCP.php diff -u pear/SOAP/Transport/TCP.php:1.11 pear/SOAP/Transport/TCP.php:1.12 --- pear/SOAP/Transport/TCP.php:1.11 Mon Jun 19 15:52:30 2006 +++ pear/SOAP/Transport/TCP.php Sun Feb 25 12:34:00 2007 @@ -136,11 +136,11 @@ function _validateUrl() { if (!is_array($this->urlparts) ) { - $this->_raiseSoapFault("Unable to parse URL $url"); + $this->_raiseSoapFault("Unable to parse URL $this->url"); return false; } if (!isset($this->urlparts['host'])) { - $this->_raiseSoapFault("No host in URL $url"); + $this->_raiseSoapFault("No host in URL $this->url"); return false; } if (!isset($this->urlparts['path']) || !$this->urlparts['path']) {