From ab60b799128d5a99e7b8a1210155a4f63b3d81c7 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Wed, 26 Sep 2018 14:19:23 +0200 Subject: [PATCH] Remove outdated soap examples This patch removes PHP soap extension examples in favor of the PHP manual. --- ext/soap/interop/client_round2.php | 113 --- ext/soap/interop/client_round2_interop.php | 783 --------------------- ext/soap/interop/client_round2_params.php | 619 ---------------- ext/soap/interop/client_round2_results.php | 73 -- ext/soap/interop/client_round2_run.php | 50 -- ext/soap/interop/config.php.dist | 5 - ext/soap/interop/database_round2.sql | 44 -- ext/soap/interop/echoheadersvc.wsdl.php | 398 ----------- ext/soap/interop/index.php | 59 -- ext/soap/interop/interop.wsdl.php | 336 --------- ext/soap/interop/interopB.wsdl.php | 196 ------ ext/soap/interop/server_round2_base.php | 102 --- ext/soap/interop/server_round2_groupB.php | 55 -- ext/soap/interop/server_round2_groupC.php | 40 -- ext/soap/interop/test.utility.php | 143 ---- 15 files changed, 3016 deletions(-) delete mode 100644 ext/soap/interop/client_round2.php delete mode 100644 ext/soap/interop/client_round2_interop.php delete mode 100644 ext/soap/interop/client_round2_params.php delete mode 100644 ext/soap/interop/client_round2_results.php delete mode 100644 ext/soap/interop/client_round2_run.php delete mode 100644 ext/soap/interop/config.php.dist delete mode 100644 ext/soap/interop/database_round2.sql delete mode 100644 ext/soap/interop/echoheadersvc.wsdl.php delete mode 100644 ext/soap/interop/index.php delete mode 100644 ext/soap/interop/interop.wsdl.php delete mode 100644 ext/soap/interop/interopB.wsdl.php delete mode 100644 ext/soap/interop/server_round2_base.php delete mode 100644 ext/soap/interop/server_round2_groupB.php delete mode 100644 ext/soap/interop/server_round2_groupC.php delete mode 100644 ext/soap/interop/test.utility.php diff --git a/ext/soap/interop/client_round2.php b/ext/soap/interop/client_round2.php deleted file mode 100644 index c1307472c4..0000000000 --- a/ext/soap/interop/client_round2.php +++ /dev/null @@ -1,113 +0,0 @@ - - - - - Round 2 Interop Client Tests - - - -Back to Interop Index
-

 

