cvs: pear /SOAP Client.php Parser.php WSDL.php

From: Date: Sat, 30 Nov 2002 21:32:32 +0000
Subject: cvs: pear /SOAP Client.php Parser.php WSDL.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-7694@lists.php.net to get a copy of this message
shane Sat Nov 30 16:32:32 2002 EDT Modified files: /pear/SOAP Client.php Parser.php WSDL.php Log: fix using wsdl's on local drive (patch by Jesus M. Castagnetto) fix handling calls with incorrect parameters fix attachment example Index: pear/SOAP/Client.php diff -u pear/SOAP/Client.php:1.44 pear/SOAP/Client.php:1.45 --- pear/SOAP/Client.php:1.44 Wed Oct 23 18:06:44 2002 +++ pear/SOAP/Client.php Sat Nov 30 16:32:31 2002 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: Client.php,v 1.44 2002/10/23 22:06:44 shane Exp $ +// $Id: Client.php,v 1.45 2002/11/30 21:32:31 shane Exp $ // require_once 'SOAP/Value.php'; @@ -37,7 +37,7 @@ * originaly based on SOAPx4 by Dietrich Ayala http://dietrich.ganx4.com/soapx4 * * @access public -* @version $Id: Client.php,v 1.44 2002/10/23 22:06:44 shane Exp $ +* @version $Id: Client.php,v 1.45 2002/11/30 21:32:31 shane Exp $ * @package SOAP::Client * @author Shane Caraveo <shane@php.net> Conversion to PEAR and updates * @author Stig Bakken <ssb@fast.no> Conversion to PEAR @@ -360,12 +360,8 @@ if (isset($params[$name])) { $nparams[$name] = $params[$name]; } else { - // XXX assuming it's an array, not a hash - // XXX this is pretty pethetic, but "fixes" a problem where - // paremeter names do not match correctly - - $nparams[$name] = current($params); - next($params); + # we now force an associative array for parameters if using wsdl + return $this->_raiseSoapFault("The named parameter $name is not in the call parameters."); } if (gettype($nparams[$name]) != 'object' || !is_a($nparams[$name],'soap_value')) { Index: pear/SOAP/Parser.php diff -u pear/SOAP/Parser.php:1.26 pear/SOAP/Parser.php:1.27 --- pear/SOAP/Parser.php:1.26 Sat Oct 19 15:43:53 2002 +++ pear/SOAP/Parser.php Sat Nov 30 16:32:32 2002 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: Parser.php,v 1.26 2002/10/19 19:43:53 shane Exp $ +// $Id: Parser.php,v 1.27 2002/11/30 21:32:32 shane Exp $ // require_once 'SOAP/Base.php'; @@ -30,7 +30,7 @@ * originaly based on SOAPx4 by Dietrich Ayala http://dietrich.ganx4.com/soapx4 * * @access public -* @version $Id: Parser.php,v 1.26 2002/10/19 19:43:53 shane Exp $ +* @version $Id: Parser.php,v 1.27 2002/11/30 21:32:32 shane Exp $ * @package SOAP::Parser * @author Shane Caraveo <shane@php.net> Conversion to PEAR and updates * @author Dietrich Ayala <dietrich@ganx4.com> Original Author @@ -329,7 +329,8 @@ $vqn = new QName($value); $this->message[$pos]['type'] = 'Array'; #$type = $vqn->name; - $this->message[$pos]['arraySize'] = $vqn->arraySize; + if (isset($vqn->arraySize)) + $this->message[$pos]['arraySize'] = $vqn->arraySize; #$sa = strpos($type,'['); #if ($sa > 0) { # $this->message[$pos]['arraySize'] = split(',',substr($type,$sa+1, strlen($type)-$sa-2)); Index: pear/SOAP/WSDL.php diff -u pear/SOAP/WSDL.php:1.29 pear/SOAP/WSDL.php:1.30 --- pear/SOAP/WSDL.php:1.29 Sun Oct 20 20:06:49 2002 +++ pear/SOAP/WSDL.php Sat Nov 30 16:32:32 2002 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: WSDL.php,v 1.29 2002/10/21 00:06:49 shane Exp $ +// $Id: WSDL.php,v 1.30 2002/11/30 21:32:32 shane Exp $ // require_once 'SOAP/Base.php'; require_once 'SOAP/Fault.php'; @@ -39,7 +39,7 @@ * implement IDL type syntax declaration so we can generate WSDL * * @access public -* @version $Id: WSDL.php,v 1.29 2002/10/21 00:06:49 shane Exp $ +* @version $Id: WSDL.php,v 1.30 2002/11/30 21:32:32 shane Exp $ * @package SOAP::Client * @author Shane Caraveo <shane@php.net> Conversion to PEAR and updates * @author Dietrich Ayala <dietrich@ganx4.com> Original Author @@ -618,19 +618,32 @@ } } if (!$md5_wsdl) { - $uri = explode('?',$wsdl_fname); - $rq = new HTTP_Request($uri[0], $proxy_params); - // the user agent HTTP_Request uses fouls things up - if (isset($uri[1])) { - $rq->addRawQueryString($uri[1]); - } - $result = $rq->sendRequest(); - if (PEAR::isError($result)) { - return $this->_raiseSoapFault("Unable to retrieve WSDL $wsdl_fname, ".$rq->getResponseCode(), $wsdl_fname); - } - $file_data = $rq->getResponseBody(); - if (!$file_data) { - return $this->_raiseSoapFault("Unable to retrieve WSDL $wsdl_fname, no http body", $wsdl_fname); + // is it a local file? + // this section should be replace by curl at some point + if (!preg_match('/^(http|file):\/\//',$wsdl_fname)) { + if (!file_exists($wsdl_fname)) { + return $this->_raiseSoapFault("Unable to read local WSDL $wsdl_fname", $wsdl_fname); + } + if (function_exists('file_get_contents')) { + $file_data = file_get_contents($wsdl_fname); + } else { + $file_data = implode('',file($wsdl_fname)); + } + } else { + $uri = explode('?',$wsdl_fname); + $rq = new HTTP_Request($uri[0], $proxy_params); + // the user agent HTTP_Request uses fouls things up + if (isset($uri[1])) { + $rq->addRawQueryString($uri[1]); + } + $result = $rq->sendRequest(); + if (PEAR::isError($result)) { + return $this->_raiseSoapFault("Unable to retrieve WSDL $wsdl_fname,".$rq->getResponseCode(), $wsdl_fname); + } + $file_data = $rq->getResponseBody(); + if (!$file_data) { + return $this->_raiseSoapFault("Unable to retrieve WSDL $wsdl_fname, nohttp body", $wsdl_fname); + } } $md5_wsdl = md5($file_data);

« previous php.pear.cvs (#7694) next »