cvs: pear /SOAP/interop client_library.php client_params.php client_round2.php client_round2_base.php client_round2_interop.php
client_round2_params.php client_round2_pretty.php client_round2_results.php database_round2.sql endpoints_generate.php interop.php readme.txt
server_round2.php server_round2_base.php server_round2_groupB.php server_round2_groupC.php server_round2_test.php server_soapinterop_base.php
server_soapinterop_groupB.php
| From: | Shane Caraveo | Date: | Sat, 30 Mar 2002 22:57:56 +0000 |
| Subject: | cvs: pear /SOAP/interop client_library.php client_params.php client_round2.php client_round2_base.php client_round2_interop.php client_round2_params.php client_round2_pretty.php client_round2_results.php database_round2.sql endpoints_generate.php interop.php readme.txt server_round2.php server_round2_base.php server_round2_groupB.php server_round2_groupC.php server_round2_test.php server_soapinterop_base.php server_soapinterop_groupB.php |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-2916@lists.php.net to get a copy of this message | ||
shane Sat Mar 30 17:57:56 2002 EDT
Added files:
/pear/SOAP/interop client_round2.php client_round2_interop.php
client_round2_params.php
client_round2_results.php database_round2.sql
readme.txt server_round2.php
server_round2_base.php server_round2_groupB.php
server_round2_groupC.php server_round2_test.php
Removed files:
/pear/SOAP/interop client_library.php client_params.php
client_round2_base.php client_round2_pretty.php
endpoints_generate.php interop.php
server_soapinterop_base.php
server_soapinterop_groupB.php
Log:
A completely rewritten interop test harness for round2 tests.
- includes GroupC SOAP Header tests
- requires sql database for storing test results
- client_round2_results.php produces nice html table output for results
Index: pear/SOAP/interop/client_round2.php +++ pear/SOAP/interop/client_round2.php <?php // this script is usefull for quickly testing stuff, use the 'pretty' file for html output // // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id: client_round2.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // set_time_limit(0); require_once 'SOAP/interop/client_round2_interop.php'; $iop = new Interop_Client(); // force a fetch of endpoints, this happens irregardless if no endpoints in database #$iop->fetchEndpoints(); // set some options $iop->currentTest = 'GroupB'; // see $tests above $iop->paramType = 'soapval'; // 'php' or 'soapval' $iop->useWSDL = 1; // 1= do wsdl tests $iop->numServers = 0; // 0 = all $iop->specificEndpoint = ''; // test only this endpoint $iop->testMethod = ''; // test only this method $iop->skipEndpointList = array(); // endpoints to skip $this->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->doTests(); // run all tests, ignore above options #$iop->outputTables(); echo "done"; ?> Index: pear/SOAP/interop/client_round2_interop.php +++ pear/SOAP/interop/client_round2_interop.php <?php // // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id: client_round2_interop.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'DB.php'; // PEAR/DB require_once 'SOAP/Client.php'; require_once 'SOAP/interop/client_round2_params.php'; require_once 'SOAP/test/test.utility.php'; error_reporting(E_ALL ^ E_NOTICE); class Interop_Client { // database DNS var $DSN = 'mysql://user@localhost/interop'; // our central interop server, where we can get the list of endpoints var $interopServer = "http://www.whitemesa.net/interopInfo"; // our local endpoint, will always get added to the database for all tests var $localEndpoint = array( 'endpointName'=>'localhost', 'endpointURL'=>'http://localhost/soap/server_round2.php', 'wsdlURL'=>'http://localhost/soap/server_round2?wsdl' ); // 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; // 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(); function Interop_Client() { // 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; } } function _fetchEndpoints(&$soapclient, $test) { $this->_getEndpoints($test, 1); // retreive endpoints from the endpoint server $endpointArray = $soapclient->call("GetEndpointInfo",array("groupName"=>$test),"http://soapinterop.org/info/","http://soapinterop.org/info/"); if (PEAR::isError($endpointArray)) { print_r($endpointArray); return; } // add our local endpoint if ($this->localEndpoint) { array_push($endpointArray, $this->localEndpoint); } if (!$endpointArray) return; // reset the status to zero $this->dbc->query("update endpoints set status = 0 where type='$test'"); // save new endpoints into database foreach($endpointArray as $k => $v){ if (array_key_exists($v['endpointName'],$endpointArray)) { $this->dbc->query("update endpoints set endpointURL='{$v['endpointURL']}', wsdlURL='{$v['wsdlURL']}', status=1 where id={$this->endpoints[$v['endpointName']]['id']}"); } else { $this->dbc->query("insert into endpoints (endpointName,endpointURL,wsdlURL,class) values('{$v['endpointName']}','{$v['endpointURL']}','{$v['wsdlURL']}','$test')"); } } } /** * fetchEndpoints * retreive endpoints interop server * * @return boolean result * @access private */ function fetchEndpoints($test = NULL) { // fetch from the interop server $soapclient = new SOAP_Client($this->interopServer); if ($test) { $this->_fetchEndpoints($soapclient, $test); } else { foreach ($this->tests as $test) { $this->_fetchEndpoints($soapclient, $test); } $test = 'base'; } // retreive all endpoints now $this->currentTest = $test; return $this->_getEndpoints($test); } /** * getEndpoints * retreive 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 * retreive 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"; $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 * retreive 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); // retreive 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']; $error = $result['fault']['faultstring']; if (!$wire) $wire= $result['fault']['faultdetail']; } $test_name = $soap_test->method_name; // add header info to the test name if ($soap_test->headers) { foreach ($soap_test->headers as $h) { $destination = 0; if (get_class($h) == 'soap_header') { if ($h->actor == 'http://schemas.xmlsoap.org/soap/actor/next') $destination = 1; $test_name .= ":{$h->name},$destination,{$h->mustunderstand}"; } else { if (!$h[4] || $h[4] == 'http://schemas.xmlsoap.org/soap/actor/next') $destination = 1; if (!$h[3]) $h[3] = 0; $test_name .= ":$h[0],$destination,".(int)$h[3]; } } } $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; $this->dbc->query($sql); $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; $r = $this->dbc->query($sql); if (DB::isError($r)) { print $sql; die ($r->getMessage()); } } /** * decodeSoapval * decodes a soap value to php type, used for test result comparisions * * @param SOAP_Value soapval * @return mixed result * @access public */ function decodeSoapval($soapval) { if (gettype($soapval) == "object" && (strcasecmp(get_class($soapval),"SOAP_Value") == 0 || strcasecmp(get_class($soapval),"SOAP_Header") == 0)) { $val = $soapval->decode(); } else { $val = $soapval; } if (is_array($val)) { foreach($val as $k => $v) { if (gettype($v) == "object" && (strcasecmp(get_class($soapval),"SOAP_Value") == 0 || strcasecmp(get_class($soapval),"SOAP_Header") == 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) { $ok = 0; $expect_type = gettype($expect); $result_type = gettype($result); if ($expect_type == "array" && $result_type == "array") { # compare arrays $ok = array_compare($expect, $result); } else { $ok = string_compare($expect, $result); } return $ok; } /** * 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)) { $endpoint_info['client'] = new SOAP_Client($endpoint_info['wsdlURL'],1); } $soap = $endpoint_info['client']; if ($soap->wsdl->fault) { $fault = $soap->wsdl->fault->getFault(); $soap_test->setResult(0,'WSDL', $fault['faultstring']."\n\n".$fault['faultdetail'], $fault['faultstring'], $fault ); return FALSE; } } else { $fault = array( 'faultcode'=>'WSDL', 'faultstring'=>"no WSDL defined for $endpoint"); $soap_test->setResult(0,'WSDL', $fault['faultstring'], $fault['faultstring'], $fault ); return FALSE; } $namespace = false; $soapaction = false; } else { $soap = new SOAP_Client($endpoint_info['endpointURL']); $namespace = $soapaction = 'http://soapinterop.org/'; } // 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); } } $return = $soap->call($soap_test->method_name,$soap_test->method_params, $namespace, $soapaction); if(!PEAR::isError($return)){ if (is_array($soap_test->method_params) && count($soap_test->method_params) == 1) { $sent = array_shift($soap_test->method_params); } else { $sent = $soap_test->method_params; } // compare header results $header_result = array(); $headers_ok = TRUE; if ($soap_test->headers) { // $header is already a SOAP_Header class foreach ($soap_test->headers as $header) { if (get_class($header) != 'soap_header') { // assume it's an array $header = new SOAP_Header($header[0], NULL, $header[1], $header[2], $header[3], $header[4]); } $expect = $soap_test->headers_expect[$header->name]; $header_result[$header->name] = array(); // XXX need to fix need_result to identify the actor correctly $need_result = $hresult || ($header->actor == 'http://schemas.xmlsoap.org/soap/actor/next' && $header->mustunderstand); if ($expect) { $hresult = $soap->headers[key($expect)]; $ok = !$need_result || $this->compareResult($hresult ,$expect[key($expect)]); } else { $hresult = $soap->headers[$header->name]; $expect = $this->decodeSoapval($header); $ok = !$need_result || $this->compareResult($hresult ,$expect); } $header_result[$header->name]['ok'] = $ok; if (!$ok) $headers_ok = FALSE; } } # we need to decode what we sent so we can compare! $sent = $this->decodeSoapval($sent); $soap_test->result['sent'] = $sent; $soap_test->result['return'] = $return; // compare the results with what we sent $ok = $this->compareResult($sent,$return); if (!$ok && $soap_test->expect) { $ok = $this->compareResult($soap_test->expect,$return); } if($ok){ if (!$headers_ok) { $fault = array('faultcode'=>'HEADER', 'faultstring'=>'The returned result did not match what we expected to receive'); $soap_test->setResult(0,$fault['faultcode'], $soap->wire, $fault['faultstring'], $fault ); } else { $soap_test->setResult(1,'OK',$soap->wire); $success = TRUE; } } else { $fault = array('faultcode'=>'RESULT', 'faultstring'=>'The returned result did not match what we expected to receive'); $soap_test->setResult(0,$fault['faultcode'], $soap->wire, $fault['faultstring'], $fault ); } } else { $fault = $return->getFault(); if ($soap_test->expect_fault) { $ok = 1; $res = 'OK'; } else { $ok = 0; $res =$fault['faultcode']; } $soap_test->setResult($ok,$res, $soap->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; $skipendpoint = FALSE; $this->totals['servers']++; $endpoint_info['tests'] = array(); if ($this->show) print "Processing $endpoint at {$endpoint_info['endpointURL']}<br>\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 this is in our skip list, skip it if (in_array($endpoint, $this->skipEndpointList)) { $skipendpoint = TRUE; $skipfault = array('faultcode'=>'SKIP','faultstring'=>'endpoint skipped'); $soap_test->setResult(0,$fault['faultcode'], '', $skipfault['faultstring'], $skipfault ); $endpoint_info['tests'][] = &$soap_test; $soap_test->showTestResult($this->debug); $this->_saveResults($endpoint_info['id'], $soap_test->method_name); continue; } // if we're looking for a specific method, skip unless we have it if ($this->testMethod && $soap_test->method_name != $this->testMethod) 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->_saveResults($endpoint_info['id'], $soap_test); $this->totals['calls']++; } if ($this->numservers && ++$i >= $this->numservers) break; } } /** * 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) { $this->paramType = $ptype; $this->doTest(); } } } } // *********************************************************** // output functions /** * getResults * retreive results from the database, stuff them into the endpoint array * * @access private */ function getMethodList($test = 'base') { // retreive the results and put them into the endpoint info $sql = "select distinct(function) from results where class='$test'"; $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 "<b>Testing $this->currentTest "; if ($this->useWSDL) echo "using WSDL "; else echo "using Direct calls "; echo "with $this->paramType values</b><br>\n"; // calculate totals for this table $this->totals['success'] = 0; $this->totals['fail'] = 0; $this->totals['servers'] = count($this->endpoints); $this->totals['calls'] = count($methods) * $this->totals['servers']; foreach ($this->endpoints as $endpoint => $endpoint_info) { foreach ($methods as $method) { $r = $endpoint_info['methods'][$method]['result']; if ($r == 'OK') $this->totals['success']++; else $this->totals['fail']++; } } if ($this->totals['fail'] == $this->totals['calls']) { // assume tests have not run, skip outputing table print "No Data Available<br>\n"; return; } echo "\n\n<b>Servers: {$this->totals['servers']} Calls: {$this->totals['calls']} Success: {$this->totals['success']} Fail: {$this->totals['fail']}</b><br>\n"; echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n"; echo "<tr><td class=\"BLANK\">Endpoint</td>\n"; foreach ($methods as $method) { $info = split(':', $method); echo "<td class='BLANK' valign='top'>"; foreach ($info as $m) { $hi = split(',',$m); echo '<b>'.$hi[0]."</b><br>\n"; if (count($hi) > 1) { echo " Actor=".($hi[1]?'Target':'Not Target')."<br>\n"; echo " MustUnderstand=$hi[2]<br>\n"; } } echo "</td>\n"; } echo "</tr>\n"; $faults = array(); $fi = 0; foreach ($this->endpoints as $endpoint => $endpoint_info) { if (array_key_exists('wsdlURL',$endpoint_info)) { echo "<tr><td class=\"BLANK\"><a href=\"{$endpoint_info['wsdlURL']}\">$endpoint</a></td>\n"; } else { echo "<tr><td class=\"BLANK\">$endpoint</td>\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 "<td class='$r'><a href='$PHP_SELF?wire=$id'>$r</a></td>\n"; } else { echo "<td class='untested'>untested</td>\n"; } } echo "</tr>\n"; } echo "</table><br>\n"; if ($this->showFaults && count($faults) > 0) { echo "<b>ERROR Details:</b><br>\n<ul>\n"; # output more error detail foreach ($faults as $fault) { echo '<li>'.HTMLSpecialChars($fault)."</li>\n"; } } echo "</ul><br><br>\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) { $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']; echo "<pre>\n".HTMLSpecialChars($wire)."</pre>\n"; } } ?> Index: pear/SOAP/interop/client_round2_params.php +++ pear/SOAP/interop/client_round2_params.php <?php // // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id: client_round2_params.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/Header.php'; require_once 'SOAP/Value.php'; class SOAP_Test { var $type = 'php'; var $method_name = NULL; var $method_params = NULL; var $expect = NULL; var $expect_fault = FALSE; var $headers = NULL; var $headers_expect = NULL; var $result = array(); var $show = 1; var $debug = 0; function SOAP_Test($methodname, $params, $expect = NULL) { $this->method_name = $methodname; $this->method_params = $params; $this->expect = $expect; // determine test type if ($params) { $v = array_values($params); if (gettype($v[0]) == 'object' && get_class($v[0]) == 'soap_value') $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) { // debug output if ($debug) $this->show = 1; if ($debug) { echo str_repeat("-",50)."<br>\n"; } echo "testing $this->method_name : "; if ($this->headers) { foreach ($this->headers as $h) { if (get_class($h) == 'soap_header') { echo "\n {$h->name},{$h->actor},{$h->mustunderstand} : "; } else { if (!$h[4]) $h[4] = 'http://schemas.xmlsoap.org/soap/actor/next'; if (!$h[3]) $h[3] = 0; echo "\n $h[0],$h[4],$h[3] : "; } } } if ($debug) { print "method params: "; print_r($this->params); print "\n"; } $ok = $this->result['success']; if ($ok) { print "SUCCESS\n"; } else { $fault = $this->result['fault']; if ($fault) { print "FAILED: {$fault['faultcode']} {$fault['faultstring']}\n"; if ($debug) { echo "<pre>\n".$this->result['wire']."</pre>\n"; } } else { print "FAILED: ".$this->result['result']."\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; } //*********************************************************** // Base echoString $soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => 'blah')); $soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => new SOAP_Value('inputString','string','blah'))); //*********************************************************** // Base echoStringArray $soap_tests['base'][] = new SOAP_Test('echoStringArray', array('inputStringArray' => array('good','bad'))); $soap_tests['base'][] = new SOAP_Test('echoStringArray', array('inputStringArray' => new SOAP_Value('inputStringArray','Array', array( #push struct elements into one soap value new SOAP_Value('item','string','good'), new SOAP_Value('item','string','bad') ) ))); //*********************************************************** // Base echoInteger $soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => 34345)); $soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => new SOAP_Value('inputInteger','int',34345))); //*********************************************************** // Base echoIntegerArray $soap_tests['base'][] = new SOAP_Test('echoIntegerArray', array('inputIntegerArray' => array(1,234324324,2))); $soap_tests['base'][] = new SOAP_Test('echoIntegerArray', array('inputIntegerArray' => new SOAP_Value('inputIntegerArray','Array', array( #push struct elements into one soap value new SOAP_Value('item','int',1), new SOAP_Value('item','int',234324324), new SOAP_Value('item','int',2) ) ))); //*********************************************************** // Base echoFloat $soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => 342.23)); $soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => new SOAP_Value('inputFloat','float',342.23))); //*********************************************************** // 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' => new SOAP_Value('inputFloatArray','Array', array( #push struct elements into one soap value new SOAP_Value('nan','float',1.3223), new SOAP_Value('inf','float',34.2), new SOAP_Value('neginf','float',325.325) ) ))); //*********************************************************** // Base echoStruct $soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' => array( 'varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325))); $soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' => new SOAP_Value('inputStruct','Struct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ) ))); //*********************************************************** // Base echoStructArray $soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' => array( array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325), array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325), array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325) ))); $soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' => new SOAP_Value('inputStructArray','Array', array( #push struct elements into one soap value new SOAP_Value('item','SOAPStruct',array( new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) )), new SOAP_Value('item','SOAPStruct',array( new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) )), new SOAP_Value('item','SOAPStruct',array( new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) )) ) ))); //*********************************************************** // Base echoVoid $soap_tests['base'][] = new SOAP_Test('echoVoid', ''); $test = new SOAP_Test('echoVoid', ''); $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' => new SOAP_Value('inputBase64','base64Binary','TmVicmFza2E='))); //*********************************************************** // Base echoHexBinary $soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => '736F61707834')); $soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => new SOAP_Value('inputHexBinary','hexBinary','736F61707834'))); //*********************************************************** // Base echoDecimal $soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => '1234567890')); $soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => new SOAP_Value('inputDecimal','decimal','1234567890'))); //*********************************************************** // Base echoDate $soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => '2001-04-25T13:31:41-0700')); $soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => new SOAP_Value('inputDate','dateTime','2001-04-25T13:31:41-0700'))); //*********************************************************** // Base echoBoolean $soap_tests['base'][] = new SOAP_Test('echoBoolean', array('inputBoolean' => TRUE)); $soap_tests['base'][] = new SOAP_Test('echoBoolean', array('inputBoolean' => new SOAP_Value('inputBoolean','boolean',TRUE))); //*********************************************************** // GROUP B //*********************************************************** // GroupB echoStructAsSimpleTypes $expect = array( 'outputString'=>'arg', 'outputInteger'=>34, 'outputFloat'=>325.325 ); $soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes', array('inputStruct' => array( 'varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325 )), $expect); $soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes', array('inputStruct' => new SOAP_Value('inputStruct','struct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ) )), $expect); //*********************************************************** // GroupB echoSimpleTypesAsStruct $expect = 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( new SOAP_Value('inputString','string','arg'), new SOAP_Value('inputInteger','int',34), new SOAP_Value('inputFloat','float',325.325) ), $expect); //*********************************************************** // GroupB echo2DStringArray $soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray', array('input2DStringArray' => make_2d(3,3))); $soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray', array('input2DStringArray' => new SOAP_Value('input2DStringArray','Array', array( array( new SOAP_Value('item','string','row0col0'), new SOAP_Value('item','string','row0col1'), new SOAP_Value('item','string','row0col2') ), array( new SOAP_Value('item','string','row1col0'), new SOAP_Value('item','string','row1col1'), new SOAP_Value('item','string','row1col2') ) ) ))); //*********************************************************** // GroupB echoNestedStruct $soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct', array('inputStruct' => array( 'varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325, 'varStruct' => array( 'varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325 ) ))); $soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct', array('input2DStringArray' => new SOAP_Value('inputStruct','struct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325), new SOAP_Value('varStruct','SOAPStruct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ) ) ) ))); //*********************************************************** // GroupB echoNestedArray $soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray', array('inputStruct' => array( 'varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325, 'varArray' => array('red','blue','green') ))); $soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray', array('input2DStringArray' => new SOAP_Value('inputStruct','struct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325), new SOAP_Value('varArray','Array', array( #push struct elements into one soap value new SOAP_Value('item','string','red'), new SOAP_Value('item','string','blue'), new SOAP_Value('item','string','green') ) ) ) ))); //*********************************************************** // GROUP C header tests //*********************************************************** // echoMeStringRequest php val tests // echoMeStringRequest with endpoint as header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeStringRequest', 'hello world', 'http://soapinterop.org/echoheader/',0,'http://schemas.xmlsoap.org/soap/actor/next'); $test->headers_expect['echoMeStringRequest'] = array('echoMeStringResponse'=>'hello world'); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint as header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeStringRequest', 'hello world', 'http://soapinterop.org/echoheader/', 1,'http://schemas.xmlsoap.org/soap/actor/next'); $this->type = 'soapval'; // force a soapval version of this test $test->headers_expect['echoMeStringRequest'] = array('echoMeStringResponse'=>'hello world'); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint NOT header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeStringRequest', 'hello world', 'http://soapinterop.org/echoheader/', 0, 'http://some/other/actor'); $test->headers_expect['echoMeStringRequest'] = array(); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint NOT header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeStringRequest', 'hello world', 'http://soapinterop.org/echoheader/', 1, 'http://some/other/actor'); $test->headers_expect['echoMeStringRequest'] = array(); $soap_tests['GroupC'][] = $test; //*********************************************************** // echoMeStringRequest soapval tests // echoMeStringRequest with endpoint as header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStringRequest', 'string', 'hello world', 'http://soapinterop.org/echoheader/'); $test->headers_expect['echoMeStringRequest'] = array('echoMeStringResponse'=>'hello world'); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint as header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStringRequest', 'string', 'hello world', 'http://soapinterop.org/echoheader/', 1); $this->type = 'soapval'; // force a soapval version of this test $test->headers_expect['echoMeStringRequest'] = array('echoMeStringResponse'=>'hello world'); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint NOT header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStringRequest', 'string', 'hello world', 'http://soapinterop.org/echoheader/', 0, 'http://some/other/actor'); $test->headers_expect['echoMeStringRequest'] = array(); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint NOT header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStringRequest', 'string', 'hello world', 'http://soapinterop.org/echoheader/', 1, 'http://some/other/actor'); $test->headers_expect['echoMeStringRequest'] = array(); $soap_tests['GroupC'][] = $test; //*********************************************************** // php val tests // echoMeStructRequest with endpoint as header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeStructRequest', array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325), 'http://soapinterop.org/echoheader/',0,'http://schemas.xmlsoap.org/soap/actor/next'); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> 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', ''); $test->headers[] = array('echoMeStructRequest', array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325), 'http://soapinterop.org/echoheader/', 1,'http://schemas.xmlsoap.org/soap/actor/next'); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> 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', ''); $test->headers[] = array('echoMeStructRequest', array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325), 'http://soapinterop.org/echoheader/', 0, 'http://some/other/actor'); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests['GroupC'][] = $test; // echoMeStructRequest with endpoint NOT header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeStructRequest', array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325), 'http://soapinterop.org/echoheader/', 1, 'http://some/other/actor'); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests['GroupC'][] = $test; //*********************************************************** // soapval tests // echoMeStructRequest with endpoint as header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStructRequest','SOAPStruct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ), 'http://soapinterop.org/echoheader/'); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> 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', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStructRequest','SOAPStruct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ), 'http://soapinterop.org/echoheader/', 1); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> 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', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStructRequest','SOAPStruct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ), 'http://soapinterop.org/echoheader/', 0, 'http://some/other/actor'); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests['GroupC'][] = $test; // echoMeStructRequest with endpoint NOT header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStructRequest','SOAPStruct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ), 'http://soapinterop.org/echoheader/', 1, 'http://some/other/actor'); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests['GroupC'][] = $test; //*********************************************************** // echoMeUnknown php val tests // echoMeUnknown with endpoint as header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeUnknown', 'nobody understands me!', 'http://soapinterop.org/echoheader/',0,'http://schemas.xmlsoap.org/soap/actor/next'); $test->headers_expect['echoMeUnknown'] = array(); $soap_tests['GroupC'][] = $test; // echoMeUnknown with endpoint as header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeUnknown', 'nobody understands me!', 'http://soapinterop.org/echoheader/', 1,'http://schemas.xmlsoap.org/soap/actor/next'); $test->headers_expect['echoMeUnknown'] = 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', ''); $test->headers[] = array('echoMeUnknown', 'nobody understands me!', 'http://soapinterop.org/echoheader/', 0, 'http://some/other/actor'); $test->headers_expect['echoMeUnknown'] = array(); $soap_tests['GroupC'][] = $test; // echoMeUnknown with endpoint NOT header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeUnknown', 'nobody understands me!', 'http://soapinterop.org/echoheader/', 1, 'http://some/other/actor'); $test->headers_expect['echoMeUnknown'] = array(); $soap_tests['GroupC'][] = $test; //*********************************************************** // echoMeUnknown soapval tests // echoMeUnknown with endpoint as header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeUnknown','string','nobody understands me!', 'http://soapinterop.org/echoheader/'); $test->headers_expect['echoMeUnknown'] = array(); $soap_tests['GroupC'][] = $test; // echoMeUnknown with endpoint as header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeUnknown','string','nobody understands me!', 'http://soapinterop.org/echoheader/', 1); $test->headers_expect['echoMeUnknown'] = 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', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeUnknown','string','nobody understands me!', 'http://soapinterop.org/echoheader/', 0, 'http://some/other/actor'); $test->headers_expect['echoMeUnknown'] = array(); $soap_tests['GroupC'][] = $test; // echoMeUnknown with endpoint NOT header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeUnknown','string','nobody understands me!', 'http://soapinterop.org/echoheader/', 1, 'http://some/other/actor'); $test->headers_expect['echoMeUnknown'] = array(); $soap_tests['GroupC'][] = $test; ?> Index: pear/SOAP/interop/client_round2_results.php +++ pear/SOAP/interop/client_round2_results.php <?php // NOTE: do not run this directly under a web server, as it will take a very long // time to execute. Run from a command line or something, and redirect output // to an html file. // // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id: client_round2_results.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/interop/client_round2_interop.php'; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <style> TD { background-color: Red; } TD.BLANK { background-color: White; } TD.OK { background-color: Lime; } TD.RESULT { background-color: Green; } TD.untested { background-color: White; } TD.CONNECT { background-color: Yellow; } TD.TRANSPORT { background-color: Yellow; } TD.WSDL { background-color: Yellow; } TD.WSDLCACHE { background-color: Yellow; } TD.WSDLPARSER { background-color: Yellow; } TD.HTTP { background-color: Yellow; } TD.SMTP { background-color: Yellow; } </style> <title>PEAR-PHP SOAP Interop Tests</title> </head> <body bgcolor="White" text="Black"> <h2 align="center">SOAP Client Interop Test Results: Round2</h2> <p> 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.</p> <p> 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 SOAP_Value class to define what the type of the value is. The second method is more interopable than the first by nature. </p> <p> More detail about errors (marked yellow or red) will follow each table. 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. WSDLCACHE errors mean we cannot retreive the WSDL file specified for the endpoint. </p> <p> More information on Round 2 Interopability is available at <a href="http://www.whitemesa.com/interop.htm">http://www.whitemesa.com/interop.htm</a>. </p> <?php $iop = new Interop_Client(); if ($_GET['detail'] == 1) $iop->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(); } } ?> </body> </html> Index: pear/SOAP/interop/database_round2.sql +++ pear/SOAP/interop/database_round2.sql # phpMyAdmin MySQL-Dump # version 2.2.5 # http://phpwizard.net/phpMyAdmin/ # http://phpmyadmin.sourceforge.net/ (download page) # # Host: localhost # Generation Time: Mar 30, 2002 at 02:39 PM # Server version: 3.23.49 # PHP Version: 4.3.0-dev # 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; Index: pear/SOAP/interop/readme.txt +++ pear/SOAP/interop/readme.txt Round 2 Interop Test files Info at: http://www.whitemesa.com/interop.htm. Requires an SQL database, schema for MySQL is in database_round2.sql. run client_round2.php to store test results. view client_round2_results.php to see test results server_round2.php implements base, GroupB and GroupC interop tests. Index: pear/SOAP/interop/server_round2.php +++ pear/SOAP/interop/server_round2.php <?php // // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id: server_round2.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/Server.php'; $server = new SOAP_Server; require_once 'server_round2_base.php'; require_once 'server_round2_groupB.php'; require_once 'server_round2_groupC.php'; $server->service($HTTP_RAW_POST_DATA); ?> Index: pear/SOAP/interop/server_round2_base.php +++ pear/SOAP/interop/server_round2_base.php <? // // +----------------------------------------------------------------------+ // | 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: server_round2_base.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/Server.php'; function generateFault($short, $long) { $params = array( "faultcode" => "Server", "faultstring" => $short, "detail" => $long ); $faultmsg = new SOAP_Message("Fault",$params,"http://schemas.xmlsoap.org/soap/envelope/"); return $faultmsg; } function hex2bin($data) { $len = strlen($data); return pack("H" . $len, $data); } class SOAP_Interop_Base { function SOAP_Interop_Base() { #if ($server) { # $server->addToMap("echoString",array("string"),array("string")); # $server->addToMap("echoStringArray",array(),array()); # $server->addToMap("echoInteger",array("int"),array("int")); # $server->addToMap("echoIntegerArray",array(),array()); # $server->addToMap("echoFloat",array("float"),array("float")); # $server->addToMap("echoFloatArray",array(),array()); # $server->addToMap("echoStruct",array(),array()); # $server->addToMap("echoStructArray",array(),array()); # $server->addToMap("echoVoid",array(),array()); # $server->addToMap("echoBase64",array("base64Binary"),array("base64Binary")); # $server->addToMap("echoDate",array("dateTime"),array("dateTime")); # $server->addToMap("echoHexBinary",array("hexBinary"),array("hexBinary")); # $server->addToMap("echoDecimal",array("decimal"),array("decimal")); # $server->addToMap("echoBoolean",array("boolean"),array("boolean")); #} } function echoString($inputString) { if (!$inputString) { return generateFault("Empty Input", "No string detected."); } $returnSoapVal = new SOAP_Value("return","string",$inputString); return $returnSoapVal; } function echoStringArray($inputStringArray) { return $inputStringArray; } function echoInteger($inputInteger) { return (integer)$inputInteger; } function echoIntegerArray($inputIntegerArray) { return $inputIntegerArray; } function echoFloat($inputFloat) { return (FLOAT)$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 base64_encode(base64_decode($b_encoded)); } function echoDate($timeInstant) { return $timeInstant; } function echoHexBinary($hb) { return bin2hex(hex2bin($hb)); } function echoDecimal($dec) { return (FLOAT)$dec; } function echoBoolean($boolean) { if($boolean == 1){ return "true"; } return "false"; } } $base = new SOAP_Interop_Base(); $server->addObjectMap($base); ?> Index: pear/SOAP/interop/server_round2_groupB.php +++ pear/SOAP/interop/server_round2_groupB.php <? // // +----------------------------------------------------------------------+ // | 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: server_round2_groupB.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/Server.php'; class SOAP_Interop_GroupB { function SOAP_Interop_GroupB() { # $server->addToMap('echoStructAsSimpleTypes', # array('inputStruct' => 'struct'), # array('outputString' => 'string', 'outputInteger' => 'int', 'outputFloat' => 'float')); # $server->addToMap('echoSimpleTypesAsStruct', # array('outputString' => 'string', 'outputInteger' => 'int', 'outputFloat' => 'float'), # array('return' => 'struct')); # $server->addToMap('echoNestedStruct', array(), array()); # $server->addToMap('echo2DStringArray', array(), array()); # $server->addToMap('echoNestedArray', array(), array()); } function echoStructAsSimpleTypes ($struct) { # convert a SOAPStruct to an array return array_values($struct); } function echoSimpleTypesAsStruct($string, $int, $float) { # convert a input into struct /*$ret = new SOAP_Value("return","struct", array( #push struct elements into one soap value new SOAP_Value("varString","string",$string), new SOAP_Value("varInt","int",$int), new SOAP_Value("varFloat","float",$float) ) );*/ $ret = array( "varString"=>$string, "varInt"=>$int, "varFloat"=>$float ); return $ret; } function echoNestedStruct($struct) { return $struct; } function echo2DStringArray($ary) { return $ary; } function echoNestedArray($ary) { return $ary; } } $groupb = new SOAP_Interop_GroupB(); $server->addObjectMap($groupb); ?> Index: pear/SOAP/interop/server_round2_groupC.php +++ pear/SOAP/interop/server_round2_groupC.php <? // // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id: server_round2_groupC.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/Server.php'; require_once 'SOAP/Header.php'; class SOAP_Interop_GroupC { function echoMeStringRequest($string) { return new SOAP_Value('echoMeStringResponse','string',$string); } function echoMeStructRequest($struct) { return new SOAP_Value('echoMeStructResponse','SOAPStruct',$struct); } } $groupc = new SOAP_Interop_GroupC(); $server->addObjectMap($groupc); ?> Index: pear/SOAP/interop/server_round2_test.php +++ pear/SOAP/interop/server_round2_test.php <?php // // +----------------------------------------------------------------------+ // | 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 | // +----------------------------------------------------------------------+ // // $Id: server_round2_test.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/Server.php'; $server = new SOAP_Server; require_once 'server_round2_base.php'; require_once 'server_round2_groupB.php'; require_once 'server_round2_groupC.php'; $test = '<?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:ns6="http://soapinterop.org/echoheader/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Header> <ns6:echoMeStringRequest xsi:type="xsd:string" SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="0">hello world</ns6:echoMeStringRequest> </SOAP-ENV:Header> <SOAP-ENV:Body> <echoVoid></echoVoid> </SOAP-ENV:Body> </SOAP-ENV:Envelope>'; $test = '<?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:ns6="http://soapinterop.org/echoheader/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Header> <ns6:echoMeStructRequest xsi:type="si:SOAPStruct" SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="1"> <varString xsi:type="xsd:string">arg</varString> <varInt xsi:type="xsd:int">34</varInt> <varFloat xsi:type="xsd:float">325.325</varFloat> </ns6:echoMeStructRequest> </SOAP-ENV:Header> <SOAP-ENV:Body> <echoVoid></echoVoid> </SOAP-ENV:Body> </SOAP-ENV:Envelope> '; $test = '<?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:ns6="http://soapinterop.org/echoheader/" xmlns:ns7="http://soapinterop.org/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns7:echoString> <inputString xsi:type="xsd:string">blah</inputString> </ns7:echoString> </SOAP-ENV:Body> </SOAP-ENV:Envelope> '; $server->service($test, '',TRUE); ?>
Index: pear/SOAP/interop/client_round2.php +++ pear/SOAP/interop/client_round2.php <?php // this script is usefull for quickly testing stuff, use the 'pretty' file for html output // // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id: client_round2.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // set_time_limit(0); require_once 'SOAP/interop/client_round2_interop.php'; $iop = new Interop_Client(); // force a fetch of endpoints, this happens irregardless if no endpoints in database #$iop->fetchEndpoints(); // set some options $iop->currentTest = 'GroupB'; // see $tests above $iop->paramType = 'soapval'; // 'php' or 'soapval' $iop->useWSDL = 1; // 1= do wsdl tests $iop->numServers = 0; // 0 = all $iop->specificEndpoint = ''; // test only this endpoint $iop->testMethod = ''; // test only this method $iop->skipEndpointList = array(); // endpoints to skip $this->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->doTests(); // run all tests, ignore above options #$iop->outputTables(); echo "done"; ?> Index: pear/SOAP/interop/client_round2_interop.php +++ pear/SOAP/interop/client_round2_interop.php <?php // // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id: client_round2_interop.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'DB.php'; // PEAR/DB require_once 'SOAP/Client.php'; require_once 'SOAP/interop/client_round2_params.php'; require_once 'SOAP/test/test.utility.php'; error_reporting(E_ALL ^ E_NOTICE); class Interop_Client { // database DNS var $DSN = 'mysql://user@localhost/interop'; // our central interop server, where we can get the list of endpoints var $interopServer = "http://www.whitemesa.net/interopInfo"; // our local endpoint, will always get added to the database for all tests var $localEndpoint = array( 'endpointName'=>'localhost', 'endpointURL'=>'http://localhost/soap/server_round2.php', 'wsdlURL'=>'http://localhost/soap/server_round2?wsdl' ); // 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; // 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(); function Interop_Client() { // 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; } } function _fetchEndpoints(&$soapclient, $test) { $this->_getEndpoints($test, 1); // retreive endpoints from the endpoint server $endpointArray = $soapclient->call("GetEndpointInfo",array("groupName"=>$test),"http://soapinterop.org/info/","http://soapinterop.org/info/"); if (PEAR::isError($endpointArray)) { print_r($endpointArray); return; } // add our local endpoint if ($this->localEndpoint) { array_push($endpointArray, $this->localEndpoint); } if (!$endpointArray) return; // reset the status to zero $this->dbc->query("update endpoints set status = 0 where type='$test'"); // save new endpoints into database foreach($endpointArray as $k => $v){ if (array_key_exists($v['endpointName'],$endpointArray)) { $this->dbc->query("update endpoints set endpointURL='{$v['endpointURL']}', wsdlURL='{$v['wsdlURL']}', status=1 where id={$this->endpoints[$v['endpointName']]['id']}"); } else { $this->dbc->query("insert into endpoints (endpointName,endpointURL,wsdlURL,class) values('{$v['endpointName']}','{$v['endpointURL']}','{$v['wsdlURL']}','$test')"); } } } /** * fetchEndpoints * retreive endpoints interop server * * @return boolean result * @access private */ function fetchEndpoints($test = NULL) { // fetch from the interop server $soapclient = new SOAP_Client($this->interopServer); if ($test) { $this->_fetchEndpoints($soapclient, $test); } else { foreach ($this->tests as $test) { $this->_fetchEndpoints($soapclient, $test); } $test = 'base'; } // retreive all endpoints now $this->currentTest = $test; return $this->_getEndpoints($test); } /** * getEndpoints * retreive 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 * retreive 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"; $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 * retreive 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); // retreive 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']; $error = $result['fault']['faultstring']; if (!$wire) $wire= $result['fault']['faultdetail']; } $test_name = $soap_test->method_name; // add header info to the test name if ($soap_test->headers) { foreach ($soap_test->headers as $h) { $destination = 0; if (get_class($h) == 'soap_header') { if ($h->actor == 'http://schemas.xmlsoap.org/soap/actor/next') $destination = 1; $test_name .= ":{$h->name},$destination,{$h->mustunderstand}"; } else { if (!$h[4] || $h[4] == 'http://schemas.xmlsoap.org/soap/actor/next') $destination = 1; if (!$h[3]) $h[3] = 0; $test_name .= ":$h[0],$destination,".(int)$h[3]; } } } $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; $this->dbc->query($sql); $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; $r = $this->dbc->query($sql); if (DB::isError($r)) { print $sql; die ($r->getMessage()); } } /** * decodeSoapval * decodes a soap value to php type, used for test result comparisions * * @param SOAP_Value soapval * @return mixed result * @access public */ function decodeSoapval($soapval) { if (gettype($soapval) == "object" && (strcasecmp(get_class($soapval),"SOAP_Value") == 0 || strcasecmp(get_class($soapval),"SOAP_Header") == 0)) { $val = $soapval->decode(); } else { $val = $soapval; } if (is_array($val)) { foreach($val as $k => $v) { if (gettype($v) == "object" && (strcasecmp(get_class($soapval),"SOAP_Value") == 0 || strcasecmp(get_class($soapval),"SOAP_Header") == 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) { $ok = 0; $expect_type = gettype($expect); $result_type = gettype($result); if ($expect_type == "array" && $result_type == "array") { # compare arrays $ok = array_compare($expect, $result); } else { $ok = string_compare($expect, $result); } return $ok; } /** * 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)) { $endpoint_info['client'] = new SOAP_Client($endpoint_info['wsdlURL'],1); } $soap = $endpoint_info['client']; if ($soap->wsdl->fault) { $fault = $soap->wsdl->fault->getFault(); $soap_test->setResult(0,'WSDL', $fault['faultstring']."\n\n".$fault['faultdetail'], $fault['faultstring'], $fault ); return FALSE; } } else { $fault = array( 'faultcode'=>'WSDL', 'faultstring'=>"no WSDL defined for $endpoint"); $soap_test->setResult(0,'WSDL', $fault['faultstring'], $fault['faultstring'], $fault ); return FALSE; } $namespace = false; $soapaction = false; } else { $soap = new SOAP_Client($endpoint_info['endpointURL']); $namespace = $soapaction = 'http://soapinterop.org/'; } // 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); } } $return = $soap->call($soap_test->method_name,$soap_test->method_params, $namespace, $soapaction); if(!PEAR::isError($return)){ if (is_array($soap_test->method_params) && count($soap_test->method_params) == 1) { $sent = array_shift($soap_test->method_params); } else { $sent = $soap_test->method_params; } // compare header results $header_result = array(); $headers_ok = TRUE; if ($soap_test->headers) { // $header is already a SOAP_Header class foreach ($soap_test->headers as $header) { if (get_class($header) != 'soap_header') { // assume it's an array $header = new SOAP_Header($header[0], NULL, $header[1], $header[2], $header[3], $header[4]); } $expect = $soap_test->headers_expect[$header->name]; $header_result[$header->name] = array(); // XXX need to fix need_result to identify the actor correctly $need_result = $hresult || ($header->actor == 'http://schemas.xmlsoap.org/soap/actor/next' && $header->mustunderstand); if ($expect) { $hresult = $soap->headers[key($expect)]; $ok = !$need_result || $this->compareResult($hresult ,$expect[key($expect)]); } else { $hresult = $soap->headers[$header->name]; $expect = $this->decodeSoapval($header); $ok = !$need_result || $this->compareResult($hresult ,$expect); } $header_result[$header->name]['ok'] = $ok; if (!$ok) $headers_ok = FALSE; } } # we need to decode what we sent so we can compare! $sent = $this->decodeSoapval($sent); $soap_test->result['sent'] = $sent; $soap_test->result['return'] = $return; // compare the results with what we sent $ok = $this->compareResult($sent,$return); if (!$ok && $soap_test->expect) { $ok = $this->compareResult($soap_test->expect,$return); } if($ok){ if (!$headers_ok) { $fault = array('faultcode'=>'HEADER', 'faultstring'=>'The returned result did not match what we expected to receive'); $soap_test->setResult(0,$fault['faultcode'], $soap->wire, $fault['faultstring'], $fault ); } else { $soap_test->setResult(1,'OK',$soap->wire); $success = TRUE; } } else { $fault = array('faultcode'=>'RESULT', 'faultstring'=>'The returned result did not match what we expected to receive'); $soap_test->setResult(0,$fault['faultcode'], $soap->wire, $fault['faultstring'], $fault ); } } else { $fault = $return->getFault(); if ($soap_test->expect_fault) { $ok = 1; $res = 'OK'; } else { $ok = 0; $res =$fault['faultcode']; } $soap_test->setResult($ok,$res, $soap->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; $skipendpoint = FALSE; $this->totals['servers']++; $endpoint_info['tests'] = array(); if ($this->show) print "Processing $endpoint at {$endpoint_info['endpointURL']}<br>\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 this is in our skip list, skip it if (in_array($endpoint, $this->skipEndpointList)) { $skipendpoint = TRUE; $skipfault = array('faultcode'=>'SKIP','faultstring'=>'endpoint skipped'); $soap_test->setResult(0,$fault['faultcode'], '', $skipfault['faultstring'], $skipfault ); $endpoint_info['tests'][] = &$soap_test; $soap_test->showTestResult($this->debug); $this->_saveResults($endpoint_info['id'], $soap_test->method_name); continue; } // if we're looking for a specific method, skip unless we have it if ($this->testMethod && $soap_test->method_name != $this->testMethod) 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->_saveResults($endpoint_info['id'], $soap_test); $this->totals['calls']++; } if ($this->numservers && ++$i >= $this->numservers) break; } } /** * 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) { $this->paramType = $ptype; $this->doTest(); } } } } // *********************************************************** // output functions /** * getResults * retreive results from the database, stuff them into the endpoint array * * @access private */ function getMethodList($test = 'base') { // retreive the results and put them into the endpoint info $sql = "select distinct(function) from results where class='$test'"; $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 "<b>Testing $this->currentTest "; if ($this->useWSDL) echo "using WSDL "; else echo "using Direct calls "; echo "with $this->paramType values</b><br>\n"; // calculate totals for this table $this->totals['success'] = 0; $this->totals['fail'] = 0; $this->totals['servers'] = count($this->endpoints); $this->totals['calls'] = count($methods) * $this->totals['servers']; foreach ($this->endpoints as $endpoint => $endpoint_info) { foreach ($methods as $method) { $r = $endpoint_info['methods'][$method]['result']; if ($r == 'OK') $this->totals['success']++; else $this->totals['fail']++; } } if ($this->totals['fail'] == $this->totals['calls']) { // assume tests have not run, skip outputing table print "No Data Available<br>\n"; return; } echo "\n\n<b>Servers: {$this->totals['servers']} Calls: {$this->totals['calls']} Success: {$this->totals['success']} Fail: {$this->totals['fail']}</b><br>\n"; echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n"; echo "<tr><td class=\"BLANK\">Endpoint</td>\n"; foreach ($methods as $method) { $info = split(':', $method); echo "<td class='BLANK' valign='top'>"; foreach ($info as $m) { $hi = split(',',$m); echo '<b>'.$hi[0]."</b><br>\n"; if (count($hi) > 1) { echo " Actor=".($hi[1]?'Target':'Not Target')."<br>\n"; echo " MustUnderstand=$hi[2]<br>\n"; } } echo "</td>\n"; } echo "</tr>\n"; $faults = array(); $fi = 0; foreach ($this->endpoints as $endpoint => $endpoint_info) { if (array_key_exists('wsdlURL',$endpoint_info)) { echo "<tr><td class=\"BLANK\"><a href=\"{$endpoint_info['wsdlURL']}\">$endpoint</a></td>\n"; } else { echo "<tr><td class=\"BLANK\">$endpoint</td>\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 "<td class='$r'><a href='$PHP_SELF?wire=$id'>$r</a></td>\n"; } else { echo "<td class='untested'>untested</td>\n"; } } echo "</tr>\n"; } echo "</table><br>\n"; if ($this->showFaults && count($faults) > 0) { echo "<b>ERROR Details:</b><br>\n<ul>\n"; # output more error detail foreach ($faults as $fault) { echo '<li>'.HTMLSpecialChars($fault)."</li>\n"; } } echo "</ul><br><br>\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) { $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']; echo "<pre>\n".HTMLSpecialChars($wire)."</pre>\n"; } } ?> Index: pear/SOAP/interop/client_round2_params.php +++ pear/SOAP/interop/client_round2_params.php <?php // // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id: client_round2_params.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/Header.php'; require_once 'SOAP/Value.php'; class SOAP_Test { var $type = 'php'; var $method_name = NULL; var $method_params = NULL; var $expect = NULL; var $expect_fault = FALSE; var $headers = NULL; var $headers_expect = NULL; var $result = array(); var $show = 1; var $debug = 0; function SOAP_Test($methodname, $params, $expect = NULL) { $this->method_name = $methodname; $this->method_params = $params; $this->expect = $expect; // determine test type if ($params) { $v = array_values($params); if (gettype($v[0]) == 'object' && get_class($v[0]) == 'soap_value') $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) { // debug output if ($debug) $this->show = 1; if ($debug) { echo str_repeat("-",50)."<br>\n"; } echo "testing $this->method_name : "; if ($this->headers) { foreach ($this->headers as $h) { if (get_class($h) == 'soap_header') { echo "\n {$h->name},{$h->actor},{$h->mustunderstand} : "; } else { if (!$h[4]) $h[4] = 'http://schemas.xmlsoap.org/soap/actor/next'; if (!$h[3]) $h[3] = 0; echo "\n $h[0],$h[4],$h[3] : "; } } } if ($debug) { print "method params: "; print_r($this->params); print "\n"; } $ok = $this->result['success']; if ($ok) { print "SUCCESS\n"; } else { $fault = $this->result['fault']; if ($fault) { print "FAILED: {$fault['faultcode']} {$fault['faultstring']}\n"; if ($debug) { echo "<pre>\n".$this->result['wire']."</pre>\n"; } } else { print "FAILED: ".$this->result['result']."\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; } //*********************************************************** // Base echoString $soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => 'blah')); $soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => new SOAP_Value('inputString','string','blah'))); //*********************************************************** // Base echoStringArray $soap_tests['base'][] = new SOAP_Test('echoStringArray', array('inputStringArray' => array('good','bad'))); $soap_tests['base'][] = new SOAP_Test('echoStringArray', array('inputStringArray' => new SOAP_Value('inputStringArray','Array', array( #push struct elements into one soap value new SOAP_Value('item','string','good'), new SOAP_Value('item','string','bad') ) ))); //*********************************************************** // Base echoInteger $soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => 34345)); $soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => new SOAP_Value('inputInteger','int',34345))); //*********************************************************** // Base echoIntegerArray $soap_tests['base'][] = new SOAP_Test('echoIntegerArray', array('inputIntegerArray' => array(1,234324324,2))); $soap_tests['base'][] = new SOAP_Test('echoIntegerArray', array('inputIntegerArray' => new SOAP_Value('inputIntegerArray','Array', array( #push struct elements into one soap value new SOAP_Value('item','int',1), new SOAP_Value('item','int',234324324), new SOAP_Value('item','int',2) ) ))); //*********************************************************** // Base echoFloat $soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => 342.23)); $soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => new SOAP_Value('inputFloat','float',342.23))); //*********************************************************** // 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' => new SOAP_Value('inputFloatArray','Array', array( #push struct elements into one soap value new SOAP_Value('nan','float',1.3223), new SOAP_Value('inf','float',34.2), new SOAP_Value('neginf','float',325.325) ) ))); //*********************************************************** // Base echoStruct $soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' => array( 'varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325))); $soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' => new SOAP_Value('inputStruct','Struct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ) ))); //*********************************************************** // Base echoStructArray $soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' => array( array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325), array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325), array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325) ))); $soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' => new SOAP_Value('inputStructArray','Array', array( #push struct elements into one soap value new SOAP_Value('item','SOAPStruct',array( new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) )), new SOAP_Value('item','SOAPStruct',array( new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) )), new SOAP_Value('item','SOAPStruct',array( new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) )) ) ))); //*********************************************************** // Base echoVoid $soap_tests['base'][] = new SOAP_Test('echoVoid', ''); $test = new SOAP_Test('echoVoid', ''); $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' => new SOAP_Value('inputBase64','base64Binary','TmVicmFza2E='))); //*********************************************************** // Base echoHexBinary $soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => '736F61707834')); $soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => new SOAP_Value('inputHexBinary','hexBinary','736F61707834'))); //*********************************************************** // Base echoDecimal $soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => '1234567890')); $soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => new SOAP_Value('inputDecimal','decimal','1234567890'))); //*********************************************************** // Base echoDate $soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => '2001-04-25T13:31:41-0700')); $soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => new SOAP_Value('inputDate','dateTime','2001-04-25T13:31:41-0700'))); //*********************************************************** // Base echoBoolean $soap_tests['base'][] = new SOAP_Test('echoBoolean', array('inputBoolean' => TRUE)); $soap_tests['base'][] = new SOAP_Test('echoBoolean', array('inputBoolean' => new SOAP_Value('inputBoolean','boolean',TRUE))); //*********************************************************** // GROUP B //*********************************************************** // GroupB echoStructAsSimpleTypes $expect = array( 'outputString'=>'arg', 'outputInteger'=>34, 'outputFloat'=>325.325 ); $soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes', array('inputStruct' => array( 'varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325 )), $expect); $soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes', array('inputStruct' => new SOAP_Value('inputStruct','struct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ) )), $expect); //*********************************************************** // GroupB echoSimpleTypesAsStruct $expect = 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( new SOAP_Value('inputString','string','arg'), new SOAP_Value('inputInteger','int',34), new SOAP_Value('inputFloat','float',325.325) ), $expect); //*********************************************************** // GroupB echo2DStringArray $soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray', array('input2DStringArray' => make_2d(3,3))); $soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray', array('input2DStringArray' => new SOAP_Value('input2DStringArray','Array', array( array( new SOAP_Value('item','string','row0col0'), new SOAP_Value('item','string','row0col1'), new SOAP_Value('item','string','row0col2') ), array( new SOAP_Value('item','string','row1col0'), new SOAP_Value('item','string','row1col1'), new SOAP_Value('item','string','row1col2') ) ) ))); //*********************************************************** // GroupB echoNestedStruct $soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct', array('inputStruct' => array( 'varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325, 'varStruct' => array( 'varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325 ) ))); $soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct', array('input2DStringArray' => new SOAP_Value('inputStruct','struct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325), new SOAP_Value('varStruct','SOAPStruct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ) ) ) ))); //*********************************************************** // GroupB echoNestedArray $soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray', array('inputStruct' => array( 'varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325, 'varArray' => array('red','blue','green') ))); $soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray', array('input2DStringArray' => new SOAP_Value('inputStruct','struct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325), new SOAP_Value('varArray','Array', array( #push struct elements into one soap value new SOAP_Value('item','string','red'), new SOAP_Value('item','string','blue'), new SOAP_Value('item','string','green') ) ) ) ))); //*********************************************************** // GROUP C header tests //*********************************************************** // echoMeStringRequest php val tests // echoMeStringRequest with endpoint as header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeStringRequest', 'hello world', 'http://soapinterop.org/echoheader/',0,'http://schemas.xmlsoap.org/soap/actor/next'); $test->headers_expect['echoMeStringRequest'] = array('echoMeStringResponse'=>'hello world'); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint as header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeStringRequest', 'hello world', 'http://soapinterop.org/echoheader/', 1,'http://schemas.xmlsoap.org/soap/actor/next'); $this->type = 'soapval'; // force a soapval version of this test $test->headers_expect['echoMeStringRequest'] = array('echoMeStringResponse'=>'hello world'); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint NOT header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeStringRequest', 'hello world', 'http://soapinterop.org/echoheader/', 0, 'http://some/other/actor'); $test->headers_expect['echoMeStringRequest'] = array(); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint NOT header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeStringRequest', 'hello world', 'http://soapinterop.org/echoheader/', 1, 'http://some/other/actor'); $test->headers_expect['echoMeStringRequest'] = array(); $soap_tests['GroupC'][] = $test; //*********************************************************** // echoMeStringRequest soapval tests // echoMeStringRequest with endpoint as header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStringRequest', 'string', 'hello world', 'http://soapinterop.org/echoheader/'); $test->headers_expect['echoMeStringRequest'] = array('echoMeStringResponse'=>'hello world'); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint as header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStringRequest', 'string', 'hello world', 'http://soapinterop.org/echoheader/', 1); $this->type = 'soapval'; // force a soapval version of this test $test->headers_expect['echoMeStringRequest'] = array('echoMeStringResponse'=>'hello world'); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint NOT header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStringRequest', 'string', 'hello world', 'http://soapinterop.org/echoheader/', 0, 'http://some/other/actor'); $test->headers_expect['echoMeStringRequest'] = array(); $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint NOT header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStringRequest', 'string', 'hello world', 'http://soapinterop.org/echoheader/', 1, 'http://some/other/actor'); $test->headers_expect['echoMeStringRequest'] = array(); $soap_tests['GroupC'][] = $test; //*********************************************************** // php val tests // echoMeStructRequest with endpoint as header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeStructRequest', array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325), 'http://soapinterop.org/echoheader/',0,'http://schemas.xmlsoap.org/soap/actor/next'); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> 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', ''); $test->headers[] = array('echoMeStructRequest', array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325), 'http://soapinterop.org/echoheader/', 1,'http://schemas.xmlsoap.org/soap/actor/next'); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> 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', ''); $test->headers[] = array('echoMeStructRequest', array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325), 'http://soapinterop.org/echoheader/', 0, 'http://some/other/actor'); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests['GroupC'][] = $test; // echoMeStructRequest with endpoint NOT header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeStructRequest', array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325), 'http://soapinterop.org/echoheader/', 1, 'http://some/other/actor'); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests['GroupC'][] = $test; //*********************************************************** // soapval tests // echoMeStructRequest with endpoint as header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStructRequest','SOAPStruct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ), 'http://soapinterop.org/echoheader/'); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> 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', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStructRequest','SOAPStruct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ), 'http://soapinterop.org/echoheader/', 1); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> 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', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStructRequest','SOAPStruct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ), 'http://soapinterop.org/echoheader/', 0, 'http://some/other/actor'); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests['GroupC'][] = $test; // echoMeStructRequest with endpoint NOT header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeStructRequest','SOAPStruct', array( #push struct elements into one soap value new SOAP_Value('varString','string','arg'), new SOAP_Value('varInt','int',34), new SOAP_Value('varFloat','float',325.325) ), 'http://soapinterop.org/echoheader/', 1, 'http://some/other/actor'); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests['GroupC'][] = $test; //*********************************************************** // echoMeUnknown php val tests // echoMeUnknown with endpoint as header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeUnknown', 'nobody understands me!', 'http://soapinterop.org/echoheader/',0,'http://schemas.xmlsoap.org/soap/actor/next'); $test->headers_expect['echoMeUnknown'] = array(); $soap_tests['GroupC'][] = $test; // echoMeUnknown with endpoint as header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeUnknown', 'nobody understands me!', 'http://soapinterop.org/echoheader/', 1,'http://schemas.xmlsoap.org/soap/actor/next'); $test->headers_expect['echoMeUnknown'] = 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', ''); $test->headers[] = array('echoMeUnknown', 'nobody understands me!', 'http://soapinterop.org/echoheader/', 0, 'http://some/other/actor'); $test->headers_expect['echoMeUnknown'] = array(); $soap_tests['GroupC'][] = $test; // echoMeUnknown with endpoint NOT header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->headers[] = array('echoMeUnknown', 'nobody understands me!', 'http://soapinterop.org/echoheader/', 1, 'http://some/other/actor'); $test->headers_expect['echoMeUnknown'] = array(); $soap_tests['GroupC'][] = $test; //*********************************************************** // echoMeUnknown soapval tests // echoMeUnknown with endpoint as header destination, doesn't have to understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeUnknown','string','nobody understands me!', 'http://soapinterop.org/echoheader/'); $test->headers_expect['echoMeUnknown'] = array(); $soap_tests['GroupC'][] = $test; // echoMeUnknown with endpoint as header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeUnknown','string','nobody understands me!', 'http://soapinterop.org/echoheader/', 1); $test->headers_expect['echoMeUnknown'] = 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', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeUnknown','string','nobody understands me!', 'http://soapinterop.org/echoheader/', 0, 'http://some/other/actor'); $test->headers_expect['echoMeUnknown'] = array(); $soap_tests['GroupC'][] = $test; // echoMeUnknown with endpoint NOT header destination, must understand $test = new SOAP_Test('echoVoid', ''); $test->type = 'soapval'; $test->headers[] = new SOAP_Header('echoMeUnknown','string','nobody understands me!', 'http://soapinterop.org/echoheader/', 1, 'http://some/other/actor'); $test->headers_expect['echoMeUnknown'] = array(); $soap_tests['GroupC'][] = $test; ?> Index: pear/SOAP/interop/client_round2_results.php +++ pear/SOAP/interop/client_round2_results.php <?php // NOTE: do not run this directly under a web server, as it will take a very long // time to execute. Run from a command line or something, and redirect output // to an html file. // // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id: client_round2_results.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/interop/client_round2_interop.php'; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <style> TD { background-color: Red; } TD.BLANK { background-color: White; } TD.OK { background-color: Lime; } TD.RESULT { background-color: Green; } TD.untested { background-color: White; } TD.CONNECT { background-color: Yellow; } TD.TRANSPORT { background-color: Yellow; } TD.WSDL { background-color: Yellow; } TD.WSDLCACHE { background-color: Yellow; } TD.WSDLPARSER { background-color: Yellow; } TD.HTTP { background-color: Yellow; } TD.SMTP { background-color: Yellow; } </style> <title>PEAR-PHP SOAP Interop Tests</title> </head> <body bgcolor="White" text="Black"> <h2 align="center">SOAP Client Interop Test Results: Round2</h2> <p> 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.</p> <p> 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 SOAP_Value class to define what the type of the value is. The second method is more interopable than the first by nature. </p> <p> More detail about errors (marked yellow or red) will follow each table. 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. WSDLCACHE errors mean we cannot retreive the WSDL file specified for the endpoint. </p> <p> More information on Round 2 Interopability is available at <a href="http://www.whitemesa.com/interop.htm">http://www.whitemesa.com/interop.htm</a>. </p> <?php $iop = new Interop_Client(); if ($_GET['detail'] == 1) $iop->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(); } } ?> </body> </html> Index: pear/SOAP/interop/database_round2.sql +++ pear/SOAP/interop/database_round2.sql # phpMyAdmin MySQL-Dump # version 2.2.5 # http://phpwizard.net/phpMyAdmin/ # http://phpmyadmin.sourceforge.net/ (download page) # # Host: localhost # Generation Time: Mar 30, 2002 at 02:39 PM # Server version: 3.23.49 # PHP Version: 4.3.0-dev # 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; Index: pear/SOAP/interop/readme.txt +++ pear/SOAP/interop/readme.txt Round 2 Interop Test files Info at: http://www.whitemesa.com/interop.htm. Requires an SQL database, schema for MySQL is in database_round2.sql. run client_round2.php to store test results. view client_round2_results.php to see test results server_round2.php implements base, GroupB and GroupC interop tests. Index: pear/SOAP/interop/server_round2.php +++ pear/SOAP/interop/server_round2.php <?php // // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id: server_round2.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/Server.php'; $server = new SOAP_Server; require_once 'server_round2_base.php'; require_once 'server_round2_groupB.php'; require_once 'server_round2_groupC.php'; $server->service($HTTP_RAW_POST_DATA); ?> Index: pear/SOAP/interop/server_round2_base.php +++ pear/SOAP/interop/server_round2_base.php <? // // +----------------------------------------------------------------------+ // | 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: server_round2_base.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/Server.php'; function generateFault($short, $long) { $params = array( "faultcode" => "Server", "faultstring" => $short, "detail" => $long ); $faultmsg = new SOAP_Message("Fault",$params,"http://schemas.xmlsoap.org/soap/envelope/"); return $faultmsg; } function hex2bin($data) { $len = strlen($data); return pack("H" . $len, $data); } class SOAP_Interop_Base { function SOAP_Interop_Base() { #if ($server) { # $server->addToMap("echoString",array("string"),array("string")); # $server->addToMap("echoStringArray",array(),array()); # $server->addToMap("echoInteger",array("int"),array("int")); # $server->addToMap("echoIntegerArray",array(),array()); # $server->addToMap("echoFloat",array("float"),array("float")); # $server->addToMap("echoFloatArray",array(),array()); # $server->addToMap("echoStruct",array(),array()); # $server->addToMap("echoStructArray",array(),array()); # $server->addToMap("echoVoid",array(),array()); # $server->addToMap("echoBase64",array("base64Binary"),array("base64Binary")); # $server->addToMap("echoDate",array("dateTime"),array("dateTime")); # $server->addToMap("echoHexBinary",array("hexBinary"),array("hexBinary")); # $server->addToMap("echoDecimal",array("decimal"),array("decimal")); # $server->addToMap("echoBoolean",array("boolean"),array("boolean")); #} } function echoString($inputString) { if (!$inputString) { return generateFault("Empty Input", "No string detected."); } $returnSoapVal = new SOAP_Value("return","string",$inputString); return $returnSoapVal; } function echoStringArray($inputStringArray) { return $inputStringArray; } function echoInteger($inputInteger) { return (integer)$inputInteger; } function echoIntegerArray($inputIntegerArray) { return $inputIntegerArray; } function echoFloat($inputFloat) { return (FLOAT)$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 base64_encode(base64_decode($b_encoded)); } function echoDate($timeInstant) { return $timeInstant; } function echoHexBinary($hb) { return bin2hex(hex2bin($hb)); } function echoDecimal($dec) { return (FLOAT)$dec; } function echoBoolean($boolean) { if($boolean == 1){ return "true"; } return "false"; } } $base = new SOAP_Interop_Base(); $server->addObjectMap($base); ?> Index: pear/SOAP/interop/server_round2_groupB.php +++ pear/SOAP/interop/server_round2_groupB.php <? // // +----------------------------------------------------------------------+ // | 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: server_round2_groupB.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/Server.php'; class SOAP_Interop_GroupB { function SOAP_Interop_GroupB() { # $server->addToMap('echoStructAsSimpleTypes', # array('inputStruct' => 'struct'), # array('outputString' => 'string', 'outputInteger' => 'int', 'outputFloat' => 'float')); # $server->addToMap('echoSimpleTypesAsStruct', # array('outputString' => 'string', 'outputInteger' => 'int', 'outputFloat' => 'float'), # array('return' => 'struct')); # $server->addToMap('echoNestedStruct', array(), array()); # $server->addToMap('echo2DStringArray', array(), array()); # $server->addToMap('echoNestedArray', array(), array()); } function echoStructAsSimpleTypes ($struct) { # convert a SOAPStruct to an array return array_values($struct); } function echoSimpleTypesAsStruct($string, $int, $float) { # convert a input into struct /*$ret = new SOAP_Value("return","struct", array( #push struct elements into one soap value new SOAP_Value("varString","string",$string), new SOAP_Value("varInt","int",$int), new SOAP_Value("varFloat","float",$float) ) );*/ $ret = array( "varString"=>$string, "varInt"=>$int, "varFloat"=>$float ); return $ret; } function echoNestedStruct($struct) { return $struct; } function echo2DStringArray($ary) { return $ary; } function echoNestedArray($ary) { return $ary; } } $groupb = new SOAP_Interop_GroupB(); $server->addObjectMap($groupb); ?> Index: pear/SOAP/interop/server_round2_groupC.php +++ pear/SOAP/interop/server_round2_groupC.php <? // // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id: server_round2_groupC.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/Server.php'; require_once 'SOAP/Header.php'; class SOAP_Interop_GroupC { function echoMeStringRequest($string) { return new SOAP_Value('echoMeStringResponse','string',$string); } function echoMeStructRequest($struct) { return new SOAP_Value('echoMeStructResponse','SOAPStruct',$struct); } } $groupc = new SOAP_Interop_GroupC(); $server->addObjectMap($groupc); ?> Index: pear/SOAP/interop/server_round2_test.php +++ pear/SOAP/interop/server_round2_test.php <?php // // +----------------------------------------------------------------------+ // | 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 | // +----------------------------------------------------------------------+ // // $Id: server_round2_test.php,v 1.1 2002/03/30 22:57:56 shane Exp $ // require_once 'SOAP/Server.php'; $server = new SOAP_Server; require_once 'server_round2_base.php'; require_once 'server_round2_groupB.php'; require_once 'server_round2_groupC.php'; $test = '<?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:ns6="http://soapinterop.org/echoheader/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Header> <ns6:echoMeStringRequest xsi:type="xsd:string" SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="0">hello world</ns6:echoMeStringRequest> </SOAP-ENV:Header> <SOAP-ENV:Body> <echoVoid></echoVoid> </SOAP-ENV:Body> </SOAP-ENV:Envelope>'; $test = '<?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:ns6="http://soapinterop.org/echoheader/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Header> <ns6:echoMeStructRequest xsi:type="si:SOAPStruct" SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="1"> <varString xsi:type="xsd:string">arg</varString> <varInt xsi:type="xsd:int">34</varInt> <varFloat xsi:type="xsd:float">325.325</varFloat> </ns6:echoMeStructRequest> </SOAP-ENV:Header> <SOAP-ENV:Body> <echoVoid></echoVoid> </SOAP-ENV:Body> </SOAP-ENV:Envelope> '; $test = '<?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:ns6="http://soapinterop.org/echoheader/" xmlns:ns7="http://soapinterop.org/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns7:echoString> <inputString xsi:type="xsd:string">blah</inputString> </ns7:echoString> </SOAP-ENV:Body> </SOAP-ENV:Envelope> '; $server->service($test, '',TRUE); ?>