-getEndpoints($test); - echo "\n"; -} -function methodList($test,$sel_method) -{ - global $iop; - global $soap_tests; - - echo "\n"; -} - -function endpointTestForm($test, $endpoint, $method, $paramType, $useWSDL) -{ - global $PHP_SELF; - if (!$test) $test = 'base'; - echo "Round 2 '$test' Selected
\n"; - echo "Select endpoint and method to run:
\n"; - echo "
\n"; - echo "\n"; - endpointList($test, $endpoint); - methodList($test, $method); - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; -} - -function testSelectForm($selected_test = NULL) -{ - global $iop, $PHP_SELF; - echo "Select a Round 2 test case to run:
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "

\n"; -} - -testSelectForm($_POST['test']); -endpointTestForm($_POST['test'],$_POST['endpoint'],$_POST['method'],$_POST['paramType'],$_POST['useWSDL']); - -if ($_POST['test'] && array_key_exists('endpoint', $_POST) && array_key_exists('method', $_POST)) { - // here we execute the orders - echo "

Calling {$_POST['method']} at {$_POST['endpoint']}

\n"; - echo "NOTE: wire's are slightly modified to display better in web browsers.
\n"; - - $iop->currentTest = $_POST['test']; // see $tests above - $iop->paramType = $_POST['paramType']; // 'php' or 'soapval' - $iop->useWSDL = $_POST['useWSDL']; // 1= do wsdl tests - $iop->numServers = 0; // 0 = all - $iop->specificEndpoint = $_POST['endpoint']; // test only this endpoint - $iop->testMethod = $_POST['method']=='ALL'?'':$_POST['method']; // test only this method - $iop->skipEndpointList = array(); // endpoints to skip - $iop->nosave = 0; // 1= disable saving results to database - // debug output - $iop->show = 0; - $iop->debug = 0; - $iop->showFaults = 0; // used in result table output - echo '
';
-    $iop->doTest();  // run a single set of tests using above options
-    echo '
'; -} -?> - - diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php deleted file mode 100644 index 0066667449..0000000000 --- a/ext/soap/interop/client_round2_interop.php +++ /dev/null @@ -1,783 +0,0 @@ - | -// +----------------------------------------------------------------------+ - -require_once 'DB.php'; // PEAR/DB -require_once 'client_round2_params.php'; -require_once 'test.utility.php'; -require_once 'config.php'; - -error_reporting(E_ALL ^ E_NOTICE); - -class Interop_Client -{ - // database DNS - var $DSN = ""; - - var $baseURL = ""; - - // our central interop server, where we can get the list of endpoints - var $interopServer = "http://www.whitemesa.net/wsdl/interopInfo.wsdl"; - - // our local endpoint, will always get added to the database for all tests - var $localEndpoint; - - // specify testing - var $currentTest = 'base'; // see $tests above - var $paramType = 'php'; // 'php' or 'soapval' - var $useWSDL = 0; // 1= do wsdl tests - var $numServers = 0; // 0 = all - var $specificEndpoint = ''; // test only this endpoint - var $testMethod = ''; // test only this method - var $skipEndpointList = array(); // endpoints to skip - var $nosave = 0; - var $startAt = ''; // start in list at this endpoint - // debug output - var $show = 1; - var $debug = 0; - var $showFaults = 0; // used in result table output - - // PRIVATE VARIABLES - var $dbc = NULL; - var $totals = array(); - var $tests = array('base','GroupB', 'GroupC'); - var $paramTypes = array('php', 'soapval'); - var $endpoints = array(); - var $html = 1; - - function Interop_Client() { - global $interopConfig; - $this->DSN = $interopConfig['DSN']; - $this->baseURL = $interopConfig['baseURL']; - //$this->baseURL = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']); - // set up the database connection - $this->dbc = DB::connect($this->DSN, true); - // if it errors out, just ignore it and rely on regular methods - if (DB::isError($this->dbc)) { - echo $this->dbc->getMessage(); - $this->dbc = NULL; - } - // set up local endpoint - $this->localEndpoint['base'] = (object)array( - 'endpointName'=>'PHP ext/soap', - 'endpointURL'=>$this->baseURL.'/server_round2_base.php', - 'wsdlURL'=>$this->baseURL.'/interop.wsdl.php' - ); - $this->localEndpoint['GroupB'] = (object)array( - 'endpointName'=>'PHP ext/soap', - 'endpointURL'=>$this->baseURL.'/server_round2_groupB.php', - 'wsdlURL'=>$this->baseURL.'/interopB.wsdl.php' - ); - $this->localEndpoint['GroupC'] = (object)array( - 'endpointName'=>'PHP ext/soap', - 'endpointURL'=>$this->baseURL.'/server_round2_groupC.php', - 'wsdlURL'=>$this->baseURL.'/echoheadersvc.wsdl.php'); - } - - function _fetchEndpoints(&$soapclient, $test) { - $this->_getEndpoints($test, 1); - - // retrieve endpoints from the endpoint server - $endpointArray = $soapclient->__soapCall("GetEndpointInfo",array("groupName"=>$test),array('soapaction'=>"http://soapinterop.org/",'uri'=>"http://soapinterop.org/")); - if (is_soap_fault($endpointArray) || PEAR::isError($endpointArray)) { - if ($this->html) print "
";
-            print $soapclient->wire."\n";
-            print_r($endpointArray);
-            if ($this->html) print "
"; - print "\n"; - return; - } - - // add our local endpoint - if ($this->localEndpoint[$test]) { - array_push($endpointArray, $this->localEndpoint[$test]); - } - - if (!$endpointArray) return; - - // reset the status to zero - $res = $this->dbc->query("update endpoints set status = 0 where class='$test'"); - if (DB::isError($res)) { - die ($res->getMessage()); - } - if (is_object($res)) $res->free(); - // save new endpoints into database - foreach($endpointArray as $k => $v){ - if (array_key_exists($v->endpointName,$this->endpoints)) { - $res = $this->dbc->query("update endpoints set endpointURL='{$v->endpointURL}', wsdlURL='{$v->wsdlURL}', status=1 where id={$this->endpoints[$v->endpointName]['id']}"); - } else { - $res = $this->dbc->query("insert into endpoints (endpointName,endpointURL,wsdlURL,class) values('{$v->endpointName}','{$v->endpointURL}','{$v->wsdlURL}','$test')"); - } - if (DB::isError($res)) { - die ($res->getMessage()); - } - if (is_object($res)) $res->free(); - } - } - - /** - * fetchEndpoints - * retrieve endpoints interop server - * - * @return boolean result - * @access private - */ - function fetchEndpoints($test = NULL) { - // fetch from the interop server - try { - $soapclient = new SoapClient($this->interopServer); - if ($test) { - $this->_fetchEndpoints($soapclient, $test); - } else { - foreach ($this->tests as $test) { - $this->_fetchEndpoints($soapclient, $test); - } - $test = 'base'; - } - } catch (SoapFault $fault) { - if ($this->html) { - echo "
$fault
\n"; - } else { - echo "$fault\n"; - } - return NULL; - } - // retrieve all endpoints now - $this->currentTest = $test; - $x = $this->_getEndpoints($test); - return $x; - } - - /** - * getEndpoints - * retrieve endpoints from either database or interop server - * - * @param string base (see local var $tests) - * @param boolean all (if false, only get valid endpoints, status=1) - * @return boolean result - * @access private - */ - function getEndpoints($base = 'base', $all = 0) { - if (!$this->_getEndpoints($base, $all)) { - return $this->fetchEndpoints($base); - } - return TRUE; - } - - /** - * _getEndpoints - * retrieve endpoints from database - * - * @param string base (see local var $tests) - * @param boolean all (if false, only get valid endpoints, status=1) - * @return boolean result - * @access private - */ - function _getEndpoints($base = "", $all = 0) { - $this->endpoints = array(); - - // build sql - $sql = "select * from endpoints "; - if ($base) { - $sql .= "where class='$base' "; - if (!$all) $sql .= "and status=1"; - } else - if (!$all) $sql .= "where status=1"; - $sql .= " order by endpointName"; - - - $db_ep = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC ); - if (DB::isError($db_ep)) { - echo $sql."\n"; - echo $db_ep->getMessage(); - return FALSE; - } - // rearange the array - foreach ($db_ep as $entry) { - $this->endpoints[$entry['endpointName']] = $entry; - } - - if (count($this->endpoints) > 0) { - $this->currentTest = $base; - return TRUE; - } - return FALSE; - } - - /** - * getResults - * retrieve results from the database, stuff them into the endpoint array - * - * @access private - */ - function getResults($test = 'base', $type = 'php', $wsdl = 0) { - // be sure we have the right endpoints for this test result - $this->getEndpoints($test); - - // retrieve the results and put them into the endpoint info - $sql = "select * from results where class='$test' and type='$type' and wsdl=$wsdl"; - $results = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC ); - foreach ($results as $result) { - // find the endpoint - foreach ($this->endpoints as $epn => $epi) { - if ($epi['id'] == $result['endpoint']) { - // store the info - $this->endpoints[$epn]['methods'][$result['function']] = $result; - break; - } - } - } - } - - /** - * saveResults - * save the results of a method test into the database - * - * @access private - */ - function _saveResults($endpoint_id, &$soap_test) { - if ($this->nosave) return; - - $result = $soap_test->result; - $wire = $result['wire']; - if ($result['success']) { - $success = 'OK'; - $error = ''; - } else { - $success = $result['fault']->faultcode; - $pos = strpos($success,':'); - if ($pos !== false) { - $success = substr($success,$pos+1); - } - $error = $result['fault']->faultstring; - if (!$wire) $wire= $result['fault']->detail; - } - - $test_name = $soap_test->test_name; - - $sql = "delete from results where endpoint=$endpoint_id ". - "and class='$this->currentTest' and type='$this->paramType' ". - "and wsdl=$this->useWSDL and function=". - $this->dbc->quote($test_name); - #echo "\n".$sql; - $res = $this->dbc->query($sql); - if (DB::isError($res)) { - die ($res->getMessage()); - } - if (is_object($res)) $res->free(); - - $sql = "insert into results (endpoint,stamp,class,type,wsdl,function,result,error,wire) ". - "values($endpoint_id,".time().",'$this->currentTest',". - "'$this->paramType',$this->useWSDL,". - $this->dbc->quote($test_name).",". - $this->dbc->quote($success).",". - $this->dbc->quote($error).",". - ($wire?$this->dbc->quote($wire):"''").")"; - #echo "\n".$sql; - $res = $this->dbc->query($sql); - - if (DB::isError($res)) { - die ($res->getMessage()); - } - if (is_object($res)) $res->free(); - } - - /** - * decodeSoapval - * decodes a soap value to php type, used for test result comparisons - * - * @param SOAP_Value soapval - * @return mixed result - * @access public - */ - function decodeSoapval($soapval) - { - if (gettype($soapval) == "object" && - (strcasecmp(get_class($soapval),"SoapParam") == 0 || - strcasecmp(get_class($soapval),"SoapVar") == 0)) { - if (strcasecmp(get_class($soapval),"SoapParam") == 0) - $val = $soapval->param_data->enc_value; - else - $val = $soapval->enc_value; - } else { - $val = $soapval; - } - if (is_array($val)) { - foreach($val as $k => $v) { - if (gettype($v) == "object" && - (strcasecmp(get_class($soapval),"SoapParam") == 0 || - strcasecmp(get_class($soapval),"SoapVar") == 0)) { - $val[$k] = $this->decodeSoapval($v); - } - } - } - return $val; - } - - /** - * compareResult - * compare two php types for a match - * - * @param string expect - * @param string test_result - * @return boolean result - * @access public - */ - function compareResult($expect, $result, $type = NULL) - { - return compare($expect, $result); - } - - - /** - * doEndpointMethod - * run a method on an endpoint and store it's results to the database - * - * @param array endpoint_info - * @param SOAP_Test test - * @return boolean result - * @access public - */ - function doEndpointMethod(&$endpoint_info, &$soap_test) { - $ok = FALSE; - - // prepare a holder for the test results - $soap_test->result['class'] = $this->currentTest; - $soap_test->result['type'] = $this->paramType; - $soap_test->result['wsdl'] = $this->useWSDL; - - if ($this->useWSDL) { - if (array_key_exists('wsdlURL',$endpoint_info)) { - if (!array_key_exists('client',$endpoint_info)) { - try { - $endpoint_info['client'] = new SoapClient($endpoint_info['wsdlURL'], array("trace"=>1)); - } catch (SoapFault $ex) { - $endpoint_info['client']->wsdl->fault = $ex; - } - } - $soap =& $endpoint_info['client']; - - # XXX how do we determine a failure on retrieving/parsing wsdl? - if ($soap->wsdl->fault) { - $fault = $soap->wsdl->fault; - $soap_test->setResult(0,'WSDL', - $fault->faultstring."\n\n".$fault->detail, - $fault->faultstring, - $fault - ); - return FALSE; - } - } else { - $fault = new SoapFault('WSDL',"no WSDL defined for $endpoint"); - $soap_test->setResult(0,'WSDL', - $fault->faultstring, - $fault->faultstring, - $fault - ); - return FALSE; - } - $namespace = false; - $soapaction = false; - } else { - $namespace = $soapaction = 'http://soapinterop.org/'; - // hack to make tests work with MS SoapToolkit - // it's the only one that uses this soapaction, and breaks if - // it isn't right. Can't wait for soapaction to be fully deprecated - if ($this->currentTest == 'base' && - strstr($endpoint_info['endpointName'],'MS SOAP ToolKit 2.0')) { - $soapaction = 'urn:soapinterop'; - } - if (!array_key_exists('client',$endpoint_info)) { - $endpoint_info['client'] = new SoapClient(null,array('location'=>$endpoint_info['endpointURL'],'uri'=>$soapaction,'trace'=>1)); - } - $soap = $endpoint_info['client']; - } -// // add headers to the test -// if ($soap_test->headers) { -// // $header is already a SOAP_Header class -// foreach ($soap_test->headers as $header) { -// $soap->addHeader($header); -// } -// } - // XXX no way to set encoding - // this lets us set UTF-8, US-ASCII or other - //$soap->setEncoding($soap_test->encoding); -try { - if ($this->useWSDL && !$soap_test->headers && !$soap_test->headers_expect) { - $args = ''; - foreach ($soap_test->method_params as $pname => $param) { - $arg = '$soap_test->method_params["'.$pname.'"]'; - $args .= $args?','.$arg:$arg; - } - $return = eval('return $soap->'.$soap_test->method_name.'('.$args.');'); - } else { - if ($soap_test->headers || $soap_test->headers_expect) { - $return = $soap->__soapCall($soap_test->method_name,$soap_test->method_params,array('soapaction'=>$soapaction,'uri'=>$namespace), $soap_test->headers, $result_headers); - } else { - $return = $soap->__soapCall($soap_test->method_name,$soap_test->method_params,array('soapaction'=>$soapaction,'uri'=>$namespace)); - } - } -} catch (SoapFault $ex) { - $return = $ex; -} - - if(!is_soap_fault($return)){ - if ($soap_test->expect !== NULL) { - $sent = $soap_test->expect; - } else if (is_array($soap_test->method_params) && count($soap_test->method_params) == 1) { - reset($soap_test->method_params); - $sent = current($soap_test->method_params); - } else if (is_array($soap_test->method_params) && count($soap_test->method_params) == 0) { - $sent = null; - } else { - $sent = $soap_test->method_params; - } - - // compare header results - $headers_ok = TRUE; - if ($soap_test->headers || $soap_test->headers_expect) { - $headers_ok = $this->compareResult($soap_test->headers_expect, $result_headers); - } - - # we need to decode what we sent so we can compare! - $sent_d = $this->decodeSoapval($sent); - - $soap_test->result['sent'] = $sent; - $soap_test->result['return'] = $return; - - // compare the results with what we sent - - if ($soap_test->cmp_func !== NULL) { - $cmp_func = $soap_test->cmp_func; - $ok = $cmp_func($sent_d,$return); - } else { - $ok = $this->compareResult($sent_d,$return, $sent->type); - if (!$ok && $soap_test->expect) { - $ok = $this->compareResult($soap_test->expect,$return); - } - } - - // save the wire - $wire = "REQUEST:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastrequest()))."\n\n". - "RESPONSE:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastresponse()))."\n\n". - "EXPECTED:\n".var_dump_str($sent_d)."\n". - "RESULTL:\n".var_dump_str($return); - if ($soap_test->headers_expect) { - $wire .= "\nEXPECTED HEADERS:\n".var_dump_str($soap_test->headers_expect)."\n". - "RESULT HEADERS:\n".var_dump_str($result_headers); - } - #print "Wire:".htmlentities($wire); - - if($ok){ - if (!$headers_ok) { - $fault = new SoapFault('HEADER','The returned result did not match what we expected to receive'); - $soap_test->setResult(0,$fault->faultcode, - $wire, - $fault->faultstring, - $fault - ); - } else { - $soap_test->setResult(1,'OK',$wire); - $success = TRUE; - } - } else { - $fault = new SoapFault('RESULT','The returned result did not match what we expected to receive'); - $soap_test->setResult(0,$fault->faultcode, - $wire, - $fault->faultstring, - $fault - ); - } - } else { - $fault = $return; - if ($soap_test->expect_fault) { - $ok = 1; - $res = 'OK'; - } else { - $ok = 0; - $res =$fault->faultcode; - $pos = strpos($res,':'); - if ($pos !== false) { - $res = substr($res,$pos+1); - } - } - // save the wire - $wire = "REQUEST:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastrequest()))."\n\n". - "RESPONSE:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastresponse()))."\n". - "RESULTL:\n".var_dump_str($return); - #print "Wire:".htmlentities($wire); - - $soap_test->setResult($ok,$res, $wire,$fault->faultstring, $fault); - - } - return $ok; - } - - - /** - * doTest - * run a single round of tests - * - * @access public - */ - function doTest() { - global $soap_tests; - // get endpoints for this test - $this->getEndpoints($this->currentTest); - #clear totals - $this->totals = array(); - - $i = 0; - foreach($this->endpoints as $endpoint => $endpoint_info){ - - // if we specify an endpoint, skip until we find it - if ($this->specificEndpoint && $endpoint != $this->specificEndpoint) continue; - if ($this->useWSDL && !$endpoint_info['endpointURL']) continue; - - $skipendpoint = FALSE; - $this->totals['servers']++; - #$endpoint_info['tests'] = array(); - - if ($this->show) { - print "Processing $endpoint at {$endpoint_info['endpointURL']}"; - if ($this->html) print "
\n"; else print "\n"; - } - - foreach($soap_tests[$this->currentTest] as $soap_test) { - //foreach(array_keys($method_params[$this->currentTest][$this->paramType]) as $method) - - // only run the type of test we're looking for (php or soapval) - if ($soap_test->type != $this->paramType) continue; - - // if we haven't reached our startpoint, skip - if ($this->startAt && $this->startAt != $endpoint_info['endpointName']) continue; - $this->startAt = ''; - - // if this is in our skip list, skip it - if (in_array($endpoint, $this->skipEndpointList)) { - $skipendpoint = TRUE; - $skipfault = new SoapFault('SKIP','endpoint skipped'); - $soap_test->setResult(0,$fault->faultcode, '', - $skipfault->faultstring, - $skipfault - ); - #$endpoint_info['tests'][] = &$soap_test; - #$soap_test->showTestResult($this->debug, $this->html); - #$this->_saveResults($endpoint_info['id'], $soap_test->method_name); - $soap_test->result = NULL; - continue; - } - - // if we're looking for a specific method, skip unless we have it - if ($this->testMethod && strcmp($this->testMethod,$soap_test->test_name) != 0) continue; - - // if we are skipping the rest of the tests (due to error) note a fault - if ($skipendpoint) { - $soap_test->setResult(0,$fault->faultcode, '', - $skipfault->faultstring, - $skipfault - ); - #$endpoint_info['tests'][] = &$soap_test; - $this->totals['fail']++; - } else { - // run the endpoint test - if ($this->doEndpointMethod($endpoint_info, $soap_test)) { - $this->totals['success']++; - } else { - $skipendpoint = $soap_test->result['fault']->faultcode=='HTTP' - && strstr($soap_test->result['fault']->faultstring,'Connect Error'); - $skipfault = $soap_test->result['fault']; - $this->totals['fail']++; - } - #$endpoint_info['tests'][] = &$soap_test; - } - $soap_test->showTestResult($this->debug, $this->html); - $this->_saveResults($endpoint_info['id'], $soap_test); - $soap_test->result = NULL; - $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(); - } - } - } - - /** - * doTests - * go all out. This takes time. - * - * @access public - */ - function doTests() { - // the mother of all interop tests - $dowsdl = array(0,1); - foreach($this->tests as $test) { - $this->currentTest = $test; - 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(); - } - } - } - } - - // *********************************************************** - // output functions - - /** - * getResults - * retrieve results from the database, stuff them into the endpoint array - * - * @access private - */ - function getMethodList($test = 'base') { - // retrieve the results and put them into the endpoint info - $sql = "select distinct(function) from results where class='$test' order by function"; - $results = $this->dbc->getAll($sql); - $ar = array(); - foreach($results as $result) { - $ar[] = $result[0]; - } - return $ar; - } - - function outputTable() - { - $methods = $this->getMethodList($this->currentTest); - if (!$methods) return; - $this->getResults($this->currentTest,$this->paramType,$this->useWSDL); - - echo "Testing $this->currentTest "; - if ($this->useWSDL) echo "using WSDL "; - else echo "using Direct calls "; - echo "with $this->paramType values
\n"; - - // calculate totals for this table - $this->totals['success'] = 0; - $this->totals['fail'] = 0; - $this->totals['servers'] = 0; #count($this->endpoints); - foreach ($this->endpoints as $endpoint => $endpoint_info) { - if (count($endpoint_info['methods']) > 0) { - $this->totals['servers']++; - foreach ($methods as $method) { - $r = $endpoint_info['methods'][$method]['result']; - if ($r == 'OK') $this->totals['success']++; - else $this->totals['fail']++; - } - } else { - unset($this->endpoints[$endpoint]); - } - } - $this->totals['calls'] = count($methods) * $this->totals['servers']; - - echo "\n\nServers: {$this->totals['servers']} Calls: {$this->totals['calls']} Success: {$this->totals['success']} Fail: {$this->totals['fail']}
\n"; - - echo "\n"; - echo "\n"; - foreach ($methods as $method) { - $info = split(':', $method); - echo "\n"; - } - echo "\n"; - $faults = array(); - $fi = 0; - foreach ($this->endpoints as $endpoint => $endpoint_info) { - if (array_key_exists('wsdlURL',$endpoint_info)) { - echo "\n"; - } else { - echo "\n"; - } - foreach ($methods as $method) { - $id = $endpoint_info['methods'][$method]['id']; - $r = $endpoint_info['methods'][$method]['result']; - $e = $endpoint_info['methods'][$method]['error']; - if ($e) { - $faults[$fi++] = $e; - } - if ($r) { - echo "\n"; - } else { - echo "\n"; - } - } - echo "\n"; - } - echo "
Endpoint"; - foreach ($info as $m) { - $hi = split(',',$m); - echo ''.$hi[0]."
\n"; - if (count($hi) > 1) { - echo "  Actor=".($hi[1]?'Target':'Not Target')."
\n"; - echo "  MustUnderstand=$hi[2]
\n"; - } - } - echo "
$endpoint
$endpoint$runtested

