diff options
Diffstat (limited to 'ext/soap/interop')
23 files changed, 784 insertions, 907 deletions
diff --git a/ext/soap/interop/base.php b/ext/soap/interop/base.php deleted file mode 100644 index a2bbb8a54a..0000000000 --- a/ext/soap/interop/base.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -// -// +----------------------------------------------------------------------+ -// | PHP Version 4 | -// +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 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$ -// -class Interop_Base -{ -} - -?>
\ No newline at end of file diff --git a/ext/soap/interop/client_round2.php b/ext/soap/interop/client_round2.php index 5583bb6c17..c1307472c4 100644 --- a/ext/soap/interop/client_round2.php +++ b/ext/soap/interop/client_round2.php @@ -9,7 +9,7 @@ <a href="index.php">Back to Interop Index</a><br> <p> </p> <?php -require_once 'SOAP/interop/client_round2_interop.php'; +require_once 'client_round2_interop.php'; $iop = new Interop_Client(); @@ -18,6 +18,7 @@ function endpointList($test,$sel_endpoint) global $iop; $iop->getEndpoints($test); echo "<select name='endpoint'>\n"; + echo "<option value=''>-- All Endpoints --</option>\n"; foreach ($iop->endpoints as $epname => $epinfo) { $selected = ''; if ($sel_endpoint == $epname) $selected = ' SELECTED'; @@ -28,15 +29,20 @@ function endpointList($test,$sel_endpoint) function methodList($test,$sel_method) { global $iop; - - $ml = $iop->getMethodList($test); + global $soap_tests; + echo "<select name='method'>\n"; - foreach ($ml as $method) { - $selected = ''; - if ($sel_method == $method) $selected = ' SELECTED'; - echo "<option value='$method'$selected>$method</option>\n"; + echo "<option value='ALL'>-- Run All Methods --</option>\n"; + $prev_method = ""; + foreach ($soap_tests[$test] as $x) { + $method = $x->test_name; + if ($method != $prev_method) { + $prev_method = $method; + $selected = ''; + if ($sel_method == $method) $selected = ' SELECTED'; + echo "<option value='$method'$selected>$method</option>\n"; + } } - echo "<option value='ALL'>Run All Methods</option>\n"; echo "</select>\n"; } @@ -50,9 +56,14 @@ function endpointTestForm($test, $endpoint, $method, $paramType, $useWSDL) echo "<input type='hidden' name='test' value='$test'>\n"; endpointList($test, $endpoint); methodList($test, $method); - echo "<select name='paramType'><option value='soapval'>soap value</option>"; + echo "<select name='paramType'>"; +// echo "<option value='all'>-- All --</option>"; + echo "<option value='soapval'".($paramType=='soapval'?' selected':'').">soap value</option>"; echo "<option value='php'".($paramType=='php'?' selected':'').">php internal type</option></select>\n"; - echo "<select name='useWSDL'><option value='0'>go Direct</option><option value='1'".($useWSDL?' selected':'').">use WSDL</option></select>\n"; + echo "<select name='useWSDL'>"; +// echo "<option value='all'>-- All --</option>"; + echo "<option value='0'>go Direct</option>"; + echo "<option value='1'".($useWSDL?' selected':'').">use WSDL</option></select>\n"; echo "<input type='submit' value='Go'>\n"; echo "</form><br>\n"; } @@ -80,7 +91,7 @@ if ($_POST['test'] && array_key_exists('endpoint', $_POST) && array_key_exists(' // here we execute the orders echo "<h2>Calling {$_POST['method']} at {$_POST['endpoint']}</h2>\n"; echo "NOTE: wire's are slightly modified to display better in web browsers.<br>\n"; - + $iop->currentTest = $_POST['test']; // see $tests above $iop->paramType = $_POST['paramType']; // 'php' or 'soapval' $iop->useWSDL = $_POST['useWSDL']; // 1= do wsdl tests @@ -88,10 +99,10 @@ if ($_POST['test'] && array_key_exists('endpoint', $_POST) && array_key_exists(' $iop->specificEndpoint = $_POST['endpoint']; // test only this endpoint $iop->testMethod = $_POST['method']=='ALL'?'':$_POST['method']; // test only this method $iop->skipEndpointList = array(); // endpoints to skip - $this->nosave = 0; // 1= disable saving results to database + $iop->nosave = 0; // 1= disable saving results to database // debug output - $iop->show = 1; - $iop->debug = 1; + $iop->show = 0; + $iop->debug = 0; $iop->showFaults = 0; // used in result table output echo '<pre>'; $iop->doTest(); // run a single set of tests using above options diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php index b3bd98b4fc..6c4dbd6499 100644 --- a/ext/soap/interop/client_round2_interop.php +++ b/ext/soap/interop/client_round2_interop.php @@ -19,23 +19,23 @@ // $Id$ // require_once 'DB.php'; // PEAR/DB -require_once 'base.php'; require_once 'client_round2_params.php'; require_once 'test.utility.php'; +require_once 'config.php'; error_reporting(E_ALL ^ E_NOTICE); -class Interop_Client extends Interop_Base +class Interop_Client { // database DNS - var $DSN = 'mysql://user@localhost/interop2'; + var $DSN = ""; // our central interop server, where we can get the list of endpoints - var $interopServer = "http://www.whitemesa.net/interopInfo"; - + var $interopServer = "http://www.whitemesa.net/wsdl/interopInfo.wsdl"; + // our local endpoint, will always get added to the database for all tests var $localEndpoint; - + // specify testing var $currentTest = 'base'; // see $tests above var $paramType = 'php'; // 'php' or 'soapval' @@ -50,15 +50,17 @@ class Interop_Client extends Interop_Base 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() { + global $interopConfig; + $this->DSN = $interopConfig['DSN']; // set up the database connection $this->dbc = DB::connect($this->DSN, true); // if it errors out, just ignore it and rely on regular methods @@ -67,41 +69,41 @@ class Interop_Client extends Interop_Base $this->dbc = NULL; } // set up local endpoint - $this->localEndpoint['base'] = array( - 'endpointName'=>'PEAR SOAP', - 'endpointURL'=>'http://localhost/soap_interop/server_round2.php', - 'wsdlURL'=>'http://localhost/soap_interop/interop.wsdl' + $this->localEndpoint['base'] = (object)array( + 'endpointName'=>'PHP ext/soap', + 'endpointURL'=>'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/server_round2_base.php', + 'wsdlURL'=>'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/interop.wsdl.php' ); - $this->localEndpoint['GroupB'] = array( - 'endpointName'=>'PEAR SOAP', - 'endpointURL'=>'http://localhost/soap_interop/server_round2.php', - 'wsdlURL'=>'http://localhost/soap_interop/interopB.wsdl' + $this->localEndpoint['GroupB'] = (object)array( + 'endpointName'=>'PHP ext/soap', + 'endpointURL'=>'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/server_round2_groupB.php', + 'wsdlURL'=>'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/interopB.wsdl.php' ); - $this->localEndpoint['GroupC'] = array( - 'endpointName'=>'PEAR SOAP', - 'endpointURL'=>'http://localhost/soap_interop/server_round2.php', - 'wsdlURL'=>'http://localhost/soap_interop/echoheadersvc.wsdl' + $this->localEndpoint['GroupC'] = (object)array( + 'endpointName'=>'PHP ext/soap', + 'endpointURL'=>'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/server_round2_groupC.php', + 'wsdlURL'=>'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/echoheadersvc.wsdl.php' ); } - + 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/"); + $endpointArray = $soapclient->__call("GetEndpointInfo",array("groupName"=>$test),"http://soapinterop.org/info/","http://soapinterop.org/info/"); if (PEAR::isError($endpointArray)) { print $soapclient->wire; print_r($endpointArray); return; } - + // add our local endpoint if ($this->localEndpoint[$test]) { - array_push($endpointArray, $this->localEndpoint[$test]); + array_push($endpointArray, $this->localEndpoint[$test]); } - + if (!$endpointArray) return; - + // reset the status to zero $res = $this->dbc->query("update endpoints set status = 0 where class='$test'"); if (DB::isError($res)) { @@ -110,10 +112,10 @@ class Interop_Client extends Interop_Base if (is_object($res)) $res->free(); // save new endpoints into database foreach($endpointArray as $k => $v){ - if (array_key_exists($v['endpointName'],$this->endpoints)) { - $res = $this->dbc->query("update endpoints set endpointURL='{$v['endpointURL']}', wsdlURL='{$v['wsdlURL']}', status=1 where id={$this->endpoints[$v['endpointName']]['id']}"); + if (array_key_exists($v->endpointName,$this->endpoints)) { + $res = $this->dbc->query("update endpoints set endpointURL='{$v->endpointURL}', wsdlURL='{$v->wsdlURL}', status=1 where id={$this->endpoints[$v->endpointName]['id']}"); } else { - $res = $this->dbc->query("insert into endpoints (endpointName,endpointURL,wsdlURL,class) values('{$v['endpointName']}','{$v['endpointURL']}','{$v['wsdlURL']}','$test')"); + $res = $this->dbc->query("insert into endpoints (endpointName,endpointURL,wsdlURL,class) values('{$v->endpointName}','{$v->endpointURL}','{$v->wsdlURL}','$test')"); } if (DB::isError($res)) { die ($res->getMessage()); @@ -121,18 +123,18 @@ class Interop_Client extends Interop_Base if (is_object($res)) $res->free(); } } - + /** * fetchEndpoints * retreive endpoints interop server * * @return boolean result * @access private - */ + */ function fetchEndpoints($test = NULL) { // fetch from the interop server $soapclient = new SoapObject($this->interopServer); - + if ($test) { $this->_fetchEndpoints($soapclient, $test); } else { @@ -141,12 +143,13 @@ class Interop_Client extends Interop_Base } $test = 'base'; } - + // retreive all endpoints now $this->currentTest = $test; - return $this->_getEndpoints($test); + $x = $this->_getEndpoints(); + return $x; } - + /** * getEndpoints * retreive endpoints from either database or interop server @@ -155,7 +158,7 @@ class Interop_Client extends Interop_Base * @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); @@ -171,7 +174,7 @@ class Interop_Client extends Interop_Base * @param boolean all (if false, only get valid endpoints, status=1) * @return boolean result * @access private - */ + */ function _getEndpoints($base = "", $all = 0) { $this->endpoints = array(); @@ -182,7 +185,7 @@ class Interop_Client extends Interop_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"; @@ -193,6 +196,13 @@ class Interop_Client extends Interop_Base foreach ($db_ep as $entry) { $this->endpoints[$entry['endpointName']] = $entry; } +/* + $this->endpoints["PHP ext/soap"] = + array("endpointName" => "PHP ext/soap", + "endpointURL" => "http://soap.4s4c.com/ilab/soap.asp", + "wsdlURL" => "http://www.pocketsoap.com/services/ilab.wsdl", + "class" => "base" "status"]=> string(1) "1" } +*/ if (count($this->endpoints) > 0) { $this->currentTest = $base; return TRUE; @@ -209,7 +219,7 @@ class Interop_Client extends Interop_Base 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 ); @@ -224,7 +234,7 @@ class Interop_Client extends Interop_Base } } } - + /** * saveResults * save the results of a method test into the database @@ -233,7 +243,7 @@ class Interop_Client extends Interop_Base */ function _saveResults($endpoint_id, &$soap_test) { if ($this->nosave) return; - + $result = $soap_test->result; $wire = $result['wire']; if ($result['success']) { @@ -244,7 +254,7 @@ class Interop_Client extends Interop_Base $error = $result['fault']->faultstring; if (!$wire) $wire= $result['fault']->detail; } - + $test_name = $soap_test->test_name; // add header info to the test name if ($soap_test->headers) { @@ -261,7 +271,7 @@ class Interop_Client extends Interop_Base } } } - + $sql = "delete from results where endpoint=$endpoint_id ". "and class='$this->currentTest' and type='$this->paramType' ". "and wsdl=$this->useWSDL and function=". @@ -272,7 +282,7 @@ class Interop_Client extends Interop_Base die ($res->getMessage()); } if (is_object($res)) $res->free(); - + $sql = "insert into results (endpoint,stamp,class,type,wsdl,function,result,error,wire) ". "values($endpoint_id,".time().",'$this->currentTest',". "'$this->paramType',$this->useWSDL,". @@ -282,7 +292,7 @@ class Interop_Client extends Interop_Base ($wire?$this->dbc->quote($wire):"''").")"; #echo "\n".$sql; $res = $this->dbc->query($sql); - + if (DB::isError($res)) { die ($res->getMessage()); } @@ -296,7 +306,7 @@ class Interop_Client extends Interop_Base * @param SOAP_Value soapval * @return mixed result * @access public - */ + */ function decodeSoapval($soapval) { if (gettype($soapval) == "object" && @@ -320,7 +330,7 @@ class Interop_Client extends Interop_Base } return $val; } - + /** * compareResult * compare two php types for a match @@ -329,22 +339,10 @@ class Interop_Client extends Interop_Base * @param string test_result * @return boolean result * @access public - */ + */ function compareResult($expect, $result, $type = NULL) { - $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 { - if ($type == 'boolean') - $ok = boolean_compare($expect, $result); - else - $ok = string_compare($expect, $result); - } - return $ok; + return compare($expect, $result); } @@ -356,22 +354,23 @@ class Interop_Client extends Interop_Base * @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 SoapObject($endpoint_info['wsdlURL']); + $endpoint_info['client']->__trace(1); } $soap =& $endpoint_info['client']; - + # XXX how do we determine a failure on retreiving/parsing wsdl? if ($soap->wsdl->fault) { $fault = $soap->wsdl->fault->getFault(); @@ -404,6 +403,7 @@ class Interop_Client extends Interop_Base } if (!array_key_exists('client',$endpoint_info)) { $endpoint_info['client'] = new SoapObject($endpoint_info['endpointURL'],$soapaction); + $endpoint_info['client']->__trace(1); } $soap = $endpoint_info['client']; } @@ -417,7 +417,6 @@ class Interop_Client extends Interop_Base // XXX no way to set encoding // this lets us set UTF-8, US-ASCII or other //$soap->setEncoding($soap_test->encoding); - if ($this->useWSDL) { $args = ''; foreach ($soap_test->method_params as $pname => $param) { @@ -428,16 +427,16 @@ class Interop_Client extends Interop_Base } else { $return = $soap->__call($soap_test->method_name,$soap_test->method_params,$soapaction, $namespace); } - - // save the wire - $wire = $soap->__getlastrequest()."\n\n".$soap->__getlastresponse(); - $wire = str_replace('>',">\n",$wire); - $wire = str_replace('" ',"\" \n",$wire); - #print $wire; - + + if(!$soap->__isfault()){ - if (is_array($soap_test->method_params) && count($soap_test->method_params) == 1) { - $sent = array_shift($soap_test->method_params); + if ($soap_test->expect !== NULL) { + $sent = $soap_test->expect; + } else if (is_array($soap_test->method_params) && count($soap_test->method_params) == 1) { + reset($soap_test->method_params); + $sent = current($soap_test->method_params); + } else if (is_array($soap_test->method_params) && count($soap_test->method_params) == 0) { + $sent = null; } else { $sent = $soap_test->method_params; } @@ -445,7 +444,7 @@ class Interop_Client extends Interop_Base // compare header results $header_result = array(); $headers_ok = TRUE; - + # XXX need to implement header support! # #if ($soap_test->headers) { @@ -476,15 +475,24 @@ class Interop_Client extends Interop_Base # we need to decode what we sent so we can compare! $sent_d = $this->decodeSoapval($sent); - + $soap_test->result['sent'] = $sent; $soap_test->result['return'] = $return; + // compare the results with what we sent + $ok = $this->compareResult($sent_d,$return, $sent->type); if (!$ok && $soap_test->expect) { $ok = $this->compareResult($soap_test->expect,$return); } - + + // save the wire + $wire = "REQUEST:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastrequest()))."\n\n". + "RESPONSE:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastresponse()))."\n\n". + "EXPECTED:\n".var_dump_str($sent_d)."\n". + "RESULTL:\n".var_dump_str($return); + #print "Wire:".htmlentities($wire); + if($ok){ if (!$headers_ok) { $fault = new SoapFault('HEADER','The returned result did not match what we expected to receive'); @@ -514,48 +522,54 @@ class Interop_Client extends Interop_Base $ok = 0; $res =$fault->faultcode; } + // save the wire + $wire = "REQUEST:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastrequest()))."\n\n". + "RESPONSE:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastresponse())); + #print "Wire:".htmlentities($wire); + $soap_test->setResult($ok,$res, $wire,$fault->faultstring, $fault); + } return $ok; } - + /** * doTest * run a single round of tests * * @access public - */ + */ function doTest() { global $soap_tests; // get endpoints for this test $this->getEndpoints($this->currentTest); #clear totals $this->totals = array(); - + $i = 0; foreach($this->endpoints as $endpoint => $endpoint_info){ - + // if we specify an endpoint, skip until we find it if ($this->specificEndpoint && $endpoint != $this->specificEndpoint) continue; if ($this->useWSDL && !$endpoint_info['endpointURL']) continue; - + $skipendpoint = FALSE; $this->totals['servers']++; #$endpoint_info['tests'] = array(); - + if ($this->show) print "Processing $endpoint at {$endpoint_info['endpointURL']}<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 we haven't reached our startpoint, skip if ($this->startAt && $this->startAt != $endpoint_info['endpointName']) continue; $this->startAt = ''; - + // if this is in our skip list, skip it if (in_array($endpoint, $this->skipEndpointList)) { $skipendpoint = TRUE; @@ -570,13 +584,13 @@ class Interop_Client extends Interop_Base $soap_test->result = NULL; continue; } - + // if we're looking for a specific method, skip unless we have it - if ($this->testMethod && !strstr($this->testMethod,$soap_test->test_name)) continue; + if ($this->testMethod && strcmp($this->testMethod,$soap_test->test_name) != 0) continue; if ($this->testMethod && $this->currentTest == 'GroupC') { // we have to figure things out now if (!preg_match('/(.*):(.*),(\d),(\d)/',$this->testMethod, $m)) continue; - + // is the header in the headers list? $gotit = FALSE; foreach ($soap_test->headers as $header) { @@ -594,7 +608,7 @@ class Interop_Client extends Interop_Base } if (!$gotit) continue; } - + // if we are skipping the rest of the tests (due to error) note a fault if ($skipendpoint) { $soap_test->setResult(0,$fault->faultcode, '', @@ -623,7 +637,7 @@ class Interop_Client extends Interop_Base if ($this->numservers && ++$i >= $this->numservers) break; } } - + function doGroupTests() { $dowsdl = array(0,1); foreach($dowsdl as $usewsdl) { @@ -636,13 +650,13 @@ class Interop_Client extends Interop_Base } } } - + /** * doTests * go all out. This takes time. * * @access public - */ + */ function doTests() { // the mother of all interop tests $dowsdl = array(0,1); @@ -659,10 +673,10 @@ class Interop_Client extends Interop_Base } } } - + // *********************************************************** // output functions - + /** * getResults * retreive results from the database, stuff them into the endpoint array @@ -679,18 +693,18 @@ class Interop_Client extends Interop_Base } 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; @@ -709,14 +723,14 @@ class Interop_Client extends Interop_Base } $this->totals['calls'] = count($methods) * $this->totals['servers']; - if ($this->totals['fail'] == $this->totals['calls']) { - // assume tests have not run, skip outputing table - print "No Data Available<br>\n"; - return; - } - +# 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) { @@ -766,7 +780,7 @@ class Interop_Client extends Interop_Base } echo "</ul><br><br>\n"; } - + function outputTables() { // the mother of all interop tests $dowsdl = array(0,1); @@ -783,7 +797,7 @@ class Interop_Client extends Interop_Base } } } - + function showWire($id) { $results = $this->dbc->getAll("select * from results where id=$id",NULL, DB_FETCHMODE_ASSOC ); #$wire = preg_replace("/>/",">\n",$results[0]['wire']); diff --git a/ext/soap/interop/client_round2_params.php b/ext/soap/interop/client_round2_params.php index 262093c0b7..b78fb14bce 100644 --- a/ext/soap/interop/client_round2_params.php +++ b/ext/soap/interop/client_round2_params.php @@ -35,11 +35,11 @@ class SOAP_Test { var $show = 1; var $debug = 0; var $encoding = 'UTF-8'; - + function SOAP_Test($methodname, $params, $expect = NULL) { # XXX we have to do this to make php-soap happy with NULL params if (!$params) $params = array(); - + if (strchr($methodname,'(')) { preg_match('/(.*)\((.*)\)/',$methodname,$matches); $this->test_name = $methodname; @@ -48,8 +48,10 @@ class SOAP_Test { $this->test_name = $this->method_name = $methodname; } $this->method_params = $params; - $this->expect = $expect; - + if ($expect !== NULL) { + $this->expect = $expect; + } + // determine test type if ($params) { $v = array_values($params); @@ -58,7 +60,7 @@ class SOAP_Test { $this->type = 'soapval'; } } - + function setResult($ok, $result, $wire, $error = '', $fault = NULL) { $this->result['success'] = $ok; @@ -75,19 +77,19 @@ class SOAP_Test { * @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->test_name : "; if ($this->headers) { foreach ($this->headers as $h) { if (get_class($h) == 'soap_header') { - + echo "\n {$h->name},{$h->attributes['SOAP-ENV:actor']},{$h->attributes['SOAP-ENV:mustUnderstand']} : "; } else { if (!$h[4]) $h[4] = SOAP_TEST_ACTOR_NEXT; @@ -96,22 +98,22 @@ class SOAP_Test { } } } - + if ($debug) { print "method params: "; print_r($this->params); print "\n"; } - + $ok = $this->result['success']; if ($ok) { - print "SUCCESS\n"; + print "<font color=\"#00cc00\">SUCCESS</font>\n"; } else { $fault = $this->result['fault']; if ($fault) { - print "FAILED: {$fault->faultcode} {$fault->faultstring}\n"; + print "<font color=\"#ff0000\">FAILED: {$fault->faultcode} {$fault->faultstring}</font>\n"; } else { - print "FAILED: ".$this->result['result']."\n"; + print "<font color=\"#ff0000\">FAILED: ".$this->result['result']."</font>\n"; } } if ($debug) { @@ -151,10 +153,14 @@ class SOAPStruct { $soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => 'hello world!')); $soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => soap_value('inputString','hello world',XSD_STRING))); -$soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => "")); -$soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => soap_value('inputString','',XSD_STRING))); -$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => 'hello world\nline 2\n')); -$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => soap_value('inputString','hello world\nline 2\n',XSD_STRING))); +$soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => '')); +$soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => soap_value('inputString','',XSD_STRING))); +$soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => NULL)); +$soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => soap_value('inputString',NULL,XSD_STRING))); +//$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => ">,<,&,\",',0:\x00",1:\x01,2:\x02,3:\x03,4:\x04,5:\x05,6:\x06,7:\x07,8:\x08,9:\x09,10:\x0a,11:\x0b,12:\x0c,13:\x0d,14:\x0e,15:\x0f,16:\x10,17:\x11,18:\x12,19:\x13,20:\x14,21:\x15,22:\x16,23:\x17,24:\x18,25:\x19,26:\x1a,27:\x1b,28:\x1c,29:\x1d,30:\x1e,31:\x1f")); +//$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => soap_value('inputString',">,<,&,\",',0:\x00",1:\x01,2:\x02,3:\x03,4:\x04,5:\x05,6:\x06,7:\x07,8:\x08,9:\x09,10:\x0a,11:\x0b,12:\x0c,13:\x0d,14:\x0e,15:\x0f,16:\x10,17:\x11,18:\x12,19:\x13,20:\x14,21:\x15,22:\x16,23:\x17,24:\x18,25:\x19,26:\x1a,27:\x1b,28:\x1c,29:\x1d,30:\x1e,31:\x1f",XSD_STRING))); +$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => ">,<,&,\",',\\,\n")); +$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => soap_value('inputString',">,<,&,\",',\\,\n",XSD_STRING))); $test = new SOAP_Test('echoString(utf-8)', array('inputString' => utf8_encode('ỗÈéóÒ₧⅜ỗỸ'))); $test->encoding = 'UTF-8'; $soap_tests['base'][] = $test; @@ -170,15 +176,25 @@ $soap_tests['base'][] = new SOAP_Test('echoStringArray', $soap_tests['base'][] = new SOAP_Test('echoStringArray', array('inputStringArray' => soap_value('inputStringArray',array('good','bad'),SOAP_ENC_ARRAY))); - -// null array test + +$soap_tests['base'][] = new SOAP_Test('echoStringArray(one)', + array('inputStringArray' => array('good'))); +$soap_tests['base'][] = new SOAP_Test('echoStringArray(one)', + array('inputStringArray' => + soap_value('inputStringArray',array('good'),SOAP_ENC_ARRAY))); + +// empty array test +$soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => array())); +$soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => soap_value('inputStringArray',array(),SOAP_ENC_ARRAY))); + # XXX NULL Arrays not supported -#$soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => NULL)); -#$soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => soap_value('inputStringArray',NULL,XSD_STRING))); +// null array test +$soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => NULL)); +$soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => soap_value('inputStringArray',NULL,SOAP_ENC_ARRAY))); //*********************************************************** // Base echoInteger - +$x = new SOAP_Test('echoInteger', array('inputInteger' => 34345)); $soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => 34345)); $soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => soap_value('inputInteger',12345,XSD_INT))); @@ -191,12 +207,7 @@ $soap_tests['base'][] = new SOAP_Test('echoIntegerArray', soap_value('inputIntegerArray', array(new soapvar(12345,XSD_INT),new soapvar(654321,XSD_INT)), SOAP_ENC_ARRAY))); -# -#// null array test -# XXX NULL Arrays not supported -#$soap_tests['base'][] = new SOAP_Test('echoIntegerArray(null)', array('inputIntegerArray' => NULL)); -#$soap_tests['base'][] = new SOAP_Test('echoIntegerArray(null)', array('inputIntegerArray' => new SOAP_Value('inputIntegerArray','Array',NULL))); -# + //*********************************************************** // Base echoFloat @@ -207,7 +218,7 @@ $soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => soap_va // 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', +$soap_tests['base'][] = new SOAP_Test('echoFloatArray', array('inputFloatArray' => soap_value('inputFloatArray', array(new soapvar(123.45,XSD_FLOAT),new soapvar(654.321,XSD_FLOAT)), @@ -243,177 +254,179 @@ $soap_tests['base'][] = $test; $soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' => 'TmVicmFza2E=')); $soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' => - soap_value('inputBase64','TmVicmFza2E=',XSD_BASE64BINARY))); + soap_value('inputBase64','TmVicmFza2E=',XSD_BASE64BINARY))); //*********************************************************** // Base echoHexBinary $soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => '736F61707834')); -$soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => - soap_value('inputHexBinary','736F61707834',XSD_HEXBINARY))); +$soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => + soap_value('inputHexBinary','736F61707834',XSD_HEXBINARY))); //*********************************************************** // Base echoDecimal # XXX test fails because php-soap incorrectly sets decimal to long rather than float -$soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => 12345.67890)); -$soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => - soap_value('inputDecimal',12345.67890,XSD_DECIMAL))); +$soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => '12345.67890')); +$soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => + soap_value('inputDecimal','12345.67890',XSD_DECIMAL))); //*********************************************************** // Base echoDate # php-soap doesn't handle datetime types properly yet $soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => '2001-05-24T17:31:41Z')); -$soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => +$soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => soap_value('inputDate','2001-05-24T17:31:41Z',XSD_DATETIME)));#'2001-04-25T13:31:41-0700' - + //*********************************************************** // Base echoBoolean # php-soap sends boolean as zero or one, which is ok, but to be explicit, send true or false. -$soap_tests['base'][] = new SOAP_Test('echoBoolean', array('inputBoolean' => TRUE)); -$soap_tests['base'][] = new SOAP_Test('echoBoolean', array('inputBoolean' => +$soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' => TRUE)); +$soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' => soap_value('inputBoolean',TRUE,XSD_BOOLEAN))); -$soap_tests['base'][] = new SOAP_Test('echoBoolean', array('inputBoolean' => FALSE)); -$soap_tests['base'][] = new SOAP_Test('echoBoolean', array('inputBoolean' => +$soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' => FALSE)); +$soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' => soap_value('inputBoolean',FALSE,XSD_BOOLEAN))); +$soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' => 1),true); +$soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' => + soap_value('inputBoolean',1,XSD_BOOLEAN)),true); +$soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' => 0),false); +$soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' => + soap_value('inputBoolean',0,XSD_BOOLEAN)),false); + + + +//*********************************************************** +// GROUP B + + +//*********************************************************** +// GroupB echoStructAsSimpleTypes + +$expect = array( + 'outputString'=>'arg', + 'outputInteger'=>34, + 'outputFloat'=>325.325 + ); +$soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes', + array('inputStruct' => (object)array( + 'varString'=>'arg', + 'varInt'=>34, + 'varFloat'=>325.325 + )), $expect); +$soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes', + array('inputStruct' => + soap_value('inputStruct', + (object)array('varString' => 'arg', + 'varInt' => 34, + 'varFloat' => 325.325 + ), SOAP_ENC_OBJECT)), $expect); + +//*********************************************************** +// GroupB echoSimpleTypesAsStruct + +$expect = + (object)array( + 'varString'=>'arg', + 'varInt'=>34, + 'varFloat'=>325.325 + ); +$soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct', + array( + 'inputString'=>'arg', + 'inputInteger'=>34, + 'inputFloat'=>325.325 + ), $expect); +$soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct', + array( + soap_value('inputString','arg', XSD_STRING), + soap_value('inputInteger',34, XSD_INT), + soap_value('inputFloat',325.325, XSD_FLOAT) + ), $expect); + +//*********************************************************** +// GroupB echo2DStringArray + +$soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray', + array('input2DStringArray' => make_2d(3,3))); + +$multidimarray = + soap_value('input2DStringArray', + array( + array('row0col0', 'row0col1', 'row0col2'), + array('row1col0', 'row1col1', 'row1col2') + ), SOAP_ENC_ARRAY + ); +//$multidimarray->options['flatten'] = TRUE; +$soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray', + array('input2DStringArray' => $multidimarray)); + +//*********************************************************** +// GroupB echoNestedStruct + +$soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct', + array('inputStruct' => (object)array( + 'varString'=>'arg', + 'varInt'=>34, + 'varFloat'=>325.325, + 'varStruct' => (object)array( + 'varString'=>'arg', + 'varInt'=>34, + 'varFloat'=>325.325 + ) + ))); +$soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct', + array('inputStruct' => + soap_value('inputStruct', + (object)array( + 'varString'=>'arg', + 'varInt'=>34, + 'varFloat'=>325.325, + 'varStruct' => (object)array( + 'varString'=>'arg', + 'varInt'=>34, + 'varFloat'=>325.325 + ) +// array( #push struct elements into one soap value +// soap_value('varString','arg', XSD_STRING), +// soap_value('varInt',34, XSD_INT), +// soap_value('varFloat',325.325,XSD_FLOAT), +// soap_value('varStruct', +// (object)array('varString' => 'arg', +// 'varInt' => 34, +// 'varFloat' => 325.325 +// ), SOAP_ENC_OBJECT + ), SOAP_ENC_OBJECT + ))); + +//*********************************************************** +// GroupB echoNestedArray + +$soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray', + array('inputStruct' => (object)array( + 'varString'=>'arg', + 'varInt'=>34, + 'varFloat'=>325.325, + 'varArray' => array('red','blue','green') + ))); +$soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray', + array('inputStruct' => + soap_value('inputStruct', + (object)array('varString' => 'arg', + 'varInt' => 34, + 'varFloat' => 325.325, + 'varArray' => + array("red", "blue", "green") +// soap_value('item','red', XSD_STRING), +// soap_value('item','blue', XSD_STRING), +// soap_value('item','green', XSD_STRING) +// ) + ), SOAP_ENC_OBJECT + ))); + -# -# -#//*********************************************************** -#// 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','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) -# ))), $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))); -# -#$multidimarray = -# 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') -# ) -# ) -# ); -#$multidimarray->options['flatten'] = TRUE; -#$soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray', -# array('input2DStringArray' => $multidimarray)); -# -#//*********************************************************** -#// 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('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), -# 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) -# ) -# /*,NULL,'http://soapinterop.org/xsd'*/) -# ) -# ))); -# -#//*********************************************************** -#// 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('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), -# 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 # diff --git a/ext/soap/interop/client_round2_results.php b/ext/soap/interop/client_round2_results.php index 69f82ab582..42c49e2b39 100644 --- a/ext/soap/interop/client_round2_results.php +++ b/ext/soap/interop/client_round2_results.php @@ -60,7 +60,7 @@ if ($_GET['wire']) { } else { $iop->getEndpoints(); $iop->getResults(); - + if ($_GET['test']) { $iop->currentTest = $_GET['test']; $iop->useWSDL = $_GET['wsdl']?$_GET['wsdl']:0; diff --git a/ext/soap/interop/client_round2_run.php b/ext/soap/interop/client_round2_run.php index ab773c7e21..d879353694 100644 --- a/ext/soap/interop/client_round2_run.php +++ b/ext/soap/interop/client_round2_run.php @@ -29,17 +29,17 @@ $iop = new Interop_Client(); // set some options $iop->currentTest = 'base'; // see $tests above $iop->paramType = 'php'; // 'php' or 'soapval' -$iop->useWSDL = 1; // 1= do wsdl tests +$iop->useWSDL = 0; // 1= do wsdl tests $iop->numServers = 0; // 0 = all -$iop->specificEndpoint = '4s4c'; // test only this endpoint -$iop->testMethod = 'echoString'; // test only this method +//$iop->specificEndpoint = '4s4c'; // test only this endpoint +//$iop->testMethod = 'echoString'; // test only this method #XXX MS SOAP ToolKit 2.0/3.0 crashes php-soap in __getfault! // endpoints to skip -$iop->skipEndpointList = array('Apache Axis','IONA XMLBus','IONA XMLBus (CORBA)','MS SOAP ToolKit 2.0','MS SOAP ToolKit 3.0','Spheon JSOAP','SQLData SOAP Server','WASP Advanced 3.0'); +$iop->skipEndpointList = array('Apache Axis','IONA XMLBus','IONA XMLBus (CORBA)','MS SOAP ToolKit 2.0','MS SOAP ToolKit 3.0','Spheon JSOAP','SQLData SOAP Server','WASP Advanced 3.0'); $iop->startAt=''; -$this->nosave = 0; // 1= disable saving results to database +$iop->nosave = 0; // 1= disable saving results to database // debug output $iop->show = 1; $iop->debug = 0; diff --git a/ext/soap/interop/config.php.dist b/ext/soap/interop/config.php.dist new file mode 100644 index 0000000000..3e9549cdfe --- /dev/null +++ b/ext/soap/interop/config.php.dist @@ -0,0 +1,4 @@ +<?php +// configuration items +$interopConfig['DSN'] = 'mysql://root@localhost/soapinterop'; +?>
\ No newline at end of file diff --git a/ext/soap/interop/database_round2.sql b/ext/soap/interop/database_round2.sql index 79669a04c2..6834b0eeae 100644 --- a/ext/soap/interop/database_round2.sql +++ b/ext/soap/interop/database_round2.sql @@ -42,4 +42,3 @@ CREATE TABLE results ( wire text NOT NULL, PRIMARY KEY (id) ) TYPE=MyISAM; - diff --git a/ext/soap/interop/echoheadersvc.wsdl b/ext/soap/interop/echoheadersvc.wsdl.php index a279580dc3..2eb5c8c6e1 100644 --- a/ext/soap/interop/echoheadersvc.wsdl +++ b/ext/soap/interop/echoheadersvc.wsdl.php @@ -1,4 +1,8 @@ -<?xml version="1.0"?> +<?php +header("Content-Type: text/xml"); +echo '<?xml version="1.0"?>'; +echo "\n"; +?> <definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <import location="http://www.whitemesa.com/interop/InteropTest.wsdl" namespace="http://soapinterop.org/"/> @@ -8,7 +12,7 @@ <service name="interopLabEchoHeader"> <port name="interopPortEchoHdr" binding="tns:InteropEchoHeaderBinding"> - <soap:address location="http://localhost/soap_interop/server_round2.php"/> + <soap:address location="http://<?php echo ($_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']));?>/server_round2.php"/> </port> </service> diff --git a/ext/soap/interop/endpointdata.sql b/ext/soap/interop/endpointdata.sql deleted file mode 100644 index 80d9d5ac9c..0000000000 --- a/ext/soap/interop/endpointdata.sql +++ /dev/null @@ -1,85 +0,0 @@ -# phpMyAdmin MySQL-Dump -# version 2.2.5 -# http://phpwizard.net/phpMyAdmin/ -# http://phpmyadmin.sourceforge.net/ (download page) -# -# Host: localhost -# Generation Time: Jul 14, 2002 at 03:13 PM -# Server version: 3.23.49 -# PHP Version: 4.2.1 -# Database : `interop2` - -# -# Dumping data for table `endpoints` -# - -INSERT INTO endpoints VALUES (1, '4s4c', 'http://soap.4s4c.com/ilab/soap.asp', 'http://www.pocketsoap.com/services/ilab.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (2, '4s4c v2.0', 'http://soap.4s4c.com/ilab2/soap.asp', 'http://soap.4s4c.com/ilab2/ilab.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (3, 'Apache Axis', 'http://nagoya.apache.org:5049/axis/services/echo', 'http://nagoya.apache.org:5049/axis/services/echo?wsdl', 'base', 1); -INSERT INTO endpoints VALUES (4, 'Apache SOAP 2.2', 'http://nagoya.apache.org:5049/soap/servlet/rpcrouter', 'http://www.apache.org/~rubys/ApacheSoap.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (5, 'ASP.NET Web Services', 'http://www.mssoapinterop.org/asmx/simple.asmx', 'http://www.mssoapinterop.org/asmx/simple.asmx?wsdl', 'base', 1); -INSERT INTO endpoints VALUES (6, 'CapeConnect', 'http://interop.capeclear.com/ccx/soapbuilders-round2', 'http://interop.capeclear.com/wsdl/soapbuilders-round2.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (7, 'Delphi SOAP', 'http://soap-server.borland.com/WebServices/Interop/cgi-bin/InteropService.exe/soap/InteropTestPortType', 'http://soap-server.borland.com/WebServices/Interop/cgi-bin/InteropService.exe/wsdl/InteropTestPortType', 'base', 1); -INSERT INTO endpoints VALUES (8, 'EasySoap++', 'http://easysoap.sourceforge.net/cgi-bin/interopserver', 'http://easysoap.sourceforge.net/interopA.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (9, 'eSOAP', 'http://www.quakersoft.net/cgi-bin/interop2_server.cgi', 'http://www.quakersoft.net/wsdl/interop2.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (10, 'gSOAP', 'http://websrv.cs.fsu.edu/~engelen/interop2.cgi', 'http://www.cs.fsu.edu/~engelen/interop2.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (11, 'Frontier', 'http://www.soapware.org/xmethodsInterop', '', 'base', 1); -INSERT INTO endpoints VALUES (12, 'GLUE', 'http://www.themindelectric.net:8005/glue/round2', 'http://www.themindelectric.net:8005/glue/round2.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (13, 'HP SOAP', 'http://soap.bluestone.com/hpws/soap/EchoService', 'http://soap.bluestone.com/hpws/soap/EchoService.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (14, 'IONA XMLBus', 'http://interop.xmlbus.com:7002/xmlbus/container/InteropTest/BaseService/BasePort', 'http://interop.xmlbus.com:7002/xmlbus/container/InteropTest/BaseService/BasePort', 'base', 1); -INSERT INTO endpoints VALUES (15, 'IONA XMLBus (CORBA)', 'http://interop.xmlbus.com:7002/xmlbus/container/CORBAInterop/BaseService/BasePort', 'http://interop.xmlbus.com:7002/xmlbus/container/CORBAInterop/BaseService/BasePort', 'base', 1); -INSERT INTO endpoints VALUES (16, 'kSOAP', 'http://kissen.cs.uni-dortmund.de:8080/ksoapinterop', 'http://www.whitemesa.com/interop/kSOAP.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (17, 'MS .NET Remoting', 'http://www.mssoapinterop.org/remoting/ServiceA.soap', 'http://www.mssoapinterop.org/remoting/ServiceA.soap?wsdl', 'base', 1); -INSERT INTO endpoints VALUES (18, 'MS SOAP ToolKit 2.0', 'http://mssoapinterop.org/stk/Interop.wsdl', 'http://mssoapinterop.org/stk/Interop.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (19, 'MS SOAP ToolKit 3.0', 'http://mssoapinterop.org/stkV3/Interop.wsdl', 'http://mssoapinterop.org/stkV3/Interop.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (20, 'NuSOAP', 'http://dietrich.ganx4.com/nusoap/testbed/round2_base_server.php', 'http://dietrich.ganx4.com/nusoap/testbed/round2_base.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (21, 'OpenLink', 'http://demo.openlinksw.com:8890/Interop', 'http://demo.openlinksw.com:8890/Interop/services.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (24, 'SIM', 'http://soapinterop.simdb.com/round2', 'http://soapinterop.simdb.com/round2?WSDL', 'base', 1); -INSERT INTO endpoints VALUES (25, 'SOAP4R', 'http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInterop/', 'http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInterop/SOAP4R_SOAPBuildersInteropTest_R2base.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (26, 'SOAP:Lite', 'http://services.soaplite.com/interop.cgi', 'http://services.soaplite.com/interop2.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (27, 'Spheon JSOAP', 'http://213.23.125.181:8081/RPC', 'http://213.23.125.181:8081/interop.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (28, 'Spray 2001', 'http://www.dolphinharbor.org/services/interop2001', 'http://www.dolphinharbor.org/services/interop2001/service.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (29, 'SQLData SOAP Server', 'http://soapclient.com/interop/sqldatainterop.wsdl', 'http://soapclient.com/interop/sqldatainterop.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (30, 'WASP Advanced 3.0', 'http://soap.systinet.net:6060/InteropService/', 'http://soap.systinet.net:6060/InteropService/', 'base', 1); -INSERT INTO endpoints VALUES (32, 'White Mesa SOAP Server', 'http://www.whitemesa.net/interop/std', 'http://www.whitemesa.net/wsdl/std/interop.wsdl', 'base', 1); -INSERT INTO endpoints VALUES (33, 'PEAR SOAP', 'http://localhost/soap_interop/server_round2.php', 'http://localhost/soap_interop/interop.wsdl.php', 'base', 1); -INSERT INTO endpoints VALUES (34, '4s4c', 'http://soap.4s4c.com/ilab/soap.asp', 'http://www.pocketsoap.com/services/ilab_b.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (35, '4s4c v2.0', 'http://soap.4s4c.com/ilab2/soap.asp', 'http://soap.4s4c.com/ilab2/ilab_b.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (36, 'Apache Axis', 'http://nagoya.apache.org:5049/axis/services/echo', 'http://nagoya.apache.org:5049/axis/services/echo?wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (37, 'ASP.NET Web Services', 'http://www.mssoapinterop.org/asmx/simpleB.asmx', 'http://www.mssoapinterop.org/asmx/simpleb.asmx?wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (38, 'Delphi SOAP', 'http://soap-server.borland.com/WebServices/Interop/cgi-bin/InteropGroupB.exe/soap/InteropTestPortTypeB', 'http://soap-server.borland.com/WebServices/Interop/cgi-bin/InteropGroupB.exe/wsdl/InteropTestPortTypeB', 'GroupB', 1); -INSERT INTO endpoints VALUES (39, 'EasySoap++', 'http://easysoap.sourceforge.net/cgi-bin/interopserver', 'http://easysoap.sourceforge.net/interopB.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (40, 'GLUE', 'http://www.themindelectric.net:8005/glue/round2B', 'http://www.themindelectric.net:8005/glue/round2B.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (41, 'gSOAP', 'http://websrv.cs.fsu.edu/~engelen/interop2B.cgi', 'http://www.cs.fsu.edu/~engelen/interop2B.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (42, 'HP SOAP', 'http://soap.bluestone.com/hpws/soap/EchoService', 'http://soap.bluestone.com/hpws/soap/EchoService.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (43, 'IONA XMLBus', 'http://interop.xmlbus.com:7002/xmlbus/container/InteropTest/GroupBService/GroupBPort', 'http://interop.xmlbus.com:7002/xmlbus/container/InteropTest/GroupBService/GroupBPort', 'GroupB', 1); -INSERT INTO endpoints VALUES (44, 'MS .NET Remoting', 'http://www.mssoapinterop.org/remoting/ServiceB.soap', 'http://www.mssoapinterop.org/remoting/ServiceB.soap?wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (45, 'MS SOAP ToolKit 2.0', 'http://mssoapinterop.org/stk/InteropBtyped.wsdl', 'http://mssoapinterop.org/stk/InteropBtyped.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (46, 'MS SOAP ToolKit 3.0', 'http://mssoapinterop.org/stkV3/InteropB.wsdl', 'http://mssoapinterop.org/stkV3/InteropB.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (47, 'NuSOAP', 'http://dietrich.ganx4.com/nusoap/testbed/round2_groupb_server.php', 'http://dietrich.ganx4.com/nusoap/testbed/round2_groupb.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (48, 'OpenLink', 'http://demo.openlinksw.com:8890/Interop', 'http://demo.openlinksw.com:8890/Interop/services.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (50, 'SIM', 'http://soapinterop.simdb.com/round2B', 'http://soapinterop.simdb.com/round2B?WSDL', 'GroupB', 1); -INSERT INTO endpoints VALUES (51, 'SOAP4R', 'http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInterop/', 'http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInterop/SOAP4R_SOAPBuildersInteropTest_R2GroupB.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (52, 'SOAP:Lite', 'http://services.soaplite.com/interop.cgi', 'http://services.soaplite.com/InteropTestB.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (53, 'Spheon JSOAP', 'http://213.23.125.181:8081/RPC', 'http://213.23.125.181:8081/interopb.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (54, 'Spray 2001', 'http://www.dolphinharbor.org/services/interopB2001', 'http://www.dolphinharbor.org/services/interopB2001/service.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (55, 'SQLData SOAP Server', 'http://soapclient.com/interop/InteropB.wsdl', 'http://soapclient.com/interop/InteropB.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (56, 'WASP Advanced 3.0', 'http://soap.systinet.net:6060/InteropBService/', 'http://soap.systinet.net:6060/InteropBService/', 'GroupB', 1); -INSERT INTO endpoints VALUES (58, 'White Mesa SOAP Server', 'http://www.whitemesa.net/interop/std/groupB', 'http://www.whitemesa.net/wsdl/std/interopB.wsdl', 'GroupB', 1); -INSERT INTO endpoints VALUES (59, 'PEAR SOAP', 'http://localhost/soap_interop/server_round2.php', 'http://localhost/soap_interop/interopB.wsdl.php', 'GroupB', 1); -INSERT INTO endpoints VALUES (60, '4s4c v2.0', 'http://soap.4s4c.com/ilab2/soap.asp', 'http://soap.4s4c.com/ilab2/ilab_c.wsdl', 'GroupC', 1); -INSERT INTO endpoints VALUES (61, 'Apache Axis', 'http://nagoya.apache.org:5049/axis/services/echo', 'http://nagoya.apache.org:5049/axis/services/echo?wsdl', 'GroupC', 1); -INSERT INTO endpoints VALUES (62, 'ASP.NET Web Services', 'http://mssoapinterop.org/asmx/header.asmx', 'http://mssoapinterop.org/asmx/header.asmx?wsdl', 'GroupC', 1); -INSERT INTO endpoints VALUES (63, 'EasySoap++', 'http://easysoap.sourceforge.net/cgi-bin/interopserver', 'http://easysoap.sourceforge.net/interopC.wsdl', 'GroupC', 1); -INSERT INTO endpoints VALUES (64, 'MS SOAP ToolKit 2.0', 'http://mssoapinterop.org/stk/InteropC.wsdl', 'http://mssoapinterop.org/stk/InteropC.wsdl', 'GroupC', 1); -INSERT INTO endpoints VALUES (65, 'MS SOAP ToolKit 3.0', 'http://mssoapinterop.org/stkV3/InteropC.wsdl', 'http://mssoapinterop.org/stkV3/InteropC.wsdl', 'GroupC', 1); -INSERT INTO endpoints VALUES (66, 'OpenLink', 'http://demo.openlinksw.com:8890/Interop', 'http://demo.openlinksw.com:8890/Interop/services.wsdl', 'GroupC', 1); -INSERT INTO endpoints VALUES (67, 'SOAP:Lite', 'http://services.soaplite.com/interopC.cgi', 'http://services.soaplite.com/InteropTestC.wsdl', 'GroupC', 1); -INSERT INTO endpoints VALUES (68, 'Spray 2001', 'http://www.dolphinharbor.org/services/interopC', 'http://www.dolphinharbor.org/services/interopC/service.wsdl', 'GroupC', 1); -INSERT INTO endpoints VALUES (69, 'SQLData SOAP Server', 'http://soapclient.com/interop/interopC.wsdl', 'http://soapclient.com/interop/interopC.wsdl', 'GroupC', 1); -INSERT INTO endpoints VALUES (70, 'WASP Advanced 3.0', 'http://soap.systinet.net:6060/InteropCService/', 'http://soap.systinet.net:6060/InteropCService/', 'GroupC', 1); -INSERT INTO endpoints VALUES (71, 'White Mesa SOAP Server', 'http://www.whitemesa.net/interop/std/echohdr', 'http://www.whitemesa.net/wsdl/std/echoheadersvc.wsdl', 'GroupC', 1); -INSERT INTO endpoints VALUES (72, 'PEAR SOAP', 'http://localhost/soap_interop/server_round2.php', 'http://localhost/soap_interop/echoheadersvc.wsdl.php', 'GroupC', 1); - - - diff --git a/ext/soap/interop/index.php b/ext/soap/interop/index.php index ed222479b2..7c63ebf79f 100644 --- a/ext/soap/interop/index.php +++ b/ext/soap/interop/index.php @@ -7,10 +7,9 @@ <?php // get our endpoint $server = $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT']; -$endpoint = 'http://'.$server."/soap_interop/server_round2.php"; -$base = 'http://'.$server."/soap_interop/interop.wsdl"; -$groupb = 'http://'.$server."/soap_interop/interopB.wsdl"; -$groupc = 'http://'.$server."/soap_interop/echoheadersvc.wsdl"; +$base = 'http://'.$server.dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php"; +$groupb = 'http://'.$server.dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php"; +$groupc = 'http://'.$server.dirname($_SERVER['PHP_SELF'])."/echoheadersvc.wsdl.php"; ?> <body> @@ -21,7 +20,6 @@ at <a href="http://www.whitemesa.com/interop.htm">White Mesa</a>.</p> <p>Currently Round 2 base, Group B and Group C interop tests are enabled.</p> <h3>Round 2 Interop Server</h3> -Endpoint: <?php echo $endpoint; ?><br> Base WSDL: <a href="<?php echo $base ?>"><?php echo $base ?></a><br> Group B WSDL: <a href="<?php echo $groupb ?>"><?php echo $groupb ?></a><br> Group C WSDL: <a href="<?php echo $groupc ?>"><?php echo $groupc ?></a><br> diff --git a/ext/soap/interop/info.php b/ext/soap/interop/info.php deleted file mode 100644 index 147cebcdd4..0000000000 --- a/ext/soap/interop/info.php +++ /dev/null @@ -1 +0,0 @@ -<?php phpinfo(); ?> diff --git a/ext/soap/interop/interop.wsdl b/ext/soap/interop/interop.wsdl deleted file mode 100644 index 6a835b571f..0000000000 --- a/ext/soap/interop/interop.wsdl +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0"?> - -<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" - xmlns="http://schemas.xmlsoap.org/wsdl/" - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:tns="http://soapinterop.org/"> - - <import location="http://www.whitemesa.com/wsdl/wmmsgrouter.xsd" namespace="http://whitemesa.com/headers/soapmsgrouter.xsd"/> - <import location="http://www.whitemesa.com/interop/InteropTest.wsdl" namespace="http://soapinterop.org/"/> - <import location="http://www.whitemesa.com/interop/InteropTest.wsdl" namespace="http://soapinterop.org/xsd"/> - - <service name="interopLab"> - <port name="interopTestPort" binding="tns:InteropTestSoapBinding"> - <soap:address location="http://localhost/soap_interop/server_round2.php"/> - </port> - </service> - -</definitions> diff --git a/ext/soap/interop/interop.wsdl.php b/ext/soap/interop/interop.wsdl.php new file mode 100644 index 0000000000..e71a19c76d --- /dev/null +++ b/ext/soap/interop/interop.wsdl.php @@ -0,0 +1,335 @@ +<?php +header("Content-Type: text/xml"); +echo '<?xml version="1.0"?>'; +echo "\n"; +?> +<definitions name="InteropTest" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" + xmlns:tns="http://soapinterop.org/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns="http://schemas.xmlsoap.org/wsdl/" + targetNamespace="http://soapinterop.org/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/"> + <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> + <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" /> + <xsd:complexType name="ArrayOfstring"> + <xsd:complexContent> + <xsd:restriction base="SOAP-ENC:Array"> + <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="ArrayOfint"> + <xsd:complexContent> + <xsd:restriction base="SOAP-ENC:Array"> + <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="ArrayOffloat"> + <xsd:complexContent> + <xsd:restriction base="SOAP-ENC:Array"> + <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="SOAPStruct"> + <xsd:all> + <xsd:element name="varString" type="string"/> + <xsd:element name="varInt" type="int"/> + <xsd:element name="varFloat" type="float"/> + </xsd:all> + </xsd:complexType> + <xsd:complexType name="ArrayOfSOAPStruct"> + <xsd:complexContent> + <xsd:restriction base="SOAP-ENC:Array"> + <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:SOAPStruct[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string" /> + </message> + <message name="echoStringResponse"> + <part name="outputString" type="xsd:string" /> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="tns:ArrayOfstring" /> + </message> + <message name="echoStringArrayResponse"> + <part name="outputStringArray" type="tns:ArrayOfstring" /> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int" /> + </message> + <message name="echoIntegerResponse"> + <part name="outputInteger" type="xsd:int" /> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="tns:ArrayOfint" /> + </message> + <message name="echoIntegerArrayResponse"> + <part name="outputIntegerArray" type="tns:ArrayOfint" /> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float" /> + </message> + <message name="echoFloatResponse"> + <part name="outputFloat" type="xsd:float" /> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="tns:ArrayOffloat" /> + </message> + <message name="echoFloatArrayResponse"> + <part name="outputFloatArray" type="tns:ArrayOffloat" /> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="tns:SOAPStruct" /> + </message> + <message name="echoStructResponse"> + <part name="outputStruct" type="tns:SOAPStruct" /> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="tns:ArrayOfSOAPStruct" /> + </message> + <message name="echoStructArrayResponse"> + <part name="outputStructArray" type="tns:ArrayOfSOAPStruct" /> + </message> + <message name="echoVoidRequest"> + </message> + <message name="echoVoidResponse"> + </message> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary" /> + </message> + <message name="echoBase64Response"> + <part name="outputBase64" type="xsd:base64Binary" /> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime" /> + </message> + <message name="echoDateResponse"> + <part name="outputDate" type="xsd:dateTime" /> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary" /> + </message> + <message name="echoHexBinaryResponse"> + <part name="outputHexBinary" type="xsd:hexBinary" /> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal" /> + </message> + <message name="echoDecimalResponse"> + <part name="outputDecimal" type="xsd:decimal" /> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean" /> + </message> + <message name="echoBooleanResponse"> + <part name="outputBoolean" type="xsd:boolean" /> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="http://" style="rpc"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + + <service name="InteropTest"> + <port name="InteropTestPort" binding="tns:InteropTestBinding"> + <soap:address location="http://<?php echo ($_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']));?>/server_round2_base.php"/> + </port> + </service> + +</definitions> diff --git a/ext/soap/interop/interopB.wsdl b/ext/soap/interop/interopB.wsdl deleted file mode 100644 index 92301af334..0000000000 --- a/ext/soap/interop/interopB.wsdl +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0"?> -<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> - - <import location="http://www.whitemesa.com/interop/InteropTestB.wsdl" namespace="http://soapinterop.org/"/> - <import location="http://www.whitemesa.com/interop/InteropTestB.wsdl" namespace="http://soapinterop.org/xsd"/> - - <service name="interopLabB"> - <port name="interopTestPortB" binding="tns:InteropTestSoapBindingB"> - <soap:address location="http://localhost/soap_interop/server_round2.php"/> - </port> - </service> - -</definitions> diff --git a/ext/soap/interop/server_round2.php b/ext/soap/interop/server_round2.php deleted file mode 100644 index a8eafe1eb2..0000000000 --- a/ext/soap/interop/server_round2.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -// -// +----------------------------------------------------------------------+ -// | PHP Version 4 | -// +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 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$ -// - -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(isset($HTTP_RAW_POST_DATA)?$HTTP_RAW_POST_DATA:NULL); -#echo "Content-Length is {$_SERVER['CONTENT_LENGTH']}\n\n"; -#echo "<!---\n\nlen:".strlen($HTTP_RAW_POST_DATA)."\n\n"; -#echo "[$HTTP_RAW_POST_DATA"; -#print "]\n\nend of input data-->"; -?>
\ No newline at end of file diff --git a/ext/soap/interop/server_round2_base.php b/ext/soap/interop/server_round2_base.php index 15dc48e565..314a5c85e2 100644 --- a/ext/soap/interop/server_round2_base.php +++ b/ext/soap/interop/server_round2_base.php @@ -19,7 +19,6 @@ // // $Id$ // -require_once 'SOAP/Server.php'; function generateFault($short, $long) { @@ -42,7 +41,7 @@ function hex2bin($data) class SOAP_Interop_Base { var $method_namespace = 'http://soapinterop.org/'; - + function SOAP_Interop_Base() { #if ($server) { # $server->addToMap("echoString",array("string"),array("string")); @@ -64,121 +63,83 @@ class SOAP_Interop_Base { function echoString($inputString) { - return new SOAP_Value('outputString','string',$inputString); + return $inputString; } function echoStringArray($inputStringArray) { - $ra = array(); - if ($inputStringArray) { - foreach($inputStringArray as $s) { - $ra[] = new SOAP_Value('item','string',$s); - } - } - return new SOAP_Value('outputStringArray',NULL,$ra); + return $inputStringArray; } function echoInteger($inputInteger) { - return new SOAP_Value('outputInteger','int',(integer)$inputInteger); + return $inputInteger; } function echoIntegerArray($inputIntegerArray) { - $ra = array(); - if ($inputIntegerArray) { - foreach ($inputIntegerArray as $i) { - $ra[] = new SOAP_Value('item','int',$i); - } - } - return new SOAP_Value('outputIntArray',NULL,$ra); + return $inputIntegerArray; } function echoFloat($inputFloat) { - return new SOAP_Value('outputFloat','float',(FLOAT)$inputFloat); + return $inputFloat; } function echoFloatArray($inputFloatArray) { - $ra = array(); - if ($inputFloatArray) { - foreach($inputFloatArray as $float) { - $ra[] = new SOAP_Value('item','float',(FLOAT)$float); - } - } - return new SOAP_Value('outputFloatArray',NULL,$ra); + return $inputFloatArray; } function echoStruct($inputStruct) { - return new SOAP_Value('return','{http://soapinterop.org/xsd}SOAPStruct', - array( - new SOAP_Value('varInt','int',$inputStruct['varInt']), - new SOAP_Value('varFloat','float',$inputStruct['varFloat']), - new SOAP_Value('varString','string',$inputStruct['varString']) - )); + return $inputStruct; } function echoStructArray($inputStructArray) { - $ra = array(); - if ($inputStructArray) { - foreach($inputStructArray as $struct) { - $ra[] = new SOAP_Value('item','{http://soapinterop.org/xsd}SOAPStruct', - array( - new SOAP_Value('varInt','int',$struct['varInt']), - new SOAP_Value('varFloat','float',$struct['varFloat']), - new SOAP_Value('varString','string',$struct['varString']) - )); - } - } - return $ra; + return $inputStructArray; } function echoVoid() { - return NULL; + return NULL; } function echoBase64($b_encoded) { - return new SOAP_Value('return','base64Binary',base64_encode(base64_decode($b_encoded))); + return $b_encoded; } function echoDate($timeInstant) { - $dt = new SOAP_Type_dateTime($timeInstant); - if ($dt->toUnixtime() != -1) { - $value = $dt->toSOAP(); - return new SOAP_Value('return','dateTime',$value); - } else { - return new SOAP_Fault("Value $timeInstant is not a dateTime value"); - } + return $timeInstant; } function echoHexBinary($hb) { - return new SOAP_Value('return','hexBinary',bin2hex(hex2bin($hb))); + return $hb; } function echoDecimal($dec) { - return new SOAP_Value('return','decimal',(FLOAT)$dec); + return $dec; } function echoBoolean($boolean) { - return new SOAP_Value('return','boolean',$boolean); + return $boolean; } - + function echoMimeAttachment($stuff) { return new SOAP_Attachment('return','application/octet-stream',NULL,$stuff); } } -$base = new SOAP_Interop_Base(); -$server->addObjectMap($base); +$server = new SoapServer("http://test-uri"); +$server->bind("http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php"); +$server->setClass("SOAP_Interop_Base"); +$server->handle(); ?>
\ No newline at end of file diff --git a/ext/soap/interop/server_round2_groupB.php b/ext/soap/interop/server_round2_groupB.php index fa5856a26e..dc36aa5027 100644 --- a/ext/soap/interop/server_round2_groupB.php +++ b/ext/soap/interop/server_round2_groupB.php @@ -19,69 +19,52 @@ // // $Id$ // -require_once 'SOAP/Server.php'; class SOAP_Interop_GroupB { var $method_namespace = 'http://soapinterop.org/'; var $dispatch_map = array(); - + function SOAP_Interop_GroupB() { - $this->dispatch_map['echoStructAsSimpleTypes'] = - array('in' => array('inputStruct' => 'SOAPStruct'), - 'out' => 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()); + $this->dispatch_map['echoStructAsSimpleTypes'] = + array('in' => array('inputStruct' => 'SOAPStruct'), + 'out' => array('outputString' => 'string', 'outputInteger' => 'int', 'outputFloat' => 'float') + ); + } + function echoStructAsSimpleTypes ($struct) { - # convert a SOAPStruct to an array - $vals = array_values($struct); - return array( - new SOAP_Value('outputString','string',$struct['varString']), - new SOAP_Value('outputInteger','int',$struct['varInt']), - new SOAP_Value('outputFloat','float',$struct['varFloat']) - ); - return array_values($struct); + return array('outputString' => $struct->varString, + 'outputInteger' => $struct->varInt, + 'outputFloat' => $struct->varFloat); } function echoSimpleTypesAsStruct($string, $int, $float) { - # convert a input into struct - $ret = new SOAP_Value('return','{http://soapinterop.org/xsd}SOAPStruct', - array( #push struct elements into one soap value - new SOAP_Value('varString','string',$string), - new SOAP_Value('varInt','int',(int)$int), - new SOAP_Value('varFloat','float',(FLOAT)$float) - ) - ); - return $ret; + return (object)array("varString" => $string, + "varInt" => $int, + "varFloat" => $float); } function echoNestedStruct($struct) { - return $struct; + return $struct; } function echo2DStringArray($ary) { - $ret = new SOAP_Value('return','Array',$ary); - $ret->options['flatten'] = TRUE; - return $ret; +// $ret->options['flatten'] = TRUE; + return $ary; } function echoNestedArray($ary) { - return $ary; + return $ary; } } -$groupb = new SOAP_Interop_GroupB(); -$server->addObjectMap($groupb); - +$server = new SoapServer("http://test-uri"); +$server->bind("http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php"); +$server->setClass("SOAP_Interop_GroupB"); +$server->handle(); ?>
\ No newline at end of file diff --git a/ext/soap/interop/server_round2_groupC.php b/ext/soap/interop/server_round2_groupC.php index b323f9ba06..0c5492cda8 100644 --- a/ext/soap/interop/server_round2_groupC.php +++ b/ext/soap/interop/server_round2_groupC.php @@ -18,12 +18,10 @@ // // $Id$ // -require_once 'SOAP/Server.php'; -require_once 'SOAP/Value.php'; class SOAP_Interop_GroupC { var $method_namespace = 'http://soapinterop.org/echoheader/'; - + function echoMeStringRequest($string) { return new SOAP_Value('{'.$this->method_namespace.'}echoMeStringResponse','string',$string); @@ -35,7 +33,7 @@ class SOAP_Interop_GroupC { } } -$groupc = new SOAP_Interop_GroupC(); -$server->addObjectMap($groupc); - +$server = new SoapServer("http://test-uri"); +$server->setClass("SOAP_Interop_GroupC"); +$server->handle(); ?>
\ No newline at end of file diff --git a/ext/soap/interop/server_round2_test.php b/ext/soap/interop/server_round2_test.php deleted file mode 100644 index 3c050f7a1b..0000000000 --- a/ext/soap/interop/server_round2_test.php +++ /dev/null @@ -1,258 +0,0 @@ -<?php -// -// +----------------------------------------------------------------------+ -// | PHP Version 4 | -// +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 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$ -// - -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"></inputString> -</ns7:echoString> -</SOAP-ENV:Body> -</SOAP-ENV:Envelope> -'; -$test = '<?xml version="1.0" encoding="US-ASCII"?> - -<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/" - SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> -<SOAP-ENV:Body> -<ns6:echoVoid/> -</SOAP-ENV:Body> -</SOAP-ENV:Envelope>'; - -$test = '<?xml version="1.0" encoding="US-ASCII"?> - -<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/" - SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> -<SOAP-ENV:Body> -<ns6:echoIntegerArray><inputIntegerArray xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:int[3]" SOAP-ENC:offset="[0]"><item xsi:type="xsd:int">1</item> -<item xsi:type="xsd:int">234324324</item> -<item xsi:type="xsd:int">2</item> -</inputIntegerArray> -</ns6:echoIntegerArray> -</SOAP-ENV:Body> -</SOAP-ENV:Envelope>'; - -#$test = "<S:Envelope -#S:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' -#xmlns:Enc='http://schemas.xmlsoap.org/soap/encoding/' -#xmlns:S='http://schemas.xmlsoap.org/soap/envelope/' -#xmlns:a='http://soapinterop.org/' -#xmlns:b='http://soapinterop.org/xsd' -#xmlns:XS='http://www.w3.org/2001/XMLSchema' -#xmlns:XI='http://www.w3.org/2001/XMLSchema-instance'> -#<S:Body> -#<b:SOAPStruct Enc:root='0' id='21b56c4' XI:type='b:SOAPStruct'> -#<varInt XI:type='XS:int'>1</varInt> -#<varFloat XI:type='XS:float'>2</varFloat> -#<varString XI:type='XS:string'>wilma</varString> -#</b:SOAPStruct> -#<a:echoStructArray> -#<inputStructArray XI:type='Enc:Array' Enc:arrayType='XS:anyType[3]'> -#<fred href='#21b56c4'/> -#<i href='#21b56c4'/> -#<i href='#21b56c4'/> -#</inputStructArray> -#</a:echoStructArray> -#</S:Body></S:Envelope>"; - -#$test = "<S:Envelope S:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:Enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:S='http://schemas.xmlsoap.org/soap/envelope/' xmlns:a='http://soapinterop.org/' xmlns:b='http://soapinterop.org/xsd' xmlns:XS='http://www.w3.org/2001/XMLSchema' xmlns:XI='http://www.w3.org/2001/XMLSchema-instance'> <S:Body><a:echoStructArray><inputStructArray XI:type='Enc:Array' Enc:arrayType='b:SOAPStruct[2]'><inputStruct href='#213e654'/> <inputStruct href='#21b8c4c'/> </inputStructArray> </a:echoStructArray> <b:SOAPStruct Enc:root='0' id='21b8c4c' XI:type='b:SOAPStruct'><varInt XI:type='XS:int'>-1</varInt> <varFloat XI:type='XS:float'>-1</varFloat> <varString XI:type='XS:string'>lean on into the groove y'all</varString> </b:SOAPStruct> <b:SOAPStruct Enc:root='0' id='213e654' XI:type='b:SOAPStruct'><varInt XI:type='XS:int'>1073741824</varInt> <varFloat XI:type='XS:float'>-42.24</varFloat> <varString XI:type='XS:string'>pocketSOAP rocks!<g></varString> </b:SOAPStruct> </S:Body></S:Envelope>"; - -#$test = "<S:Envelope S:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:S='http://schemas.xmlsoap.org/soap/envelope/' xmlns:b='http://soapinterop.org/' xmlns:a='http://soapinterop.org/headers/' xmlns:XS='http://www.w3.org/2001/XMLSchema' xmlns:XI='http://www.w3.org/2001/XMLSchema-instance'> <S:Header> <a:Transaction S:mustUnderstand='1' XI:type='XS:short'>5</a:Transaction> </S:Header> <S:Body><b:echoString><inputString XI:type='XS:string'>Opps, should never see me</inputString> </b:echoString> </S:Body></S:Envelope>"; -#$test = "<S:Envelope S:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:S='http://schemas.xmlsoap.org/soap/envelope/' xmlns:b='http://soapinterop.org/' xmlns:a='http://soapinterop.org/headers/' xmlns:XS='http://www.w3.org/2001/XMLSchema' xmlns:XI='http://www.w3.org/2001/XMLSchema-instance'> <S:Header> <a:Transaction XI:type='XS:short'>5</a:Transaction> </S:Header> <S:Body><b:echoString><inputString XI:type='XS:string'>Opps, should never see me</inputString> </b:echoString> </S:Body></S:Envelope>"; -#$test = "<S:Envelope S:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:Enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:S='http://schemas.xmlsoap.org/soap/envelope/' xmlns:a='http://soapinterop.org/' xmlns:b='http://soapinterop.org/xsd' xmlns:XS='http://www.w3.org/2001/XMLSchema' xmlns:XI='http://www.w3.org/2001/XMLSchema-instance'> <S:Body><a:echoStructAsSimpleTypes><inputStruct href='#213e59c'/> </a:echoStructAsSimpleTypes> <b:SOAPStruct Enc:root='0' id='213e59c' XI:type='b:SOAPStruct'><varInt XI:type='XS:int'>42</varInt> <varString XI:type='XS:string'>Orbital</varString> <varFloat XI:type='XS:float'>-42.42</varFloat> </b:SOAPStruct> </S:Body></S:Envelope>"; - -// white mesa failures -/*$test = '<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header><h:echoMeStringRequest SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:mustUnderstand="1" xmlns:h="http://unknown.org/">White Mesa Test Header String.</h:echoMeStringRequest></SOAP-ENV:Header><SOAP-ENV:Body><m:echoVoid SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:m="http://soapinterop.org/" /></SOAP-ENV:Body></SOAP-ENV:Envelope>'; -*/ -/* -$test = '<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header><h:echoMeStringRequest SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:mustUnderstand="1" xmlns:h="http://unknown.org/">White Mesa Test Header String.</h:echoMeStringRequest></SOAP-ENV:Header><SOAP-ENV:Body><m:echoVoid SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:m="http://soapinterop.org/" /></SOAP-ENV:Body></SOAP-ENV:Envelope>'; -*/ -//$test = "<S:Envelope S:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:S='http://schemas.xmlsoap.org/soap/envelope/' xmlns:a='http://soapinterop.org/' xmlns:XI='http://www.w3.org/2001/XMLSchema-instance'> <S:Body><a:echoIntegerArray><inputIntegerArray XI:nil='true'></inputIntegerArray> </a:echoIntegerArray> </S:Body></S:Envelope>"; - -$test = '<?xml version="1.0" encoding="UTF-8"?> - -<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:ns4="http://soapinterop.org/" - SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> -<SOAP-ENV:Body> - -<ns4:echo2DStringArray> -<input2DStringArray xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[2,3]"> -<item xsi:type="xsd:string">row0col0</item> -<item xsi:type="xsd:string">row0col1</item> -<item xsi:type="xsd:string">row0col2</item> -<item xsi:type="xsd:string">row1col0</item> -<item xsi:type="xsd:string">row1col1</item> -<item xsi:type="xsd:string">row1col2</item></input2DStringArray></ns4:echo2DStringArray> -</SOAP-ENV:Body> -</SOAP-ENV:Envelope>'; - -$_SERVER['REQUEST_METHOD'] = "POST"; -$_SERVER['CONTENT_TYPE'] = 'multipart/related; type=text/xml; boundary="=_d624611fe466a88d956a205651c74fdb"'; - -$test = '--=_d624611fe466a88d956a205651c74fdb -Content-Type: text/xml; charset="UTF-8" -Content-Transfer-Encoding: base64 - -PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCg0KPFNPQVAtRU5WOkVudmVs -b3BlICB4bWxuczpTT0FQLUVOVj0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZl -bG9wZS8iDQogIHhtbG5zOnhzZD0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiDQog -IHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiDQog -IHhtbG5zOlNPQVAtRU5DPSJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy9zb2FwL2VuY29kaW5n -LyINCiAgU09BUC1FTlY6ZW5jb2RpbmdTdHlsZT0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcv -c29hcC9lbmNvZGluZy8iPg0KPFNPQVAtRU5WOkJvZHk+DQoNCjxlY2hvTWltZUF0dGFjaG1lbnQ+ -DQo8dGVzdCBocmVmPSJjaWQ6ZTZiOTg0M2JiYzUxY2JiMDAzOTk0MGVmN2VlNzY2MDMiLz48L2Vj -aG9NaW1lQXR0YWNobWVudD4NCjwvU09BUC1FTlY6Qm9keT4NCjwvU09BUC1FTlY6RW52ZWxvcGU+ -DQo= ---=_d624611fe466a88d956a205651c74fdb -Content-Disposition: attachment.php -Content-Type: text/plain -Content-Transfer-Encoding: base64 -Content-ID: <e6b9843bbc51cbb0039940ef7ee76603> - -PD9waHANCnJlcXVpcmVfb25jZSgiU09BUC9DbGllbnQucGhwIik7DQpyZXF1aXJlX29uY2UoIlNP -QVAvdGVzdC90ZXN0LnV0aWxpdHkucGhwIik7DQpyZXF1aXJlX29uY2UoIlNPQVAvVmFsdWUucGhw -Iik7DQokc29hcF9iYXNlID0gbmV3IFNPQVBfQmFzZSgpOw0KDQokdiA9ICBuZXcgU09BUF9BdHRh -Y2htZW50KCd0ZXN0JywndGV4dC9wbGFpbicsJ2F0dGFjaG1lbnQucGhwJyk7DQokbWV0aG9kVmFs -dWUgPSBuZXcgU09BUF9WYWx1ZSgndGVzdGF0dGFjaCcsICdTdHJ1Y3QnLCBhcnJheSgkdikpOw0K -DQovLyBzZWUgdGhlIG1pbWUgYXJyYXkNCi8vJHZhbCA9ICRzb2FwX2Jhc2UtPl9tYWtlRW52ZWxv -cGUoJG1ldGhvZFZhbHVlKTsNCi8vcHJpbnRfcigkdmFsKTsNCg0KJGNsaWVudCA9IG5ldyBTT0FQ -X0NsaWVudCgnaHR0cDovL2xvY2FsaG9zdC9zb2FwX2ludGVyb3Avc2VydmVyX3JvdW5kMi5waHAn -KTsNCiRyZXNwID0gJGNsaWVudC0+Y2FsbCgnZWNob01pbWVBdHRhY2htZW50JyxhcnJheSgkdikp -Ow0KcHJpbnRfcigkcmVzcCk7DQpwcmludCAkY2xpZW50LT53aXJlOw0KPz4= ---=_d624611fe466a88d956a205651c74fdb--'; - -$_SERVER['CONTENT_TYPE'] = 'multipart/related; type=text/xml; boundary="=_a2cbb051424cc43e72d3c8c8d0b8f70e"'; -$test='--=_a2cbb051424cc43e72d3c8c8d0b8f70e -Content-Type: text/xml; charset="UTF-8" - -<?xml version="1.0" encoding="UTF-8"?> - -<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/" - SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> -<SOAP-ENV:Body> - -<echoMimeAttachment> -<test href="cid:a223fea3c35b5f0e6dedf8da75efd6b3"/></echoMimeAttachment> -</SOAP-ENV:Body> -</SOAP-ENV:Envelope> - ---=_a2cbb051424cc43e72d3c8c8d0b8f70e -Content-Disposition: attachment.php -Content-Type: text/plain -Content-Transfer-Encoding: base64 -Content-ID: <a223fea3c35b5f0e6dedf8da75efd6b3> - -PD9waHANCnJlcXVpcmVfb25jZSgiU09BUC9DbGllbnQucGhwIik7DQpyZXF1aXJlX29uY2UoIlNP -QVAvdGVzdC90ZXN0LnV0aWxpdHkucGhwIik7DQpyZXF1aXJlX29uY2UoIlNPQVAvVmFsdWUucGhw -Iik7DQokc29hcF9iYXNlID0gbmV3IFNPQVBfQmFzZSgpOw0KDQokdiA9ICBuZXcgU09BUF9BdHRh -Y2htZW50KCd0ZXN0JywndGV4dC9wbGFpbicsJ2F0dGFjaG1lbnQucGhwJyk7DQokbWV0aG9kVmFs -dWUgPSBuZXcgU09BUF9WYWx1ZSgndGVzdGF0dGFjaCcsICdTdHJ1Y3QnLCBhcnJheSgkdikpOw0K -DQovLyBzZWUgdGhlIG1pbWUgYXJyYXkNCi8vJHZhbCA9ICRzb2FwX2Jhc2UtPl9tYWtlRW52ZWxv -cGUoJG1ldGhvZFZhbHVlKTsNCi8vcHJpbnRfcigkdmFsKTsNCg0KJGNsaWVudCA9IG5ldyBTT0FQ -X0NsaWVudCgnaHR0cDovL2xvY2FsaG9zdC9zb2FwX2ludGVyb3Avc2VydmVyX3JvdW5kMi5waHAn -KTsNCiRyZXNwID0gJGNsaWVudC0+Y2FsbCgnZWNob01pbWVBdHRhY2htZW50JyxhcnJheSgkdikp -Ow0KI3ByaW50X3IoJHJlc3ApOw0KcHJpbnQgJGNsaWVudC0+d2lyZTsNCj8+ ---=_a2cbb051424cc43e72d3c8c8d0b8f70e-- -'; -$server->service($test, '',TRUE); -print $server->response; -?>
\ No newline at end of file diff --git a/ext/soap/interop/test.utility.php b/ext/soap/interop/test.utility.php index 9af61c22fb..bfe176dc93 100644 --- a/ext/soap/interop/test.utility.php +++ b/ext/soap/interop/test.utility.php @@ -1,6 +1,4 @@ <?php -require_once("SOAP/Parser.php"); -require_once("SOAP/Value.php"); function number_compare($f1, $f2) { @@ -12,7 +10,8 @@ function number_compare($f1, $f2) $d = max(min(strlen(count($m1)?$m1[1]:'0'),strlen(count($m2)?$m2[1]:'0')),2); $f1 = round($f1, $d); $f2 = round($f2, $d); - return bccomp($f1, $f2, $d) == 0; + return $f1 == $f2; +// return bccomp($f1, $f2, $d) == 0; } function boolean_compare($f1, $f2) @@ -34,30 +33,50 @@ function string_compare($e1, $e2) $e2_type = gettype($e2); $ok = FALSE; if ($e1_type == "string") { - $dt = new SOAP_Type_dateTime(); - $ok = $dt->compare($e1, $e2) == 0; +// $dt = new SOAP_Type_dateTime(); +// $ok = $dt->compare($e1, $e2) == 0; + $oj = false; } return $ok || $e1 == $e2 || strcasecmp(trim($e1), trim($e2)) == 0; } -function array_compare(&$ar1, &$ar2) -{ - if (gettype($ar1) != 'array' || gettype($ar2) != 'array') return FALSE; - # first a shallow diff - if (count($ar1) != count($ar2)) return FALSE; - $diff = array_diff($ar1, $ar2); - if (count($diff) == 0) return TRUE; +function array_compare(&$ar1, &$ar2) { + if (gettype($ar1) != 'array' || gettype($ar2) != 'array') return FALSE; + if (count($ar1) != count($ar2)) return FALSE; + foreach ($ar1 as $k => $v) { + if (!array_key_exists($k,$ar2)) return FALSE; + if (!compare($v,$ar2[$k])) return FALSE; + } + return TRUE; +} - # diff failed, do a full check of the array - foreach ($ar1 as $k => $v) { - #print "comparing $v == $ar2[$k]\n"; - if (gettype($v) == "array") { - if (!array_compare($v, $ar2[$k])) return FALSE; - } else { - if (!string_compare($v, $ar2[$k])) return FALSE; - } +function object_compare(&$obj1, &$obj2) { + if (gettype($obj1) != 'object' || gettype($obj2) != 'object') return FALSE; +// if (class_name(obj1) != class_name(obj2)) return FALSE; + $ar1 = (array)$obj1; + $ar2 = (array)$obj2; + return array_compare($ar1,$ar2); +} + +function compare(&$x,&$y) { + $ok = 0; + $x_type = gettype($x); + $y_type = gettype($y); + if ($x_type == $y_type) { + if ($x_type == "array") { + $ok = array_compare($x, $y); + } else if ($x_type == "object") { + $ok = object_compare($x, $y); + } else if ($x_type == "double") { + $ok = number_compare($x, $y); +// } else if ($x_type == 'boolean') { +// $ok = boolean_compare($x, $y); + } else { + $ok = ($x == $y); +// $ok = string_compare($expect, $result); } - return TRUE; + } + return $ok; } @@ -77,5 +96,12 @@ function parseMessage($msg) return $v; } +function var_dump_str($var) { + ob_start(); + var_dump($var); + $res = ob_get_contents(); + ob_end_clean(); + return $res; +} ?>
\ No newline at end of file diff --git a/ext/soap/interop/testclient.php b/ext/soap/interop/testclient.php deleted file mode 100644 index b70c628ee5..0000000000 --- a/ext/soap/interop/testclient.php +++ /dev/null @@ -1,17 +0,0 @@ -<html><body> -<? -error_reporting(2039); -include("SOAP/Client.php"); - -$txt = "Bjoern"; - -$soapc = new SOAP_Client("http://localhost/soap_interop/testserver.php"); -$soapc->debug_flag = TRUE; -print_r($soapc->call("testMethod",array("txt" => $txt))); -print "<br>Debug: "; -print $soapc->wire; -print "<br><br>"; -unset($soapc); - -?> -</html></body>
\ No newline at end of file diff --git a/ext/soap/interop/testserver.php b/ext/soap/interop/testserver.php deleted file mode 100644 index 03973c8863..0000000000 --- a/ext/soap/interop/testserver.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -include "SOAP/Server.php"; - -function testMethod($arg) { - if ($arg != "") { - return crypt($arg); - } else { - return "Please supply a text"; - } -} - -$server = new soap_server(); - -$server->addToMap("testMethod",array("string"),array("string")); -$server->service($HTTP_RAW_POST_DATA); -echo "<!-- this is a test -->"; -?>
\ No newline at end of file |
