cvs: pear /SOAP Client.php Value.php globals.php /SOAP/interop client_round2.php client_round2_interop.php /SOAP/test xmethods.php
| From: | Shane Caraveo | Date: | Tue, 09 Apr 2002 08:01:13 +0000 |
| Subject: | cvs: pear /SOAP Client.php Value.php globals.php /SOAP/interop client_round2.php client_round2_interop.php /SOAP/test xmethods.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-3166@lists.php.net to get a copy of this message | ||
shane Tue Apr 9 04:01:13 2002 EDT
Added files:
/pear/SOAP/test xmethods.php
Modified files:
/pear/SOAP Client.php Value.php globals.php
/pear/SOAP/interop client_round2.php client_round2_interop.php
Log:
start to move away from a global var for namespaces
start of test for wsdl's on xmethods
add test method for a group
Index: pear/SOAP/Client.php diff -u pear/SOAP/Client.php:1.18 pear/SOAP/Client.php:1.19 --- pear/SOAP/Client.php:1.18 Sun Apr 7 19:22:32 2002 +++ pear/SOAP/Client.php Tue Apr 9 04:01:12 2002 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: Client.php,v 1.18 2002/04/07 23:22:32 shane Exp $ +// $Id: Client.php,v 1.19 2002/04/09 08:01:12 shane Exp $ // require_once 'SOAP/Value.php'; @@ -38,7 +38,7 @@ * originaly based on SOAPx4 by Dietrich Ayala http://dietrich.ganx4.com/soapx4 * * @access public -* @version $Id: Client.php,v 1.18 2002/04/07 23:22:32 shane Exp $ +* @version $Id: Client.php,v 1.19 2002/04/09 08:01:12 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 @@ -135,8 +135,10 @@ function addHeader($soap_value) { - if (!$this->soapmsg) + if (!$this->soapmsg) { + soap_reset_namespaces(); $this->soapmsg = new SOAP_Message(NULL, $this->wsdl); + } # add a new header to the message if (get_class($soap_value) == 'soap_header') { $this->soapmsg->addHeader($soap_value); @@ -164,6 +166,12 @@ { $this->fault = null; + // make message + if (!$this->soapmsg) { + soap_reset_namespaces(); + $this->soapmsg = new SOAP_Message(NULL, $this->wsdl); + } + if ($this->endpointType == 'wsdl') { $this->setSchemaVersion($this->wsdl->xsd); // get portName @@ -218,15 +226,14 @@ } } $params = $nparams; + } else { + $this->setSchemaVersion(SOAP_XML_SCHEMA_VERSION); } $this->debug("soapAction: $soapAction"); $this->debug("namespace: $namespace"); - // make message - if (!$this->soapmsg) - $this->soapmsg = new SOAP_Message(NULL, $this->wsdl); $this->soapmsg->method($method, $params, $namespace); if ($this->soapmsg->fault) { return $this->raiseSoapFault($this->soapmsg->fault); Index: pear/SOAP/Value.php diff -u pear/SOAP/Value.php:1.21 pear/SOAP/Value.php:1.22 --- pear/SOAP/Value.php:1.21 Mon Apr 8 03:11:51 2002 +++ pear/SOAP/Value.php Tue Apr 9 04:01:12 2002 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: Value.php,v 1.21 2002/04/08 07:11:51 shane Exp $ +// $Id: Value.php,v 1.22 2002/04/09 08:01:12 shane Exp $ // require_once 'SOAP/Base.php'; require_once 'SOAP/globals.php'; @@ -31,7 +31,7 @@ * originaly based on SOAPx4 by Dietrich Ayala http://dietrich.ganx4.com/soapx4 * * @access public -* @version $Id: Value.php,v 1.21 2002/04/08 07:11:51 shane Exp $ +* @version $Id: Value.php,v 1.22 2002/04/09 08:01:12 shane Exp $ * @package SOAP::Client * @author Shane Caraveo <shane@php.net> Conversion to PEAR and updates * @author Dietrich Ayala <dietrich@ganx4.com> Original Author @@ -127,40 +127,12 @@ $this->wsdl = $wsdl; $this->type_namespace = $type_namespace; $this->type = $this->_getSoapType($value, $type, $name, $type_namespace); - - if ($methodNamespace) { - $this->namespace = $methodNamespace; - - if (!isset($SOAP_namespaces[$methodNamespace])) { - $SOAP_namespaces[$methodNamespace] = 'ns' . (count($SOAP_namespaces) + 1); - } - - $this->prefix = $SOAP_namespaces[$methodNamespace]; - } + $this->namespace = $methodNamespace; - // get type prefix - if (strpos($type , ':') !== false) { + if (strpos($this->type , ':') !== false) { $qname = new QName($type); $this->type = $qname->name; $this->type_prefix = $qname->ns; - - } elseif ($type_namespace) { - - if (!isset($SOAP_namespaces[$type_namespace])) { - $SOAP_namespaces[$type_namespace] = 'ns'.(count($SOAP_namespaces)+1); - } - $this->type_prefix = $SOAP_namespaces[$type_namespace]; - - // if type namespace was not explicitly passed, and we're not in a method struct: - } elseif (!$this->type_prefix && $type != 'Struct' /*!isset($type_namespace)*/) { - - // try to get type prefix from typeMap - if ($ns = $this->verifyType($this->type)) { - $this->type_prefix = $SOAP_namespaces[$ns]; - } else if ($methodNamespace) { - // else default to method namespace - $this->type_prefix = $SOAP_namespaces[$methodNamespace]; - } } if (array_key_exists($this->type, $SOAP_typemap[SOAP_XML_SCHEMA_VERSION])) { @@ -225,8 +197,8 @@ // else make obj and serialize } else { #$type = $this->arrayType; - $type = $this->_getSoapType($v, $type, $k); - $new_val = new SOAP_Value('item', $this->arrayType, $v); + //$type = $this->_getSoapType($v, $type, $k); + $new_val = new SOAP_Value('item', NULL /*$this->arrayType*/, $v); $this->value[] = $new_val; } } @@ -248,9 +220,9 @@ $this->value[] = $v; // else make obj and serialize } else { - $type = NULL; - $type = $this->_getSoapType($v, $type, $k); - $new_val = new SOAP_Value($k, $type, $v); + //$type = NULL; + //$type = $this->_getSoapType($v, $type, $k); + $new_val = new SOAP_Value($k, NULL, $v); $this->value[] = $new_val; } } @@ -421,6 +393,39 @@ */ function serialize() { + global $SOAP_namespaces; + + if ($this->namespace) { + if (!isset($SOAP_namespaces[$this->namespace])) { + $SOAP_namespaces[$this->namespace] = 'ns' . (count($SOAP_namespaces) + 1); + } + + $this->prefix = $SOAP_namespaces[$this->namespace]; + } + // get type prefix + if (strpos($this->type , ':') !== false) { + $qname = new QName($type); + $this->type = $qname->name; + $this->type_prefix = $qname->ns; + + } elseif ($this->type_namespace) { + + if (!isset($SOAP_namespaces[$this->type_namespace])) { + $SOAP_namespaces[$this->type_namespace] = 'ns'.(count($SOAP_namespaces)+1); + } + $this->type_prefix = $SOAP_namespaces[$this->type_namespace]; + + // if type namespace was not explicitly passed, and we're not in a method struct: + } elseif (!$this->type_prefix && $this->type != 'Struct' /*!isset($type_namespace)*/) { + + // try to get type prefix from typeMap + if ($ns = $this->verifyType($this->type)) { + $this->type_prefix = $SOAP_namespaces[$ns]; + } else if ($methodNamespace) { + // else default to method namespace + $this->type_prefix = $SOAP_namespaces[$methodNamespace]; + } + } return $this->serializeval($this); } @@ -499,7 +504,6 @@ if (array_key_exists($type,$types)) return $uri; } return FALSE; - #return array_key_exists($type, $SOAP_typemap[SOAP_XML_SCHEMA_VERSION]); } /** Index: pear/SOAP/globals.php diff -u pear/SOAP/globals.php:1.12 pear/SOAP/globals.php:1.13 --- pear/SOAP/globals.php:1.12 Sun Apr 7 19:22:32 2002 +++ pear/SOAP/globals.php Tue Apr 9 04:01:12 2002 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: globals.php,v 1.12 2002/04/07 23:22:32 shane Exp $ +// $Id: globals.php,v 1.13 2002/04/09 08:01:12 shane Exp $ // /** @@ -25,7 +25,7 @@ * * @module globals * @package SOAP -* @version $Id: globals.php,v 1.12 2002/04/07 23:22:32 shane Exp $ +* @version $Id: globals.php,v 1.13 2002/04/09 08:01:12 shane Exp $ * @author Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more * @author Dietrich Ayala <dietrich@ganx4.com> Original Author */ @@ -135,12 +135,19 @@ $SOAP_typemap[SOAP_SCHEMA_ENCODING] = array('base64' => 'string','array' => 'array','Array' => 'array', 'Struct'=>'array'); // load namespace uris into an array of uri => prefix -$SOAP_namespaces = array( +$SOAP_namespaces_default = array( SOAP_ENVELOP => 'SOAP-ENV', SOAP_XML_SCHEMA_VERSION => 'xsd', SOAP_XML_SCHEMA_VERSION.'-instance' => 'xsi', SOAP_SCHEMA_ENCODING => 'SOAP-ENC', SOAP_INTEROPORG=>'si'); + +$SOAP_namespaces = $SOAP_namespaces_default; + +function soap_reset_namespaces() { + global $SOAP_namespaces, $SOAP_namespaces_default; + $SOAP_namespaces = $SOAP_namespaces_default; +} $SOAP_xmlEntities = array('quot' => '"','amp' => '&', 'lt' => '<','gt' => '>','apos' => "'"); Index: pear/SOAP/interop/client_round2.php diff -u pear/SOAP/interop/client_round2.php:1.4 pear/SOAP/interop/client_round2.php:1.5 --- pear/SOAP/interop/client_round2.php:1.4 Tue Apr 9 02:35:34 2002 +++ pear/SOAP/interop/client_round2.php Tue Apr 9 04:01:13 2002 @@ -17,7 +17,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: client_round2.php,v 1.4 2002/04/09 06:35:34 shane Exp $ +// $Id: client_round2.php,v 1.5 2002/04/09 08:01:13 shane Exp $ // set_time_limit(0); require_once 'SOAP/interop/client_round2_interop.php'; @@ -41,6 +41,7 @@ $iop->showFaults = 0; // used in result table output #$iop->doTest(); // run a single set of tests using above options +#$iop->doGroupTests(); // run a group of tests set in $currentTest $iop->doTests(); // run all tests, ignore above options #$iop->outputTables(); echo "done"; Index: pear/SOAP/interop/client_round2_interop.php diff -u pear/SOAP/interop/client_round2_interop.php:1.5 pear/SOAP/interop/client_round2_interop.php:1.6 --- pear/SOAP/interop/client_round2_interop.php:1.5 Tue Apr 9 02:35:34 2002 +++ pear/SOAP/interop/client_round2_interop.php Tue Apr 9 04:01:13 2002 @@ -16,7 +16,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: client_round2_interop.php,v 1.5 2002/04/09 06:35:34 shane Exp $ +// $Id: client_round2_interop.php,v 1.6 2002/04/09 08:01:13 shane Exp $ // require_once 'DB.php'; // PEAR/DB require_once 'SOAP/Client.php'; @@ -567,6 +567,19 @@ $this->totals['calls']++; } if ($this->numservers && ++$i >= $this->numservers) break; + } + } + + function doGroupTests() { + $dowsdl = array(0,1); + foreach($dowsdl as $usewsdl) { + $this->useWSDL = $usewsdl; + foreach($this->paramTypes as $ptype) { + // skip a pointless test + if ($usewsdl && $ptype == 'soapval') break; + $this->paramType = $ptype; + $this->doTest(); + } } } Index: pear/SOAP/test/xmethods.php +++ pear/SOAP/test/xmethods.php <html><body> <? // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more | // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // // $Id: xmethods.php,v 1.1 2002/04/09 08:01:13 shane Exp $ // // include soap client class include("SOAP/Client.php"); print "getting wsdl list from xmethods...\n"; $soapclient = new SOAP_Client("http://www.xmethods.net/wsdl/query.wsdl","wsdl"); $summary = $soapclient->call("getAllServiceSummaries",array()); # !@#^%$ php needs real timeouts on windows $skip = array('Unisys Weather Web Service'); print "getting wsdls in list...\n"; foreach ($summary as $info) { if (in_array($info['name'],$skip)) continue; print "retrieving {$info['name']}..."; $wsdl = new SOAP_WSDL($info['wsdlURL']); if ($wsdl->fault) { print $wsdl->fault->getMessage()."\n"; } else { print "wsdl parsed OK\n"; } } print "\n\n"; ?> </html></body>
Index: pear/SOAP/Client.php diff -u pear/SOAP/Client.php:1.18 pear/SOAP/Client.php:1.19 --- pear/SOAP/Client.php:1.18 Sun Apr 7 19:22:32 2002 +++ pear/SOAP/Client.php Tue Apr 9 04:01:12 2002 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: Client.php,v 1.18 2002/04/07 23:22:32 shane Exp $ +// $Id: Client.php,v 1.19 2002/04/09 08:01:12 shane Exp $ // require_once 'SOAP/Value.php'; @@ -38,7 +38,7 @@ * originaly based on SOAPx4 by Dietrich Ayala http://dietrich.ganx4.com/soapx4 * * @access public -* @version $Id: Client.php,v 1.18 2002/04/07 23:22:32 shane Exp $ +* @version $Id: Client.php,v 1.19 2002/04/09 08:01:12 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 @@ -135,8 +135,10 @@ function addHeader($soap_value) { - if (!$this->soapmsg) + if (!$this->soapmsg) { + soap_reset_namespaces(); $this->soapmsg = new SOAP_Message(NULL, $this->wsdl); + } # add a new header to the message if (get_class($soap_value) == 'soap_header') { $this->soapmsg->addHeader($soap_value); @@ -164,6 +166,12 @@ { $this->fault = null; + // make message + if (!$this->soapmsg) { + soap_reset_namespaces(); + $this->soapmsg = new SOAP_Message(NULL, $this->wsdl); + } + if ($this->endpointType == 'wsdl') { $this->setSchemaVersion($this->wsdl->xsd); // get portName @@ -218,15 +226,14 @@ } } $params = $nparams; + } else { + $this->setSchemaVersion(SOAP_XML_SCHEMA_VERSION); } $this->debug("soapAction: $soapAction"); $this->debug("namespace: $namespace"); - // make message - if (!$this->soapmsg) - $this->soapmsg = new SOAP_Message(NULL, $this->wsdl); $this->soapmsg->method($method, $params, $namespace); if ($this->soapmsg->fault) { return $this->raiseSoapFault($this->soapmsg->fault); Index: pear/SOAP/Value.php diff -u pear/SOAP/Value.php:1.21 pear/SOAP/Value.php:1.22 --- pear/SOAP/Value.php:1.21 Mon Apr 8 03:11:51 2002 +++ pear/SOAP/Value.php Tue Apr 9 04:01:12 2002 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: Value.php,v 1.21 2002/04/08 07:11:51 shane Exp $ +// $Id: Value.php,v 1.22 2002/04/09 08:01:12 shane Exp $ // require_once 'SOAP/Base.php'; require_once 'SOAP/globals.php'; @@ -31,7 +31,7 @@ * originaly based on SOAPx4 by Dietrich Ayala http://dietrich.ganx4.com/soapx4 * * @access public -* @version $Id: Value.php,v 1.21 2002/04/08 07:11:51 shane Exp $ +* @version $Id: Value.php,v 1.22 2002/04/09 08:01:12 shane Exp $ * @package SOAP::Client * @author Shane Caraveo <shane@php.net> Conversion to PEAR and updates * @author Dietrich Ayala <dietrich@ganx4.com> Original Author @@ -127,40 +127,12 @@ $this->wsdl = $wsdl; $this->type_namespace = $type_namespace; $this->type = $this->_getSoapType($value, $type, $name, $type_namespace); - - if ($methodNamespace) { - $this->namespace = $methodNamespace; - - if (!isset($SOAP_namespaces[$methodNamespace])) { - $SOAP_namespaces[$methodNamespace] = 'ns' . (count($SOAP_namespaces) + 1); - } - - $this->prefix = $SOAP_namespaces[$methodNamespace]; - } + $this->namespace = $methodNamespace; - // get type prefix - if (strpos($type , ':') !== false) { + if (strpos($this->type , ':') !== false) { $qname = new QName($type); $this->type = $qname->name; $this->type_prefix = $qname->ns; - - } elseif ($type_namespace) { - - if (!isset($SOAP_namespaces[$type_namespace])) { - $SOAP_namespaces[$type_namespace] = 'ns'.(count($SOAP_namespaces)+1); - } - $this->type_prefix = $SOAP_namespaces[$type_namespace]; - - // if type namespace was not explicitly passed, and we're not in a method struct: - } elseif (!$this->type_prefix && $type != 'Struct' /*!isset($type_namespace)*/) { - - // try to get type prefix from typeMap - if ($ns = $this->verifyType($this->type)) { - $this->type_prefix = $SOAP_namespaces[$ns]; - } else if ($methodNamespace) { - // else default to method namespace - $this->type_prefix = $SOAP_namespaces[$methodNamespace]; - } } if (array_key_exists($this->type, $SOAP_typemap[SOAP_XML_SCHEMA_VERSION])) { @@ -225,8 +197,8 @@ // else make obj and serialize } else { #$type = $this->arrayType; - $type = $this->_getSoapType($v, $type, $k); - $new_val = new SOAP_Value('item', $this->arrayType, $v); + //$type = $this->_getSoapType($v, $type, $k); + $new_val = new SOAP_Value('item', NULL /*$this->arrayType*/, $v); $this->value[] = $new_val; } } @@ -248,9 +220,9 @@ $this->value[] = $v; // else make obj and serialize } else { - $type = NULL; - $type = $this->_getSoapType($v, $type, $k); - $new_val = new SOAP_Value($k, $type, $v); + //$type = NULL; + //$type = $this->_getSoapType($v, $type, $k); + $new_val = new SOAP_Value($k, NULL, $v); $this->value[] = $new_val; } } @@ -421,6 +393,39 @@ */ function serialize() { + global $SOAP_namespaces; + + if ($this->namespace) { + if (!isset($SOAP_namespaces[$this->namespace])) { + $SOAP_namespaces[$this->namespace] = 'ns' . (count($SOAP_namespaces) + 1); + } + + $this->prefix = $SOAP_namespaces[$this->namespace]; + } + // get type prefix + if (strpos($this->type , ':') !== false) { + $qname = new QName($type); + $this->type = $qname->name; + $this->type_prefix = $qname->ns; + + } elseif ($this->type_namespace) { + + if (!isset($SOAP_namespaces[$this->type_namespace])) { + $SOAP_namespaces[$this->type_namespace] = 'ns'.(count($SOAP_namespaces)+1); + } + $this->type_prefix = $SOAP_namespaces[$this->type_namespace]; + + // if type namespace was not explicitly passed, and we're not in a method struct: + } elseif (!$this->type_prefix && $this->type != 'Struct' /*!isset($type_namespace)*/) { + + // try to get type prefix from typeMap + if ($ns = $this->verifyType($this->type)) { + $this->type_prefix = $SOAP_namespaces[$ns]; + } else if ($methodNamespace) { + // else default to method namespace + $this->type_prefix = $SOAP_namespaces[$methodNamespace]; + } + } return $this->serializeval($this); } @@ -499,7 +504,6 @@ if (array_key_exists($type,$types)) return $uri; } return FALSE; - #return array_key_exists($type, $SOAP_typemap[SOAP_XML_SCHEMA_VERSION]); } /** Index: pear/SOAP/globals.php diff -u pear/SOAP/globals.php:1.12 pear/SOAP/globals.php:1.13 --- pear/SOAP/globals.php:1.12 Sun Apr 7 19:22:32 2002 +++ pear/SOAP/globals.php Tue Apr 9 04:01:12 2002 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: globals.php,v 1.12 2002/04/07 23:22:32 shane Exp $ +// $Id: globals.php,v 1.13 2002/04/09 08:01:12 shane Exp $ // /** @@ -25,7 +25,7 @@ * * @module globals * @package SOAP -* @version $Id: globals.php,v 1.12 2002/04/07 23:22:32 shane Exp $ +* @version $Id: globals.php,v 1.13 2002/04/09 08:01:12 shane Exp $ * @author Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more * @author Dietrich Ayala <dietrich@ganx4.com> Original Author */ @@ -135,12 +135,19 @@ $SOAP_typemap[SOAP_SCHEMA_ENCODING] = array('base64' => 'string','array' => 'array','Array' => 'array', 'Struct'=>'array'); // load namespace uris into an array of uri => prefix -$SOAP_namespaces = array( +$SOAP_namespaces_default = array( SOAP_ENVELOP => 'SOAP-ENV', SOAP_XML_SCHEMA_VERSION => 'xsd', SOAP_XML_SCHEMA_VERSION.'-instance' => 'xsi', SOAP_SCHEMA_ENCODING => 'SOAP-ENC', SOAP_INTEROPORG=>'si'); + +$SOAP_namespaces = $SOAP_namespaces_default; + +function soap_reset_namespaces() { + global $SOAP_namespaces, $SOAP_namespaces_default; + $SOAP_namespaces = $SOAP_namespaces_default; +} $SOAP_xmlEntities = array('quot' => '"','amp' => '&', 'lt' => '<','gt' => '>','apos' => "'"); Index: pear/SOAP/interop/client_round2.php diff -u pear/SOAP/interop/client_round2.php:1.4 pear/SOAP/interop/client_round2.php:1.5 --- pear/SOAP/interop/client_round2.php:1.4 Tue Apr 9 02:35:34 2002 +++ pear/SOAP/interop/client_round2.php Tue Apr 9 04:01:13 2002 @@ -17,7 +17,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: client_round2.php,v 1.4 2002/04/09 06:35:34 shane Exp $ +// $Id: client_round2.php,v 1.5 2002/04/09 08:01:13 shane Exp $ // set_time_limit(0); require_once 'SOAP/interop/client_round2_interop.php'; @@ -41,6 +41,7 @@ $iop->showFaults = 0; // used in result table output #$iop->doTest(); // run a single set of tests using above options +#$iop->doGroupTests(); // run a group of tests set in $currentTest $iop->doTests(); // run all tests, ignore above options #$iop->outputTables(); echo "done"; Index: pear/SOAP/interop/client_round2_interop.php diff -u pear/SOAP/interop/client_round2_interop.php:1.5 pear/SOAP/interop/client_round2_interop.php:1.6 --- pear/SOAP/interop/client_round2_interop.php:1.5 Tue Apr 9 02:35:34 2002 +++ pear/SOAP/interop/client_round2_interop.php Tue Apr 9 04:01:13 2002 @@ -16,7 +16,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: client_round2_interop.php,v 1.5 2002/04/09 06:35:34 shane Exp $ +// $Id: client_round2_interop.php,v 1.6 2002/04/09 08:01:13 shane Exp $ // require_once 'DB.php'; // PEAR/DB require_once 'SOAP/Client.php'; @@ -567,6 +567,19 @@ $this->totals['calls']++; } if ($this->numservers && ++$i >= $this->numservers) break; + } + } + + function doGroupTests() { + $dowsdl = array(0,1); + foreach($dowsdl as $usewsdl) { + $this->useWSDL = $usewsdl; + foreach($this->paramTypes as $ptype) { + // skip a pointless test + if ($usewsdl && $ptype == 'soapval') break; + $this->paramType = $ptype; + $this->doTest(); + } } } Index: pear/SOAP/test/xmethods.php +++ pear/SOAP/test/xmethods.php <html><body> <? // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more | // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // // $Id: xmethods.php,v 1.1 2002/04/09 08:01:13 shane Exp $ // // include soap client class include("SOAP/Client.php"); print "getting wsdl list from xmethods...\n"; $soapclient = new SOAP_Client("http://www.xmethods.net/wsdl/query.wsdl","wsdl"); $summary = $soapclient->call("getAllServiceSummaries",array()); # !@#^%$ php needs real timeouts on windows $skip = array('Unisys Weather Web Service'); print "getting wsdls in list...\n"; foreach ($summary as $info) { if (in_array($info['name'],$skip)) continue; print "retrieving {$info['name']}..."; $wsdl = new SOAP_WSDL($info['wsdlURL']); if ($wsdl->fault) { print $wsdl->fault->getMessage()."\n"; } else { print "wsdl parsed OK\n"; } } print "\n\n"; ?> </html></body>