\n"; - if ($this->showFaults && count($faults) > 0) { - echo "ERROR Details:
\n

\n"; - } - - function outputTables() { - // the mother of all interop tests - $dowsdl = array(0,1); - foreach($this->tests as $test) { - $this->currentTest = $test; - 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->outputTable(); - } - } - } - } - - function showWire($id) { - $results = $this->dbc->getAll("select * from results where id=$id",NULL, DB_FETCHMODE_ASSOC ); - #$wire = preg_replace("/>/",">\n",$results[0]['wire']); - $wire = $results[0]['wire']; - if ($this->html) print "
";
-        echo "\n".HTMLSpecialChars($wire);
-        if ($this->html) print "
"; - print "\n"; - } - -} - -?> diff --git a/ext/soap/interop/client_round2_params.php b/ext/soap/interop/client_round2_params.php deleted file mode 100644 index 504c4cc024..0000000000 --- a/ext/soap/interop/client_round2_params.php +++ /dev/null @@ -1,619 +0,0 @@ - | -// +----------------------------------------------------------------------+ - -define('SOAP_TEST_ACTOR_OTHER','http://some/other/actor'); - -class SOAP_Test { - var $type = 'php'; - var $test_name = NULL; - var $method_name = NULL; - var $method_params = NULL; - var $cmp_func = NULL; - var $expect = NULL; - var $expect_fault = FALSE; - var $headers = NULL; - var $headers_expect = NULL; - var $result = array(); - var $show = 1; - var $debug = 0; - var $encoding = 'UTF-8'; - - function SOAP_Test($methodname, $params, $expect = NULL, $cmp_func = NULL) { - # XXX we have to do this to make php-soap happy with NULL params - if (!$params) $params = array(); - - if (strchr($methodname,'(')) { - preg_match('/(.*)\((.*)\)/',$methodname,$matches); - $this->test_name = $methodname; - $this->method_name = $matches[1]; - } else { - $this->test_name = $this->method_name = $methodname; - } - $this->method_params = $params; - if ($expect !== NULL) { - $this->expect = $expect; - } - if ($cmp_func !== NULL) { - $this->cmp_func = $cmp_func; - } - - // determine test type - if ($params) { - $v = array_values($params); - if (gettype($v[0]) == 'object' && - (get_class($v[0]) == 'SoapVar' || get_class($v[0]) == 'SoapParam')) - $this->type = 'soapval'; - } - } - - function setResult($ok, $result, $wire, $error = '', $fault = NULL) - { - $this->result['success'] = $ok; - $this->result['result'] = $result; - $this->result['error'] = $error; - $this->result['wire'] = $wire; - $this->result['fault'] = $fault; - } - - /** - * showMethodResult - * print simple output about a methods result - * - * @param array endpoint_info - * @param string method - * @access public - */ - function showTestResult($debug = 0, $html = 0) { - // debug output - if ($debug) $this->show = 1; - if ($debug) { - echo str_repeat("-",50).$html?"
\n":"\n"; - } - - echo "testing $this->test_name : "; - - if ($debug) { - print "method params: "; - print_r($this->params); - print "\n"; - } - - $ok = $this->result['success']; - if ($ok) { - if ($html) { - print "SUCCESS\n"; - } else { - print "SUCCESS\n"; - } - } else { - $fault = $this->result['fault']; - if ($fault) { - $res = $fault->faultcode; - $pos = strpos($res,':'); - if ($pos !== false) { - $res = substr($res,$pos+1); - } - if ($html) { - print "FAILED: [$res] {$fault->faultstring}\n"; - } else { - print "FAILED: [$res] {$fault->faultstring}\n"; - } - } else { - if ($html) { - print "FAILED: ".$this->result['result']."\n"; - } else { - print "FAILED: ".$this->result['result']."\n"; - } - } - } - if ($debug) { - if ($html) { - echo "
\n".htmlentities($this->result['wire'])."
\n"; - } else { - echo "\n".htmlentities($this->result['wire'])."\n"; - } - } - } -} - -# XXX I know this isn't quite right, need to deal with this better -function make_2d($x, $y) -{ - for ($_x = 0; $_x < $x; $_x++) { - for ($_y = 0; $_y < $y; $_y++) { - $a[$_x][$_y] = "x{$_x}y{$_y}"; - } - } - return $a; -} - -function soap_value($name, $value, $type, $type_name=NULL, $type_ns=NULL) { - return new SoapParam(new SoapVar($value,$type,$type_name,$type_ns),$name); -} - -class SOAPStruct { - var $varString; - var $varInt; - var $varFloat; - function SOAPStruct($s, $i, $f) { - $this->varString = $s; - $this->varInt = $i; - $this->varFloat = $f; - } -} - -//*********************************************************** -// Base echoString - -$soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => 'hello world!')); -$soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => soap_value('inputString','hello world',XSD_STRING))); -$soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => '')); -$soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => soap_value('inputString','',XSD_STRING))); -$soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => NULL)); -$soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => soap_value('inputString',NULL,XSD_STRING))); -//$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => ">,<,&,\",',0:\x00",1:\x01,2:\x02,3:\x03,4:\x04,5:\x05,6:\x06,7:\x07,8:\x08,9:\x09,10:\x0a,11:\x0b,12:\x0c,13:\x0d,14:\x0e,15:\x0f,16:\x10,17:\x11,18:\x12,19:\x13,20:\x14,21:\x15,22:\x16,23:\x17,24:\x18,25:\x19,26:\x1a,27:\x1b,28:\x1c,29:\x1d,30:\x1e,31:\x1f")); -//$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => soap_value('inputString',">,<,&,\",',0:\x00",1:\x01,2:\x02,3:\x03,4:\x04,5:\x05,6:\x06,7:\x07,8:\x08,9:\x09,10:\x0a,11:\x0b,12:\x0c,13:\x0d,14:\x0e,15:\x0f,16:\x10,17:\x11,18:\x12,19:\x13,20:\x14,21:\x15,22:\x16,23:\x17,24:\x18,25:\x19,26:\x1a,27:\x1b,28:\x1c,29:\x1d,30:\x1e,31:\x1f",XSD_STRING))); -$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => ">,<,&,\",',\\,\n")); -$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => soap_value('inputString',">,<,&,\",',\\,\n",XSD_STRING))); -$test = new SOAP_Test('echoString(utf-8)', array('inputString' => utf8_encode('ỗÈéóÒ₧⅜ỗỸ'))); -$test->encoding = 'UTF-8'; -$soap_tests['base'][] = $test; -$test = new SOAP_Test('echoString(utf-8)', array('inputString' => soap_value('inputString',utf8_encode('ỗÈéóÒ₧⅜ỗỸ'),XSD_STRING))); -$test->encoding = 'UTF-8'; -$soap_tests['base'][] = $test; - -//*********************************************************** -// Base echoStringArray - -$soap_tests['base'][] = new SOAP_Test('echoStringArray', - array('inputStringArray' => array('good','bad'))); -$soap_tests['base'][] = new SOAP_Test('echoStringArray', - array('inputStringArray' => - soap_value('inputStringArray',array('good','bad'),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd"))); - -$soap_tests['base'][] = new SOAP_Test('echoStringArray(one)', - array('inputStringArray' => array('good'))); -$soap_tests['base'][] = new SOAP_Test('echoStringArray(one)', - array('inputStringArray' => - soap_value('inputStringArray',array('good'),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd"))); - -// empty array test -$soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => array())); -$soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => soap_value('inputStringArray',array(),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd"))); - -# XXX NULL Arrays not supported -// null array test -$soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => NULL)); -$soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => soap_value('inputStringArray',NULL,SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd"))); - -//*********************************************************** -// Base echoInteger -$x = new SOAP_Test('echoInteger', array('inputInteger' => 34345)); -$soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => 34345)); -$soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => soap_value('inputInteger',12345,XSD_INT))); - -//*********************************************************** -// Base echoIntegerArray - -$soap_tests['base'][] = new SOAP_Test('echoIntegerArray', array('inputIntegerArray' => array(1,234324324,2))); -$soap_tests['base'][] = new SOAP_Test('echoIntegerArray', - array('inputIntegerArray' => - soap_value('inputIntegerArray', - array(new SoapVar(12345,XSD_INT),new SoapVar(654321,XSD_INT)), - SOAP_ENC_ARRAY,"ArrayOfint","http://soapinterop.org/xsd"))); - -//*********************************************************** -// Base echoFloat - -$soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => 342.23)); -$soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => soap_value('inputFloat',123.45,XSD_FLOAT))); - -//*********************************************************** -// Base echoFloatArray - -$soap_tests['base'][] = new SOAP_Test('echoFloatArray', array('inputFloatArray' => array(1.3223,34.2,325.325))); -$soap_tests['base'][] = new SOAP_Test('echoFloatArray', - array('inputFloatArray' => - soap_value('inputFloatArray', - array(new SoapVar(123.45,XSD_FLOAT),new SoapVar(654.321,XSD_FLOAT)), - SOAP_ENC_ARRAY,"ArrayOffloat","http://soapinterop.org/xsd"))); -//*********************************************************** -// Base echoStruct - -$soapstruct = new SOAPStruct('arg',34,325.325); -# XXX no way to set a namespace!!! -$soapsoapstruct = soap_value('inputStruct',$soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"); -$soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' =>$soapstruct)); -$soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' =>$soapsoapstruct)); - -//*********************************************************** -// Base echoStructArray - -$soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' => array( - $soapstruct,$soapstruct,$soapstruct))); -$soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' => - soap_value('inputStructArray',array( - new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), - new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), - new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd")), - SOAP_ENC_ARRAY,"ArrayOfSOAPStruct","http://soapinterop.org/xsd"))); - - -//*********************************************************** -// Base echoVoid - -$soap_tests['base'][] = new SOAP_Test('echoVoid', NULL); -$test = new SOAP_Test('echoVoid', NULL); -$test->type = 'soapval'; -$soap_tests['base'][] = $test; - -//*********************************************************** -// Base echoBase64 - -$soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' => 'TmVicmFza2E=')); -$soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' => - soap_value('inputBase64','TmVicmFza2E=',XSD_BASE64BINARY))); - -//*********************************************************** -// Base echoHexBinary - -$soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => '736F61707834'),'736F61707834','hex_compare'); -$soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => - soap_value('inputHexBinary','736F61707834',XSD_HEXBINARY)),'736F61707834','hex_compare'); - -//*********************************************************** -// Base echoDecimal - -# XXX test fails because php-soap incorrectly sets decimal to long rather than float -$soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => '12345.67890')); -$soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => - soap_value('inputDecimal','12345.67890',XSD_DECIMAL))); - -//*********************************************************** -// Base echoDate - -# php-soap doesn't handle datetime types properly yet -$soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => '2001-05-24T17:31:41Z'), null, 'date_compare'); -$soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => - soap_value('inputDate','2001-05-24T17:31:41Z',XSD_DATETIME)), null, 'date_compare'); - -//*********************************************************** -// Base echoBoolean - -# php-soap sends boolean as zero or one, which is ok, but to be explicit, send true or false. -$soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' => TRUE)); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' => - soap_value('inputBoolean',TRUE,XSD_BOOLEAN))); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' => FALSE)); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' => - soap_value('inputBoolean',FALSE,XSD_BOOLEAN))); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' => 1),true); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' => - soap_value('inputBoolean',1,XSD_BOOLEAN)),true); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' => 0),false); -$soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' => - soap_value('inputBoolean',0,XSD_BOOLEAN)),false); - - - -//*********************************************************** -// GROUP B - - -//*********************************************************** -// GroupB echoStructAsSimpleTypes - -$expect = array( - 'outputString'=>'arg', - 'outputInteger'=>34, - 'outputFloat'=>325.325 - ); -$soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes', - array('inputStruct' => (object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325 - )), $expect); -$soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes', - array('inputStruct' => - soap_value('inputStruct', - (object)array('varString' => 'arg', - 'varInt' => 34, - 'varFloat' => 325.325 - ), SOAP_ENC_OBJECT, "SOAPStruct","http://soapinterop.org/xsd")), $expect); - -//*********************************************************** -// GroupB echoSimpleTypesAsStruct - -$expect = - (object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325 - ); -$soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct', - array( - 'inputString'=>'arg', - 'inputInteger'=>34, - 'inputFloat'=>325.325 - ), $expect); -$soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct', - array( - soap_value('inputString','arg', XSD_STRING), - soap_value('inputInteger',34, XSD_INT), - soap_value('inputFloat',325.325, XSD_FLOAT) - ), $expect); - -//*********************************************************** -// GroupB echo2DStringArray - -$soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray', - array('input2DStringArray' => make_2d(3,3))); - -$multidimarray = - soap_value('input2DStringArray', - array( - array('row0col0', 'row0col1', 'row0col2'), - array('row1col0', 'row1col1', 'row1col2') - ), SOAP_ENC_ARRAY - ); -//$multidimarray->options['flatten'] = TRUE; -$soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray', - array('input2DStringArray' => $multidimarray)); - -//*********************************************************** -// GroupB echoNestedStruct - -$strstr = (object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325, - 'varStruct' => (object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325 - )); -$soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct', - array('inputStruct' => $strstr)); -$soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct', - array('inputStruct' => - soap_value('inputStruct', - (object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325, - 'varStruct' => new SoapVar((object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325 - ), SOAP_ENC_OBJECT, "SOAPStruct","http://soapinterop.org/xsd") - ), SOAP_ENC_OBJECT, "SOAPStructStruct","http://soapinterop.org/xsd" - )),$strstr); - -//*********************************************************** -// GroupB echoNestedArray - -$arrstr = (object)array( - 'varString'=>'arg', - 'varInt'=>34, - 'varFloat'=>325.325, - 'varArray' => array('red','blue','green') - ); -$soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray', - array('inputStruct' => $arrstr)); -$soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray', - array('inputStruct' => - soap_value('inputStruct', - (object)array('varString' => 'arg', - 'varInt' => 34, - 'varFloat' => 325.325, - 'varArray' => - new SoapVar(array("red", "blue", "green"), SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd") - ), SOAP_ENC_OBJECT, "SOAPArrayStruct","http://soapinterop.org/xsd" - )),$arrstr); - - -//*********************************************************** -// GROUP C header tests - -//*********************************************************** -// echoMeStringRequest - -// echoMeStringRequest with endpoint as header destination, doesn't have to understand -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=next)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 0, SOAP_ACTOR_NEXT); -$test->headers_expect = array('echoMeStringResponse'=>'hello world'); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=next)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 0, SOAP_ACTOR_NEXT); -$test->headers_expect = array('echoMeStringResponse'=>'hello world'); -$soap_tests['GroupC'][] = $test; - -// echoMeStringRequest with endpoint as header destination, must understand -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=next)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT); -$test->headers_expect = array('echoMeStringResponse'=>'hello world'); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=next)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 1, SOAP_ACTOR_NEXT); -$test->headers_expect = array('echoMeStringResponse'=>'hello world'); -$soap_tests['GroupC'][] = $test; - -// echoMeStringRequest with endpoint NOT header destination, doesn't have to understand -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=other)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 0, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=other)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 0, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -// echoMeStringRequest with endpoint NOT header destination, must understand -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=other)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=other)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world', XSD_STRING), 1, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -// echoMeStringRequest with endpoint header destination, must understand, -// invalid namespace, should receive a fault -$test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL); -$test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT); -$test->headers_expect = array(); -$test->expect_fault = TRUE; -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', new SoapVar('hello world', XSD_STRING), 1, SOAP_ACTOR_NEXT); -$test->headers_expect = array(); -$test->expect_fault = TRUE; -$soap_tests['GroupC'][] = $test; - -//*********************************************************** -// echoMeStructRequest - -// echoMeStructRequest with endpoint as header destination, doesn't have to understand -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=next)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SOAPStruct('arg',34,325.325), 0, SOAP_ACTOR_NEXT); -$test->headers_expect = - array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325)); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=next)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), - 0, SOAP_ACTOR_NEXT); -$test->headers_expect = - array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325)); -$soap_tests['GroupC'][] = $test; - -// echoMeStructRequest with endpoint as header destination, must understand -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=next)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SOAPStruct('arg',34,325.325), 1, SOAP_ACTOR_NEXT); -$test->headers_expect = - array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325)); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=next)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), - 1, SOAP_ACTOR_NEXT); -$test->headers_expect = - array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325)); -$soap_tests['GroupC'][] = $test; - -// echoMeStructRequest with endpoint NOT header destination, doesn't have to understand -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=other)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SOAPStruct('arg',34,325.325), 0, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=other)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), - 0, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -// echoMeStructRequest with endpoint NOT header destination, must understand -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=other)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SOAPStruct('arg',34,325.325), 1, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=other)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest', - new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), - 1, SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -//*********************************************************** -// echoMeUnknown - -// echoMeUnknown with endpoint as header destination, doesn't have to understand -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=next)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',0,SOAP_ACTOR_NEXT); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=next)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),0,SOAP_ACTOR_NEXT); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -// echoMeUnknown with endpoint as header destination, must understand -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=next)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',1,SOAP_ACTOR_NEXT); -$test->headers_expect = array(); -$test->expect_fault = TRUE; -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=next)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),1,SOAP_ACTOR_NEXT); -$test->headers_expect = array(); -$test->expect_fault = TRUE; -$soap_tests['GroupC'][] = $test; - -// echoMeUnknown with endpoint NOT header destination, doesn't have to understand -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=other)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',0,SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=other)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),0,SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -// echoMeUnknown with endpoint NOT header destination, must understand -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=other)', NULL); -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',1,SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; - -$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=other)', NULL); -$test->type = 'soapval'; -$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),1,SOAP_TEST_ACTOR_OTHER); -$test->headers_expect = array(); -$soap_tests['GroupC'][] = $test; -?> diff --git a/ext/soap/interop/client_round2_results.php b/ext/soap/interop/client_round2_results.php deleted file mode 100644 index ff6a58f48c..0000000000 --- a/ext/soap/interop/client_round2_results.php +++ /dev/null @@ -1,73 +0,0 @@ - | -// +----------------------------------------------------------------------+ - -require_once 'client_round2_interop.php'; -?> - - - - - - PHP SOAP Client Interop Test Results - - - -

PHP SOAP Client Interop Test Results: Round2

- -Back to Interop Index
-

 

- -showFaults = 1; - -if ($_GET['wire']) { - $iop->showWire($_GET['wire']); -} else { - $iop->getEndpoints(); - $iop->getResults(); - - if ($_GET['test']) { - $iop->currentTest = $_GET['test']; - $iop->useWSDL = $_GET['wsdl']?$_GET['wsdl']:0; - $iop->paramType = $_GET['type']?$_GET['type']:'php'; - $iop->outputTable(); - } else { - $iop->outputTables(); - } -} -?> - - diff --git a/ext/soap/interop/client_round2_run.php b/ext/soap/interop/client_round2_run.php deleted file mode 100644 index f850448ce9..0000000000 --- a/ext/soap/interop/client_round2_run.php +++ /dev/null @@ -1,50 +0,0 @@ - | -// +----------------------------------------------------------------------+ - -set_time_limit(0); -require_once 'client_round2_interop.php'; - -$iop = new Interop_Client(); -$iop->html = 0; - -// force a fetch of endpoints, this happens regardless if no endpoints in database -$iop->fetchEndpoints(); - -// set some options -$iop->currentTest = 'GroupC'; // see $tests above -$iop->paramType = 'php'; // 'php' or 'soapval' -$iop->useWSDL = 1; // 1= do wsdl tests -$iop->numServers = 0; // 0 = all -//$iop->specificEndpoint = 'PHP ext/soap'; // test only this endpoint -//$iop->testMethod = 'echoString'; // test only this method - -// endpoints to skip -//$iop->skipEndpointList = array('Apache Axis','IONA XMLBus','IONA XMLBus (CORBA)','MS SOAP ToolKit 2.0','MS SOAP ToolKit 3.0','Spheon JSOAP','SQLData SOAP Server','WASP Advanced 3.0'); -$iop->startAt=''; -$iop->nosave = 0; // 1= disable saving results to database -// debug output -$iop->show = 1; -$iop->debug = 0; -$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\n"; - -?> diff --git a/ext/soap/interop/config.php.dist b/ext/soap/interop/config.php.dist deleted file mode 100644 index afdeaf9f6c..0000000000 --- a/ext/soap/interop/config.php.dist +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/ext/soap/interop/database_round2.sql b/ext/soap/interop/database_round2.sql deleted file mode 100644 index 6834b0eeae..0000000000 --- a/ext/soap/interop/database_round2.sql +++ /dev/null @@ -1,44 +0,0 @@ -# phpMyAdmin MySQL-Dump -# version 2.2.5 -# http://phpwizard.net/phpMyAdmin/ -# http://phpmyadmin.sourceforge.net/ (download page) -# -# Host: localhost -# Generation Time: Apr 08, 2002 at 08:32 PM -# Server version: 3.23.49 -# PHP Version: 4.1.1 -# Database : `interop` -# -------------------------------------------------------- - -# -# Table structure for table `endpoints` -# - -CREATE TABLE endpoints ( - id int(11) NOT NULL auto_increment, - endpointName varchar(50) NOT NULL default '', - endpointURL varchar(255) NOT NULL default '', - wsdlURL varchar(255) NOT NULL default '', - class varchar(20) NOT NULL default '', - status int(11) NOT NULL default '1', - PRIMARY KEY (id) -) TYPE=MyISAM; -# -------------------------------------------------------- - -# -# Table structure for table `results` -# - -CREATE TABLE results ( - id int(11) NOT NULL auto_increment, - endpoint int(11) NOT NULL default '0', - stamp int(11) NOT NULL default '0', - class varchar(10) NOT NULL default '', - type varchar(10) default NULL, - wsdl int(11) NOT NULL default '0', - function varchar(255) NOT NULL default '', - result varchar(25) NOT NULL default '', - error text, - wire text NOT NULL, - PRIMARY KEY (id) -) TYPE=MyISAM; diff --git a/ext/soap/interop/echoheadersvc.wsdl.php b/ext/soap/interop/echoheadersvc.wsdl.php deleted file mode 100644 index e7070242a3..0000000000 --- a/ext/soap/interop/echoheadersvc.wsdl.php +++ /dev/null @@ -1,398 +0,0 @@ -'; -echo "\n"; -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /server_round2_groupC.php"/> - - - - diff --git a/ext/soap/interop/index.php b/ext/soap/interop/index.php deleted file mode 100644 index fc12bc8cb7..0000000000 --- a/ext/soap/interop/index.php +++ /dev/null @@ -1,59 +0,0 @@ - - - - - PHP SOAP Interop - - - - -

PHP SOAP Interop

-

Welcome to the PHP SOAP Interop pages. These pages are set up for -SOAP Builder interop tests. You can find out more about the interop tests -at White Mesa.

-

Currently Round 2 base, Group B and Group C interop tests are enabled.

- -

Round 2 Interop Server

-Base WSDL:
-Group B WSDL:
-Group C WSDL:
- -

Interop Client

- -

Notes: Tests are done both "Direct" and with "WSDL". WSDL tests use the supplied interop WSDL -to run the tests against. The Direct method uses an internal prebuilt list of methods and parameters -for the test.

-

Tests are also run against two methods of generating method parameters. The first, 'php', attempts -to directly serialize PHP variables into soap values. The second method, 'soapval', uses a SoapParam and SoapVar -classes to define what the type of the value is.

- -

Client Test Interface

-

The client interface allows you to run the PHP SOAP -Client against a chosen interop server. Each run updates the results database below.

- -

Interop Client Test Results

-

This is a database of the current test results using PHP SOAP Clients against interop servers.

-

More detail (wire) about errors (marked yellow or red) can be obtained by clicking on the -link in the result box. If we have an HTTP error -attempting to connect to the endpoint, we will mark all consecutive attempts as errors, and skip -testing that endpoint. This reduces the time it takes to run the tests if a server is unavailable.

- - - diff --git a/ext/soap/interop/interop.wsdl.php b/ext/soap/interop/interop.wsdl.php deleted file mode 100644 index 6ed2d17d66..0000000000 --- a/ext/soap/interop/interop.wsdl.php +++ /dev/null @@ -1,336 +0,0 @@ -'; -echo "\n"; -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /server_round2_base.php"/> - - - - diff --git a/ext/soap/interop/interopB.wsdl.php b/ext/soap/interop/interopB.wsdl.php deleted file mode 100644 index 3113b1c2fe..0000000000 --- a/ext/soap/interop/interopB.wsdl.php +++ /dev/null @@ -1,196 +0,0 @@ -'; -echo "\n"; -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /server_round2_groupB.php"/> - - - - diff --git a/ext/soap/interop/server_round2_base.php b/ext/soap/interop/server_round2_base.php deleted file mode 100644 index 0eaedd8ec1..0000000000 --- a/ext/soap/interop/server_round2_base.php +++ /dev/null @@ -1,102 +0,0 @@ - Port to PEAR and more | -// | Authors: Dietrich Ayala Original Author | -// +----------------------------------------------------------------------+ - -class SOAP_Interop_Base { - - function echoString($inputString) - { - return $inputString; - } - - function echoStringArray($inputStringArray) - { - return $inputStringArray; - } - - - function echoInteger($inputInteger) - { - return $inputInteger; - } - - function echoIntegerArray($inputIntegerArray) - { - return $inputIntegerArray; - } - - function echoFloat($inputFloat) - { - return $inputFloat; - } - - function echoFloatArray($inputFloatArray) - { - return $inputFloatArray; - } - - function echoStruct($inputStruct) - { - return $inputStruct; - } - - function echoStructArray($inputStructArray) - { - return $inputStructArray; - } - - function echoVoid() - { - return NULL; - } - - function echoBase64($b_encoded) - { - return $b_encoded; - } - - function echoDate($timeInstant) - { - return $timeInstant; - } - - function echoHexBinary($hb) - { - return $hb; - } - - function echoDecimal($dec) - { - return $dec; - } - - function echoBoolean($boolean) - { - return $boolean; - } - - function echoMimeAttachment($stuff) - { - return new SOAP_Attachment('return','application/octet-stream',NULL,$stuff); - } -} - -$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php"); -$server->setClass("SOAP_Interop_Base"); -$server->handle(); -?> diff --git a/ext/soap/interop/server_round2_groupB.php b/ext/soap/interop/server_round2_groupB.php deleted file mode 100644 index fd6bc66fbd..0000000000 --- a/ext/soap/interop/server_round2_groupB.php +++ /dev/null @@ -1,55 +0,0 @@ - Port to PEAR and more | -// | Authors: Dietrich Ayala Original Author | -// +----------------------------------------------------------------------+ - -class SOAP_Interop_GroupB { - - function echoStructAsSimpleTypes ($struct) - { - return array('outputString' => $struct->varString, - 'outputInteger' => $struct->varInt, - 'outputFloat' => $struct->varFloat); - } - - function echoSimpleTypesAsStruct($string, $int, $float) - { - return (object)array("varString" => $string, - "varInt" => $int, - "varFloat" => $float); - } - - function echoNestedStruct($struct) - { - return $struct; - } - - function echo2DStringArray($ary) - { - return $ary; - } - - function echoNestedArray($ary) - { - return $ary; - } -} - -$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php"); -$server->setClass("SOAP_Interop_GroupB"); -$server->handle(); -?> diff --git a/ext/soap/interop/server_round2_groupC.php b/ext/soap/interop/server_round2_groupC.php deleted file mode 100644 index 785174ebcf..0000000000 --- a/ext/soap/interop/server_round2_groupC.php +++ /dev/null @@ -1,40 +0,0 @@ - | -// +----------------------------------------------------------------------+ - -class SOAP_Interop_GroupC { - var $method_namespace = 'http://soapinterop.org/echoheader/'; - - function echoMeStringRequest($string) - { - return new SoapHeader($this->method_namespace, "echoMeStringResponse", $string); - } - - function echoMeStructRequest($struct) - { - return new SoapHeader($this->method_namespace, "echoMeStructResponse", $struct); - } - - function echoVoid() - { - } -} - -$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/echoheadersvc.wsdl.php"); -$server->setClass("SOAP_Interop_GroupC"); -$server->handle(); -?> diff --git a/ext/soap/interop/test.utility.php b/ext/soap/interop/test.utility.php deleted file mode 100644 index 5b1f699c9b..0000000000 --- a/ext/soap/interop/test.utility.php +++ /dev/null @@ -1,143 +0,0 @@ -compare($e1, $e2) == 0; - $oj = false; - } - return $ok || $e1 == $e2 || strcasecmp(trim($e1), trim($e2)) == 0; -} - -function array_compare(&$ar1, &$ar2) { - if (gettype($ar1) != 'array' || gettype($ar2) != 'array') return FALSE; - if (count($ar1) != count($ar2)) return FALSE; - foreach ($ar1 as $k => $v) { - if (!array_key_exists($k,$ar2)) return FALSE; - if (!compare($v,$ar2[$k])) return FALSE; - } - return TRUE; -} - -function object_compare(&$obj1, &$obj2) { - if (gettype($obj1) != 'object' || gettype($obj2) != 'object') return FALSE; -// if (class_name(obj1) != class_name(obj2)) return FALSE; - $ar1 = (array)$obj1; - $ar2 = (array)$obj2; - return array_compare($ar1,$ar2); -} - -function compare(&$x,&$y) { - $ok = 0; - $x_type = gettype($x); - $y_type = gettype($y); - if ($x_type == $y_type) { - if ($x_type == "array") { - $ok = array_compare($x, $y); - } else if ($x_type == "object") { - $ok = object_compare($x, $y); - } else if ($x_type == "double") { - $ok = number_compare($x, $y); -// } else if ($x_type == 'boolean') { -// $ok = boolean_compare($x, $y); - } else { - $ok = ($x == $y); -// $ok = string_compare($expect, $result); - } - } - return $ok; -} - - -function parseMessage($msg) -{ - # strip line endings - #$msg = preg_replace('/\r|\n/', ' ', $msg); - $response = new SOAP_Parser($msg); - if ($response->fault) { - return $response->fault->getFault(); - } - $return = $response->getResponse(); - $v = $response->decode($return); - if (gettype($v) == 'array' && count($v)==1) { - return array_shift($v); - } - return $v; -} - -function var_dump_str($var) { - ob_start(); - var_dump($var); - $res = ob_get_contents(); - ob_end_clean(); - return $res; -} - -?> \ No newline at end of file -- 2.50.0