cvs: pear /SOAP_Interop interop_client.php interop_client_run.php params_Round2GroupB.php params_Round2GroupC.php params_Round3GroupD.php
params_classes.php params_values.php /SOAP_Interop/wsdl/imported import1B.wsdl import2B.wsdl import2B.xsd
| From: | Shane Caraveo | Date: | Sun, 29 Sep 2002 01:02:57 +0000 |
| Subject: | cvs: pear /SOAP_Interop interop_client.php interop_client_run.php params_Round2GroupB.php params_Round2GroupC.php params_Round3GroupD.php params_classes.php params_values.php /SOAP_Interop/wsdl/imported import1B.wsdl import2B.wsdl import2B.xsd |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-6739@lists.php.net to get a copy of this message | ||
shane Sat Sep 28 21:02:57 2002 EDT
Added files:
/pear/SOAP_Interop/wsdl/imported import1B.wsdl import2B.wsdl
import2B.xsd
Modified files:
/pear/SOAP_Interop interop_client.php interop_client_run.php
params_Round2GroupB.php params_Round2GroupC.php
params_Round3GroupD.php params_classes.php
params_values.php
Log:
more interop work
Index: pear/SOAP_Interop/interop_client.php diff -u pear/SOAP_Interop/interop_client.php:1.1 pear/SOAP_Interop/interop_client.php:1.2 --- pear/SOAP_Interop/interop_client.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/interop_client.php Sat Sep 28 21:02:56 2002 @@ -16,13 +16,14 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: interop_client.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: interop_client.php,v 1.2 2002/09/29 01:02:56 shane Exp $ // require_once 'DB.php'; // PEAR/DB require_once 'SOAP/Client.php'; require_once 'config.php'; require_once 'interop_test_functions.php'; +require_once 'interop_wrapper.php'; require_once 'params_Round2Base.php'; require_once 'params_Round2GroupB.php'; require_once 'params_Round2GroupC.php'; @@ -51,6 +52,7 @@ var $testMethod = ''; // test only this method var $skipEndpointList = array(); // endpoints to skip var $nosave = 0; + var $client_type = 'pear'; // name of client // debug output var $show = 1; @@ -149,8 +151,8 @@ function _saveResults($endpoint_id, &$soap_test) { if ($this->nosave) return; - $result = $soap_test->result; - $wire = $result['wire']; + $result =& $soap_test->result; + $wire =& $result['wire']; if ($result['success']) { $success = 'OK'; $error = ''; @@ -180,7 +182,7 @@ $sql = "delete from results where endpoint=$endpoint_id ". "and class='$this->currentTest' and type='$this->paramType' ". - "and wsdl=$this->useWSDL and function=". + "and wsdl=$this->useWSDL and client='$this->client_type' and function=". $this->dbc->quote($test_name); #echo "\n".$sql; $res = $this->dbc->query($sql); @@ -189,8 +191,8 @@ } 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',". + $sql = "insert into results (client,endpoint,stamp,class,type,wsdl,function,result,error,wire) ". + "values('$this->client_type',$endpoint_id,".time().",'$this->currentTest',". "'$this->paramType',$this->useWSDL,". $this->dbc->quote($test_name).",". $this->dbc->quote($success).",". @@ -205,39 +207,6 @@ if (is_object($res)) $res->free(); } - function &_decodeSoapval(&$soapval) - { - if (gettype($soapval) == "object" && - (strcasecmp(get_class($soapval),"SOAP_Value") == 0 || - strcasecmp(get_class($soapval),"SOAP_Header") == 0)) { - $val = $this->decode($soapval); - } else { - $val = $soapval; - } - return $val; - } - - /** - * decodeSoapval - * decodes a soap value to php type, used for test result comparisions - * - * @param SOAP_Value soapval - * @return mixed result - * @access public - */ - function &decodeSoapval(&$soapval) - { - if (is_array($soapval)) { - $c = count($soapval); - for ($i=0; $i<$c; $i++) { - $val[$i] = $this->_decodeSoapval($soapval[$i]); - } - } else { - $val = $this->_decodeSoapval($soapval); - } - return $val; - } - /** * compareResult * compare two php types for a match @@ -289,17 +258,18 @@ if ($endpoint_info->wsdlURL) { if (!$endpoint_info->client) { $endpoint_info->client = new SOAP_Client($endpoint_info->wsdlURL,1); + $endpoint_info->client->_auto_translation = true; } - $soap =& $endpoint_info->client; - if ($soap->wsdl->fault) { - $fault = $soap->wsdl->fault->getFault(); + if ($endpoint_info->client->_wsdl->__isfault()) { + $fault = $endpoint_info->client->_wsdl->fault->getFault(); $soap_test->setResult(0,'WSDL', - $fault->faultstring."\n\n".$fault->faultdetail, - $fault->faultstring, - $fault - ); + $fault->faultstring."\n\n".$fault->faultdetail, + $fault->faultstring, + $fault + ); return FALSE; } + $soap =& $endpoint_info->client; } else { $fault = array( 'faultcode'=>'WSDL', @@ -314,10 +284,6 @@ $namespace = false; $soapaction = false; } else { - if (!$endpoint_info->client) { - $endpoint_info->client = new SOAP_Client($endpoint_info->endpointURL); - } - $soap = &$endpoint_info->client; $namespace = $soapaction = 'http://soapinterop.org/'; // hack to make tests work with MS SoapToolkit // it's the only one that uses this soapaction, and breaks if @@ -327,6 +293,11 @@ strstr($endpoint_info->name,'MS SOAP ToolKit 2.0')) { $soapaction = 'urn:soapinterop'; } + if (!$endpoint_info->client) { + $endpoint_info->client = new SOAP_Client($endpoint_info->endpointURL); + $endpoint_info->client->_auto_translation = true; + } + $soap = &$endpoint_info->client; } // for round3 testing @@ -376,7 +347,7 @@ $ok = !$need_result || $this->compareResult($hresult ,$expect[key($expect)]); } else { $hresult = $soap->headersIn[$header->name]; - $expect = $soap->decode($header); + $expect = $soap->_decode($header); $ok = !$need_result || $this->compareResult($hresult ,$expect); } $header_result[$header->name]['ok'] = $ok; @@ -387,7 +358,7 @@ # we need to decode what we sent so we can compare! if (gettype($sent)=='object' && (get_class($sent)=='soap_value' || is_subclass_of($sent,'soap_value'))) - $sent_d = $soap->decode($sent); + $sent_d = $soap->_decode($sent); else $sent_d =& $sent; @@ -405,12 +376,12 @@ $fault->faultcode = 'HEADER'; $fault->faultstring = 'The returned result did not match what we expected to receive'; $soap_test->setResult(0,$fault->faultcode, - $soap->wire, + $soap->__get_wire(), $fault->faultstring, $fault ); } else { - $soap_test->setResult(1,'OK',$soap->wire); + $soap_test->setResult(1,'OK',$soap->__get_wire()); $success = TRUE; } } else { @@ -420,7 +391,7 @@ $fault->faultdetail = ''/*"SENT:\n".var_export($soap_test->result['sent']). "\n\nRECIEVED:\n".var_export($soap_test->result['return'])*/; $soap_test->setResult(0,$fault->faultcode, - $soap->wire, + $soap->__get_wire(), $fault->faultstring, $fault ); @@ -434,7 +405,7 @@ $ok = 0; $res =$fault->faultcode; } - $soap_test->setResult($ok,$res, $soap->wire,$fault->faultstring, $fault); + $soap_test->setResult($ok,$res, $soap->__get_wire(),$fault->faultstring, $fault); } return $ok; } @@ -525,12 +496,14 @@ $this->totals['fail']++; } else { // run the endpoint test + unset($soap_test->result); if ($this->doEndpointMethod($endpoint_info, $soap_test)) { $this->totals['success']++; } else { $skipendpoint = $soap_test->result['fault']->faultcode=='HTTP' && strstr($soap_test->result['fault']->faultstring,'Connect Error'); - $skipfault = $soap_test->result['fault']; + if ($skipendpoint) $skipfault = $soap_test->result['fault']; + else $skipfault = NULL; $this->totals['fail']++; } #$endpoint_info['tests'][] = &$soap_test; @@ -594,7 +567,7 @@ function getMethodList($test = 'base') { $this->dbc->setFetchMode(DB_FETCHMODE_ORDERED); // retreive the results and put them into the endpoint info - $sql = "select distinct(function) from results where class='$test' order by function"; + $sql = "select distinct(function) from results where client='$this->client_type' and class='$test' order by function"; $results = $this->dbc->getAll($sql); $ar = array(); foreach($results as $result) { @@ -624,6 +597,7 @@ $c = count ($this->endpoints); for ($i=0;$i<$c;$i++) { $endpoint_info =& $this->endpoints[$i]; + if (!$endpoint_info->name) continue; if (count($endpoint_info->methods) > 0) { $this->totals['servers']++; foreach ($methods as $method) { Index: pear/SOAP_Interop/interop_client_run.php diff -u pear/SOAP_Interop/interop_client_run.php:1.1 pear/SOAP_Interop/interop_client_run.php:1.2 --- pear/SOAP_Interop/interop_client_run.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/interop_client_run.php Sat Sep 28 21:02:57 2002 @@ -17,7 +17,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: interop_client_run.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: interop_client_run.php,v 1.2 2002/09/29 01:02:57 shane Exp $ // set_time_limit(0); require_once 'interop_client.php'; @@ -28,22 +28,44 @@ #$iop->fetchEndpoints(); // set some options -$iop->currentTest = 'Round 3 Group D RpcEnc'; // see $tests above +$iop->client_type='pear'; // 'pear' or 'php-soap' +$iop->currentTest = 'Round 2 Base'; // see $tests above $iop->paramType = 'php'; // 'php' or 'soapval' $iop->useWSDL = 1; // 1= do wsdl tests $iop->numServers = 0; // 0 = all $iop->specificEndpoint = ''; // test only this endpoint $iop->testMethod = ''; // test only this method -$iop->skipEndpointList = array(); // endpoints to skip +$iop->skipEndpointList = array('Frontier'); // endpoints to skip $this->nosave = 0; // 1= disable saving results to database // debug output $iop->show = 1; $iop->debug = 0; $iop->showFaults = 0; // used in result table output -$iop->doTest(); // run a single set of tests using above options +// these are endpoints that are listed in the interop +// server, but do not realy exist any longer +$bad = array('Spheon JSOAP','Phalanx', + 'SilverStream','SOAPx4 (PHP)', + 'Virtuoso (development)', + 'Zolera SOAP Infrastructure'); +$iop->skipEndpointList = array_merge($iop->skipEndpointList, $bad); + + +#$iop->tests = array(/*'Round 2 Base', +# 'Round 2 Group B', +# 'Round 2 Group C', */ +# 'Round 3 Group D Compound 1', +# 'Round 3 Group D Compound 2', +# 'Round 3 Group D DocLit', +# 'Round 3 Group D DocLitParams', +# 'Round 3 Group D Import 1', +# 'Round 3 Group D Import 2', +# 'Round 3 Group D Import 3', +# 'Round 3 Group D RpcEnc' +# ); +#$iop->doTest(); // run a single set of tests using above options #$iop->doGroupTests(); // run a group of tests set in $currentTest -#$iop->doTests(); // run all tests, ignore above options +$iop->doTests(); // run all tests, ignore above options #$iop->outputTables(); echo "done"; Index: pear/SOAP_Interop/params_Round2GroupB.php diff -u pear/SOAP_Interop/params_Round2GroupB.php:1.1 pear/SOAP_Interop/params_Round2GroupB.php:1.2 --- pear/SOAP_Interop/params_Round2GroupB.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/params_Round2GroupB.php Sat Sep 28 21:02:57 2002 @@ -16,7 +16,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: params_Round2GroupB.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: params_Round2GroupB.php,v 1.2 2002/09/29 01:02:57 shane Exp $ // require_once 'params_values.php'; require_once 'interop_test.php'; @@ -29,10 +29,12 @@ 'outputInteger'=>34, 'outputFloat'=>325.325 ); -$soap_tests[INTEROP_R2GROUPB][] = new SOAP_Interop_Test('echoStructAsSimpleTypes', - array('inputStruct' => &$soapstruct), $expect); -$soap_tests[INTEROP_R2GROUPB][] = new SOAP_Interop_Test('echoStructAsSimpleTypes', - array('inputStruct' => &$soapstruct_soapval), $expect); +$soap_tests[INTEROP_R2GROUPB][] = + new SOAP_Interop_Test('echoStructAsSimpleTypes', + array('inputStruct' => &$soapstruct), $expect); +$soap_tests[INTEROP_R2GROUPB][] = + new SOAP_Interop_Test('echoStructAsSimpleTypes', + array('inputStruct' => &$soapstruct_soapval), $expect); //*********************************************************** // GroupB echoSimpleTypesAsStruct Index: pear/SOAP_Interop/params_Round2GroupC.php diff -u pear/SOAP_Interop/params_Round2GroupC.php:1.1 pear/SOAP_Interop/params_Round2GroupC.php:1.2 --- pear/SOAP_Interop/params_Round2GroupC.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/params_Round2GroupC.php Sat Sep 28 21:02:57 2002 @@ -16,7 +16,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: params_Round2GroupC.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: params_Round2GroupC.php,v 1.2 2002/09/29 01:02:57 shane Exp $ // require_once 'params_values.php'; require_once 'interop_test.php'; @@ -101,8 +101,7 @@ // php val tests // echoMeStructRequest with endpoint as header destination, doesn't have to understand $test = new SOAP_Interop_Test('echoVoid', NULL); -$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStructRequest', - &$soapstruct, 0,SOAP_TEST_ACTOR_NEXT); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> &$soapstruct); $soap_tests[INTEROP_R2GROUPC][] =& $test; @@ -110,8 +109,7 @@ // echoMeStructRequest with endpoint as header destination, must understand $test = new SOAP_Interop_Test('echoVoid', NULL); -$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStructRequest', - &$soapstruct, 1,SOAP_TEST_ACTOR_NEXT); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE,1); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> &$soapstruct); $soap_tests[INTEROP_R2GROUPC][] =& $test; @@ -119,16 +117,14 @@ // echoMeStructRequest with endpoint NOT header destination, doesn't have to understand $test = new SOAP_Interop_Test('echoVoid', NULL); -$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStructRequest', - &$soapstruct, 0, SOAP_TEST_ACTOR_OTHER); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE,0, SOAP_TEST_ACTOR_OTHER); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests[INTEROP_R2GROUPC][] =& $test; unset($test); // echoMeStructRequest with endpoint NOT header destination, must understand $test = new SOAP_Interop_Test('echoVoid', NULL); -$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStructRequest', - &$soapstruct, 1, SOAP_TEST_ACTOR_OTHER); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE,1, SOAP_TEST_ACTOR_OTHER); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests[INTEROP_R2GROUPC][] =& $test; unset($test); @@ -138,8 +134,7 @@ // echoMeStructRequest with endpoint as header destination, doesn't have to understand $test = new SOAP_Interop_Test('echoVoid', NULL); $test->type = 'soapval'; -$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStructRequest',NULL, - $soapstruct); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> &$soapstruct); $soap_tests[INTEROP_R2GROUPC][] =& $test; @@ -148,8 +143,7 @@ // echoMeStructRequest with endpoint as header destination, must understand $test = new SOAP_Interop_Test('echoVoid', NULL); $test->type = 'soapval'; -$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStructRequest',NULL, - $soapstruct, 1); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE,1); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> &$soapstruct); $soap_tests[INTEROP_R2GROUPC][] =& $test; @@ -158,8 +152,7 @@ // echoMeStructRequest with endpoint NOT header destination, doesn't have to understand $test = new SOAP_Interop_Test('echoVoid', NULL); $test->type = 'soapval'; -$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStructRequest',NULL, - $soapstruct, 0, SOAP_TEST_ACTOR_OTHER); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE,0, SOAP_TEST_ACTOR_OTHER); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests[INTEROP_R2GROUPC][] =& $test; unset($test); @@ -167,8 +160,7 @@ // echoMeStructRequest with endpoint NOT header destination, must understand $test = new SOAP_Interop_Test('echoVoid', NULL); $test->type = 'soapval'; -$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStructRequest',NULL, - $soapstruct, 1, SOAP_TEST_ACTOR_OTHER); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE,1, SOAP_TEST_ACTOR_OTHER); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests[INTEROP_R2GROUPC][] =& $test; unset($test); Index: pear/SOAP_Interop/params_Round3GroupD.php diff -u pear/SOAP_Interop/params_Round3GroupD.php:1.1 pear/SOAP_Interop/params_Round3GroupD.php:1.2 --- pear/SOAP_Interop/params_Round3GroupD.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/params_Round3GroupD.php Sat Sep 28 21:02:57 2002 @@ -16,7 +16,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: params_Round3GroupD.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: params_Round3GroupD.php,v 1.2 2002/09/29 01:02:57 shane Exp $ // require_once 'params_values.php'; require_once 'interop_test.php'; @@ -33,15 +33,22 @@ # COMPOUND 1 tests # http://www.whitemesa.net/wsdl/r3/compound1.wsdl -#$soap_tests[INTEROP_R3D_COMPOUND1][] = -# new SOAP_Interop_Test('echoPerson', &$person); -#$soap_tests[INTEROP_R3D_COMPOUND1][] = -# new SOAP_Interop_Test('echoDocument', 'Test Document Here'); +$test = new SOAP_Interop_Test('echoPerson', array('x_Person'=>&$person)); +$test->type = 'php'; // force to php testing +$soap_tests[INTEROP_R3D_COMPOUND1][] = &$test; +unset($test); + +$test = new SOAP_Interop_Test('echoDocument', array('document'=>'Test Document Here')); +$test->type = 'php'; // force to php testing +$soap_tests[INTEROP_R3D_COMPOUND1][] = &$test; +unset($test); # COMPOUND 2 tests # http://www.whitemesa.net/wsdl/r3/compound2.wsdl -#$soap_tests[INTEROP_R3D_COMPOUND2][] = -# new SOAP_Interop_Test('echoEmployee', &$employee); +$test = new SOAP_Interop_Test('echoEmployee', array('employee'=>&$employee)); +$test->type = 'php'; // force to php testing +$soap_tests[INTEROP_R3D_COMPOUND2][] = &$test; +unset($test); # DOC LIT Tests # http://www.whitemesa.net/wsdl/r3/interoptestdoclit.wsdl Index: pear/SOAP_Interop/params_classes.php diff -u pear/SOAP_Interop/params_classes.php:1.1 pear/SOAP_Interop/params_classes.php:1.2 --- pear/SOAP_Interop/params_classes.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/params_classes.php Sat Sep 28 21:02:57 2002 @@ -16,69 +16,67 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: params_classes.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: params_classes.php,v 1.2 2002/09/29 01:02:57 shane Exp $ // require_once 'SOAP/Value.php'; -if (!class_exists('SOAPStruct')) { class SOAPStruct { var $varString; var $varInt; var $varFloat; - function SOAPStruct($s='arg', $i=34, $f=325.325) { + function SOAPStruct($s=NULL, $i=NULL, $f=NULL) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } - function &to_soap($name = 'inputStruct') + function &__to_soap($name = 'inputStruct', $header=false, $mustUnderstand=0, $actor='http://schemas.xmlsoap.org/soap/actor/next') { - return new SOAP_Value($name,'{http://soapinterop.org/xsd}SOAPStruct', - array( #push struct elements into one soap value + $inner = array( #push struct elements into one soap value new SOAP_Value('varString','string',$this->varString), new SOAP_Value('varInt','int',$this->varInt), new SOAP_Value('varFloat','float',$this->varFloat) - )); + ); + if ($header) { + return new SOAP_Header($name,'{http://soapinterop.org/xsd}SOAPStruct',$inner,$mustUnderstand,$actor); + } + return new SOAP_Value($name,'{http://soapinterop.org/xsd}SOAPStruct',$inner); + } } -} -if (!class_exists('SOAPStructStruct')) { class SOAPStructStruct { var $varString; var $varInt; var $varFloat; var $varStruct; - function SOAPStructStruct($s='arg', $i=34, $f=325.325, $ss=NULL) { + function SOAPStructStruct($s=NULL, $i=NULL, $f=NULL, $ss=NULL) { // XXX unfortunately, a copy of $ss will occure here // ze2 can fix this I think $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; - if (!$ss) $ss = new SOAPStruct(); $this->varStruct = $ss; } - function &to_soap($name = 'inputStruct') + function &__to_soap($name = 'inputStruct') { return new SOAP_Value($name,'{http://soapinterop.org/xsd}SOAPStructStruct', array( #push struct elements into one soap value new SOAP_Value('varString','string',$this->varString), new SOAP_Value('varInt','int',$this->varInt), new SOAP_Value('varFloat','float',$this->varFloat), - $this->varStruct->to_soap('varStruct') + $this->varStruct->__to_soap('varStruct') )); } } -} -if (!class_exists('SOAPArrayStruct')) { class SOAPArrayStruct { var $varString; var $varInt; var $varFloat; var $varArray; - function SOAPArrayStruct($s='arg', $i=34, $f=325.325, $ss=array('good','bad','ugly')) { + function SOAPArrayStruct($s=NULL, $i=NULL, $f=NULL, $ss=NULL) { // XXX unfortunately, a copy of $ss will occure here // ze2 can fix this I think $this->varString = $s; @@ -87,7 +85,7 @@ $this->varArray = $ss; } - function &to_soap($name = 'inputStruct') + function &__to_soap($name = 'inputStruct') { $ar = array(); $c = count($this->varArray); @@ -103,41 +101,62 @@ )); } } -} -if (!class_exists('Person')) { -class Person1 { +class Person { var $Age; var $ID; var $Name; var $Male; - function Person1($a=31, $i='123456', $n='Shane', $m=TRUE) { + function Person($a=NULL, $i=NULL, $n=NULL, $m=NULL) { $this->Age = $a; $this->ID = $i; $this->Name = $n; $this->Male = $m; } -} -class Person2 { - var $Name; - var $Male; - function Person2($n = 'Shane', $m = TRUE) { - $this->Name = $n; - $this->Male = $m; + function __set_attribute($key, $value) + { + $this->$key = $value; } + + function &__to_soap($name = 'x_Person',$ns = 'http://soapinterop.org/xsd', $compound2=false) + { + if (!$compound2) + return new SOAP_Value("\{$ns}$name",'Person', + array( #push struct elements into one soap value + new SOAP_Value("\{$ns}Age",'double',$this->Age), + new SOAP_Value("\{$ns}ID",'float',$this->ID), + ),array('Name'=>$this->Name,'Male'=>$this->Male)); + else + return new SOAP_Value("\{$ns}$name",'Person', + array( #push struct elements into one soap value + new SOAP_Value("\{$ns}Name",'string',$this->Name), + new SOAP_Value("\{$ns}Male",'boolean',$this->Male), + )); + } } class Employee { var $ID; var $salary; var $person; // class person2 - function Employee(&$person,$id='12435',$salary='1000000000000') { + function Employee($person=NULL,$id=NULL,$salary=NULL) { $this->person = $person; $this->ID = $id; $this->salary = $salary; } -} + + function &__to_soap($name = 'x_Employee', $ns='http://soapinterop.org/employee') + { + $person = $this->person->__to_soap('person','http://soapinterop.org/person',true); + $person->namespace = $ns; + return new SOAP_Value("\{$ns}$name",'Employee', + array( #push struct elements into one soap value + &$person, + new SOAP_Value("\{$ns}salary",'double',$this->salary), + new SOAP_Value("\{$ns}ID",'int',$this->ID), + )); + } } ?> Index: pear/SOAP_Interop/params_values.php diff -u pear/SOAP_Interop/params_values.php:1.1 pear/SOAP_Interop/params_values.php:1.2 --- pear/SOAP_Interop/params_values.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/params_values.php Sat Sep 28 21:02:57 2002 @@ -16,7 +16,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: params_values.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: params_values.php,v 1.2 2002/09/29 01:02:57 shane Exp $ // require_once 'SOAP/Value.php'; require_once 'params_classes.php'; @@ -68,20 +68,21 @@ $float_array_null_soapval = new SOAP_Value('inputFloatArray','Array',NULL); $float_array_null_soapval->arrayType='{http://www.w3.org/2001/XMLSchema}float'; -$soapstruct = new SOAPStruct(); -$soapstruct_soapval = $soapstruct->to_soap(); +$soapstruct = new SOAPStruct('arg',34,325.325); +$soapstruct_soapval = $soapstruct->__to_soap(); +$soapstruct_header_soapval = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest'); $soapstruct_array = array(&$soapstruct, &$soapstruct, &$soapstruct); $soapstruct_array_soapval = new SOAP_Value('inputStructArray','Array', array(&$soapstruct_soapval,&$soapstruct_soapval,&$soapstruct_soapval)); -$soapstructstruct = new SOAPStructStruct(); -$soapstructstruct_soapval = $soapstructstruct->to_soap(); +$soapstructstruct = new SOAPStructStruct('arg',34,325.325,$soapstruct); +$soapstructstruct_soapval = &$soapstructstruct->__to_soap(); $soapstructstruct_array = array(&$soapstructstruct, &$soapstructstruct, &$soapstructstruct); $soapstructstruct_array_soapval = new SOAP_Value('inputStructArray','Array', array(&$soapstructstruct_soapval,&$soapstructstruct_soapval,&$soapstructstruct_soapval)); -$soaparraystruct = new SOAPArrayStruct(); -$soaparraystruct_soapval = $soaparraystruct->to_soap(); +$soaparraystruct = new SOAPArrayStruct('arg',34,325.325,array('good','bad','ugly')); +$soaparraystruct_soapval = &$soaparraystruct->__to_soap(); $soaparraystruct_array = array(&$soaparraystruct, &$soaparraystruct, &$soaparraystruct); $soaparraystruct_array_soapval = new SOAP_Value('inputStructArray','Array', array(&$soaparraystruct_soapval,&$soaparraystruct_soapval,&$soaparraystruct_soapval)); @@ -150,8 +151,10 @@ $multidimarray_soapval->options['flatten'] = TRUE; // Round2GroupC values -$person = new Person1(); -$employee = new Employee(new Person2(), '12435', '1000000'); +$_person = new Person(32,12345,'Shane',TRUE); +$person = $_person->__to_soap(); +$_employee = new Employee($_person,12345,1000000.00); +$employee = $_employee->__to_soap(); ?> Index: pear/SOAP_Interop/wsdl/imported/import1B.wsdl +++ pear/SOAP_Interop/wsdl/imported/import1B.wsdl <?xml version="1.0"?> <definitions name="SoapInterop" targetNamespace="http://soapinterop.org/definitions/" xmlns:wsdlns="http://soapinterop.org/definitions/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types/> <message name="echoStringRequest"> <part name="x" type="xsd:string"/> </message> <message name="echoStringResponse"> <part name="Result" type="xsd:string"/> </message> <portType name="SoapInteropImport1PortType"> <operation name="echoString" parameterOrder="x"> <input message="wsdlns:echoStringRequest"/> <output message="wsdlns:echoStringResponse"/> </operation> </portType> </definitions> Index: pear/SOAP_Interop/wsdl/imported/import2B.wsdl +++ pear/SOAP_Interop/wsdl/imported/import2B.wsdl <?xml version="1.0"?> <definitions name="SoapInterop" targetNamespace="http://soapinterop.org/definitions/" xmlns:wsdlns="http://soapinterop.org/definitions/" xmlns:typens="http://soapinterop.org/xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"> <import location="import2B.xsd" namespace="http://soapinterop.org/xsd" /> <message name='Server.echoStruct'> <part name='inputStruct' type='typens:SOAPStruct'/> </message> <message name='Server.echoStructResponse'> <part name='Result' type='typens:SOAPStruct'/> </message> <portType name="SoapInteropImport2PortType"> <operation name='echoStruct' parameterOrder='inputStruct'> <input message='wsdlns:Server.echoStruct' /> <output message='wsdlns:Server.echoStructResponse' /> </operation> </portType> </definitions> Index: pear/SOAP_Interop/wsdl/imported/import2B.xsd +++ pear/SOAP_Interop/wsdl/imported/import2B.xsd <?xml version="1.0"?> <schema targetNamespace='http://soapinterop.org/xsd' xmlns='http://www.w3.org/2001/XMLSchema' elementFormDefault='unqualified'> <complexType name="SOAPStruct"> <all> <element name="varString" type="string" /> <element name="varInt" type="int" /> <element name="varFloat" type="float" /> </all> </complexType> </schema>
Index: pear/SOAP_Interop/interop_client.php diff -u pear/SOAP_Interop/interop_client.php:1.1 pear/SOAP_Interop/interop_client.php:1.2 --- pear/SOAP_Interop/interop_client.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/interop_client.php Sat Sep 28 21:02:56 2002 @@ -16,13 +16,14 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: interop_client.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: interop_client.php,v 1.2 2002/09/29 01:02:56 shane Exp $ // require_once 'DB.php'; // PEAR/DB require_once 'SOAP/Client.php'; require_once 'config.php'; require_once 'interop_test_functions.php'; +require_once 'interop_wrapper.php'; require_once 'params_Round2Base.php'; require_once 'params_Round2GroupB.php'; require_once 'params_Round2GroupC.php'; @@ -51,6 +52,7 @@ var $testMethod = ''; // test only this method var $skipEndpointList = array(); // endpoints to skip var $nosave = 0; + var $client_type = 'pear'; // name of client // debug output var $show = 1; @@ -149,8 +151,8 @@ function _saveResults($endpoint_id, &$soap_test) { if ($this->nosave) return; - $result = $soap_test->result; - $wire = $result['wire']; + $result =& $soap_test->result; + $wire =& $result['wire']; if ($result['success']) { $success = 'OK'; $error = ''; @@ -180,7 +182,7 @@ $sql = "delete from results where endpoint=$endpoint_id ". "and class='$this->currentTest' and type='$this->paramType' ". - "and wsdl=$this->useWSDL and function=". + "and wsdl=$this->useWSDL and client='$this->client_type' and function=". $this->dbc->quote($test_name); #echo "\n".$sql; $res = $this->dbc->query($sql); @@ -189,8 +191,8 @@ } 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',". + $sql = "insert into results (client,endpoint,stamp,class,type,wsdl,function,result,error,wire) ". + "values('$this->client_type',$endpoint_id,".time().",'$this->currentTest',". "'$this->paramType',$this->useWSDL,". $this->dbc->quote($test_name).",". $this->dbc->quote($success).",". @@ -205,39 +207,6 @@ if (is_object($res)) $res->free(); } - function &_decodeSoapval(&$soapval) - { - if (gettype($soapval) == "object" && - (strcasecmp(get_class($soapval),"SOAP_Value") == 0 || - strcasecmp(get_class($soapval),"SOAP_Header") == 0)) { - $val = $this->decode($soapval); - } else { - $val = $soapval; - } - return $val; - } - - /** - * decodeSoapval - * decodes a soap value to php type, used for test result comparisions - * - * @param SOAP_Value soapval - * @return mixed result - * @access public - */ - function &decodeSoapval(&$soapval) - { - if (is_array($soapval)) { - $c = count($soapval); - for ($i=0; $i<$c; $i++) { - $val[$i] = $this->_decodeSoapval($soapval[$i]); - } - } else { - $val = $this->_decodeSoapval($soapval); - } - return $val; - } - /** * compareResult * compare two php types for a match @@ -289,17 +258,18 @@ if ($endpoint_info->wsdlURL) { if (!$endpoint_info->client) { $endpoint_info->client = new SOAP_Client($endpoint_info->wsdlURL,1); + $endpoint_info->client->_auto_translation = true; } - $soap =& $endpoint_info->client; - if ($soap->wsdl->fault) { - $fault = $soap->wsdl->fault->getFault(); + if ($endpoint_info->client->_wsdl->__isfault()) { + $fault = $endpoint_info->client->_wsdl->fault->getFault(); $soap_test->setResult(0,'WSDL', - $fault->faultstring."\n\n".$fault->faultdetail, - $fault->faultstring, - $fault - ); + $fault->faultstring."\n\n".$fault->faultdetail, + $fault->faultstring, + $fault + ); return FALSE; } + $soap =& $endpoint_info->client; } else { $fault = array( 'faultcode'=>'WSDL', @@ -314,10 +284,6 @@ $namespace = false; $soapaction = false; } else { - if (!$endpoint_info->client) { - $endpoint_info->client = new SOAP_Client($endpoint_info->endpointURL); - } - $soap = &$endpoint_info->client; $namespace = $soapaction = 'http://soapinterop.org/'; // hack to make tests work with MS SoapToolkit // it's the only one that uses this soapaction, and breaks if @@ -327,6 +293,11 @@ strstr($endpoint_info->name,'MS SOAP ToolKit 2.0')) { $soapaction = 'urn:soapinterop'; } + if (!$endpoint_info->client) { + $endpoint_info->client = new SOAP_Client($endpoint_info->endpointURL); + $endpoint_info->client->_auto_translation = true; + } + $soap = &$endpoint_info->client; } // for round3 testing @@ -376,7 +347,7 @@ $ok = !$need_result || $this->compareResult($hresult ,$expect[key($expect)]); } else { $hresult = $soap->headersIn[$header->name]; - $expect = $soap->decode($header); + $expect = $soap->_decode($header); $ok = !$need_result || $this->compareResult($hresult ,$expect); } $header_result[$header->name]['ok'] = $ok; @@ -387,7 +358,7 @@ # we need to decode what we sent so we can compare! if (gettype($sent)=='object' && (get_class($sent)=='soap_value' || is_subclass_of($sent,'soap_value'))) - $sent_d = $soap->decode($sent); + $sent_d = $soap->_decode($sent); else $sent_d =& $sent; @@ -405,12 +376,12 @@ $fault->faultcode = 'HEADER'; $fault->faultstring = 'The returned result did not match what we expected to receive'; $soap_test->setResult(0,$fault->faultcode, - $soap->wire, + $soap->__get_wire(), $fault->faultstring, $fault ); } else { - $soap_test->setResult(1,'OK',$soap->wire); + $soap_test->setResult(1,'OK',$soap->__get_wire()); $success = TRUE; } } else { @@ -420,7 +391,7 @@ $fault->faultdetail = ''/*"SENT:\n".var_export($soap_test->result['sent']). "\n\nRECIEVED:\n".var_export($soap_test->result['return'])*/; $soap_test->setResult(0,$fault->faultcode, - $soap->wire, + $soap->__get_wire(), $fault->faultstring, $fault ); @@ -434,7 +405,7 @@ $ok = 0; $res =$fault->faultcode; } - $soap_test->setResult($ok,$res, $soap->wire,$fault->faultstring, $fault); + $soap_test->setResult($ok,$res, $soap->__get_wire(),$fault->faultstring, $fault); } return $ok; } @@ -525,12 +496,14 @@ $this->totals['fail']++; } else { // run the endpoint test + unset($soap_test->result); if ($this->doEndpointMethod($endpoint_info, $soap_test)) { $this->totals['success']++; } else { $skipendpoint = $soap_test->result['fault']->faultcode=='HTTP' && strstr($soap_test->result['fault']->faultstring,'Connect Error'); - $skipfault = $soap_test->result['fault']; + if ($skipendpoint) $skipfault = $soap_test->result['fault']; + else $skipfault = NULL; $this->totals['fail']++; } #$endpoint_info['tests'][] = &$soap_test; @@ -594,7 +567,7 @@ function getMethodList($test = 'base') { $this->dbc->setFetchMode(DB_FETCHMODE_ORDERED); // retreive the results and put them into the endpoint info - $sql = "select distinct(function) from results where class='$test' order by function"; + $sql = "select distinct(function) from results where client='$this->client_type' and class='$test' order by function"; $results = $this->dbc->getAll($sql); $ar = array(); foreach($results as $result) { @@ -624,6 +597,7 @@ $c = count ($this->endpoints); for ($i=0;$i<$c;$i++) { $endpoint_info =& $this->endpoints[$i]; + if (!$endpoint_info->name) continue; if (count($endpoint_info->methods) > 0) { $this->totals['servers']++; foreach ($methods as $method) { Index: pear/SOAP_Interop/interop_client_run.php diff -u pear/SOAP_Interop/interop_client_run.php:1.1 pear/SOAP_Interop/interop_client_run.php:1.2 --- pear/SOAP_Interop/interop_client_run.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/interop_client_run.php Sat Sep 28 21:02:57 2002 @@ -17,7 +17,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: interop_client_run.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: interop_client_run.php,v 1.2 2002/09/29 01:02:57 shane Exp $ // set_time_limit(0); require_once 'interop_client.php'; @@ -28,22 +28,44 @@ #$iop->fetchEndpoints(); // set some options -$iop->currentTest = 'Round 3 Group D RpcEnc'; // see $tests above +$iop->client_type='pear'; // 'pear' or 'php-soap' +$iop->currentTest = 'Round 2 Base'; // see $tests above $iop->paramType = 'php'; // 'php' or 'soapval' $iop->useWSDL = 1; // 1= do wsdl tests $iop->numServers = 0; // 0 = all $iop->specificEndpoint = ''; // test only this endpoint $iop->testMethod = ''; // test only this method -$iop->skipEndpointList = array(); // endpoints to skip +$iop->skipEndpointList = array('Frontier'); // endpoints to skip $this->nosave = 0; // 1= disable saving results to database // debug output $iop->show = 1; $iop->debug = 0; $iop->showFaults = 0; // used in result table output -$iop->doTest(); // run a single set of tests using above options +// these are endpoints that are listed in the interop +// server, but do not realy exist any longer +$bad = array('Spheon JSOAP','Phalanx', + 'SilverStream','SOAPx4 (PHP)', + 'Virtuoso (development)', + 'Zolera SOAP Infrastructure'); +$iop->skipEndpointList = array_merge($iop->skipEndpointList, $bad); + + +#$iop->tests = array(/*'Round 2 Base', +# 'Round 2 Group B', +# 'Round 2 Group C', */ +# 'Round 3 Group D Compound 1', +# 'Round 3 Group D Compound 2', +# 'Round 3 Group D DocLit', +# 'Round 3 Group D DocLitParams', +# 'Round 3 Group D Import 1', +# 'Round 3 Group D Import 2', +# 'Round 3 Group D Import 3', +# 'Round 3 Group D RpcEnc' +# ); +#$iop->doTest(); // run a single set of tests using above options #$iop->doGroupTests(); // run a group of tests set in $currentTest -#$iop->doTests(); // run all tests, ignore above options +$iop->doTests(); // run all tests, ignore above options #$iop->outputTables(); echo "done"; Index: pear/SOAP_Interop/params_Round2GroupB.php diff -u pear/SOAP_Interop/params_Round2GroupB.php:1.1 pear/SOAP_Interop/params_Round2GroupB.php:1.2 --- pear/SOAP_Interop/params_Round2GroupB.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/params_Round2GroupB.php Sat Sep 28 21:02:57 2002 @@ -16,7 +16,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: params_Round2GroupB.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: params_Round2GroupB.php,v 1.2 2002/09/29 01:02:57 shane Exp $ // require_once 'params_values.php'; require_once 'interop_test.php'; @@ -29,10 +29,12 @@ 'outputInteger'=>34, 'outputFloat'=>325.325 ); -$soap_tests[INTEROP_R2GROUPB][] = new SOAP_Interop_Test('echoStructAsSimpleTypes', - array('inputStruct' => &$soapstruct), $expect); -$soap_tests[INTEROP_R2GROUPB][] = new SOAP_Interop_Test('echoStructAsSimpleTypes', - array('inputStruct' => &$soapstruct_soapval), $expect); +$soap_tests[INTEROP_R2GROUPB][] = + new SOAP_Interop_Test('echoStructAsSimpleTypes', + array('inputStruct' => &$soapstruct), $expect); +$soap_tests[INTEROP_R2GROUPB][] = + new SOAP_Interop_Test('echoStructAsSimpleTypes', + array('inputStruct' => &$soapstruct_soapval), $expect); //*********************************************************** // GroupB echoSimpleTypesAsStruct Index: pear/SOAP_Interop/params_Round2GroupC.php diff -u pear/SOAP_Interop/params_Round2GroupC.php:1.1 pear/SOAP_Interop/params_Round2GroupC.php:1.2 --- pear/SOAP_Interop/params_Round2GroupC.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/params_Round2GroupC.php Sat Sep 28 21:02:57 2002 @@ -16,7 +16,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: params_Round2GroupC.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: params_Round2GroupC.php,v 1.2 2002/09/29 01:02:57 shane Exp $ // require_once 'params_values.php'; require_once 'interop_test.php'; @@ -101,8 +101,7 @@ // php val tests // echoMeStructRequest with endpoint as header destination, doesn't have to understand $test = new SOAP_Interop_Test('echoVoid', NULL); -$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStructRequest', - &$soapstruct, 0,SOAP_TEST_ACTOR_NEXT); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> &$soapstruct); $soap_tests[INTEROP_R2GROUPC][] =& $test; @@ -110,8 +109,7 @@ // echoMeStructRequest with endpoint as header destination, must understand $test = new SOAP_Interop_Test('echoVoid', NULL); -$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStructRequest', - &$soapstruct, 1,SOAP_TEST_ACTOR_NEXT); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE,1); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> &$soapstruct); $soap_tests[INTEROP_R2GROUPC][] =& $test; @@ -119,16 +117,14 @@ // echoMeStructRequest with endpoint NOT header destination, doesn't have to understand $test = new SOAP_Interop_Test('echoVoid', NULL); -$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStructRequest', - &$soapstruct, 0, SOAP_TEST_ACTOR_OTHER); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE,0, SOAP_TEST_ACTOR_OTHER); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests[INTEROP_R2GROUPC][] =& $test; unset($test); // echoMeStructRequest with endpoint NOT header destination, must understand $test = new SOAP_Interop_Test('echoVoid', NULL); -$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStructRequest', - &$soapstruct, 1, SOAP_TEST_ACTOR_OTHER); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE,1, SOAP_TEST_ACTOR_OTHER); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests[INTEROP_R2GROUPC][] =& $test; unset($test); @@ -138,8 +134,7 @@ // echoMeStructRequest with endpoint as header destination, doesn't have to understand $test = new SOAP_Interop_Test('echoVoid', NULL); $test->type = 'soapval'; -$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStructRequest',NULL, - $soapstruct); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> &$soapstruct); $soap_tests[INTEROP_R2GROUPC][] =& $test; @@ -148,8 +143,7 @@ // echoMeStructRequest with endpoint as header destination, must understand $test = new SOAP_Interop_Test('echoVoid', NULL); $test->type = 'soapval'; -$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStructRequest',NULL, - $soapstruct, 1); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE,1); $test->headers_expect['echoMeStructRequest'] = array('echoMeStructResponse'=> &$soapstruct); $soap_tests[INTEROP_R2GROUPC][] =& $test; @@ -158,8 +152,7 @@ // echoMeStructRequest with endpoint NOT header destination, doesn't have to understand $test = new SOAP_Interop_Test('echoVoid', NULL); $test->type = 'soapval'; -$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStructRequest',NULL, - $soapstruct, 0, SOAP_TEST_ACTOR_OTHER); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE,0, SOAP_TEST_ACTOR_OTHER); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests[INTEROP_R2GROUPC][] =& $test; unset($test); @@ -167,8 +160,7 @@ // echoMeStructRequest with endpoint NOT header destination, must understand $test = new SOAP_Interop_Test('echoVoid', NULL); $test->type = 'soapval'; -$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStructRequest',NULL, - $soapstruct, 1, SOAP_TEST_ACTOR_OTHER); +$test->headers[] = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest',TRUE,1, SOAP_TEST_ACTOR_OTHER); $test->headers_expect['echoMeStructRequest'] = array(); $soap_tests[INTEROP_R2GROUPC][] =& $test; unset($test); Index: pear/SOAP_Interop/params_Round3GroupD.php diff -u pear/SOAP_Interop/params_Round3GroupD.php:1.1 pear/SOAP_Interop/params_Round3GroupD.php:1.2 --- pear/SOAP_Interop/params_Round3GroupD.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/params_Round3GroupD.php Sat Sep 28 21:02:57 2002 @@ -16,7 +16,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: params_Round3GroupD.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: params_Round3GroupD.php,v 1.2 2002/09/29 01:02:57 shane Exp $ // require_once 'params_values.php'; require_once 'interop_test.php'; @@ -33,15 +33,22 @@ # COMPOUND 1 tests # http://www.whitemesa.net/wsdl/r3/compound1.wsdl -#$soap_tests[INTEROP_R3D_COMPOUND1][] = -# new SOAP_Interop_Test('echoPerson', &$person); -#$soap_tests[INTEROP_R3D_COMPOUND1][] = -# new SOAP_Interop_Test('echoDocument', 'Test Document Here'); +$test = new SOAP_Interop_Test('echoPerson', array('x_Person'=>&$person)); +$test->type = 'php'; // force to php testing +$soap_tests[INTEROP_R3D_COMPOUND1][] = &$test; +unset($test); + +$test = new SOAP_Interop_Test('echoDocument', array('document'=>'Test Document Here')); +$test->type = 'php'; // force to php testing +$soap_tests[INTEROP_R3D_COMPOUND1][] = &$test; +unset($test); # COMPOUND 2 tests # http://www.whitemesa.net/wsdl/r3/compound2.wsdl -#$soap_tests[INTEROP_R3D_COMPOUND2][] = -# new SOAP_Interop_Test('echoEmployee', &$employee); +$test = new SOAP_Interop_Test('echoEmployee', array('employee'=>&$employee)); +$test->type = 'php'; // force to php testing +$soap_tests[INTEROP_R3D_COMPOUND2][] = &$test; +unset($test); # DOC LIT Tests # http://www.whitemesa.net/wsdl/r3/interoptestdoclit.wsdl Index: pear/SOAP_Interop/params_classes.php diff -u pear/SOAP_Interop/params_classes.php:1.1 pear/SOAP_Interop/params_classes.php:1.2 --- pear/SOAP_Interop/params_classes.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/params_classes.php Sat Sep 28 21:02:57 2002 @@ -16,69 +16,67 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: params_classes.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: params_classes.php,v 1.2 2002/09/29 01:02:57 shane Exp $ // require_once 'SOAP/Value.php'; -if (!class_exists('SOAPStruct')) { class SOAPStruct { var $varString; var $varInt; var $varFloat; - function SOAPStruct($s='arg', $i=34, $f=325.325) { + function SOAPStruct($s=NULL, $i=NULL, $f=NULL) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } - function &to_soap($name = 'inputStruct') + function &__to_soap($name = 'inputStruct', $header=false, $mustUnderstand=0, $actor='http://schemas.xmlsoap.org/soap/actor/next') { - return new SOAP_Value($name,'{http://soapinterop.org/xsd}SOAPStruct', - array( #push struct elements into one soap value + $inner = array( #push struct elements into one soap value new SOAP_Value('varString','string',$this->varString), new SOAP_Value('varInt','int',$this->varInt), new SOAP_Value('varFloat','float',$this->varFloat) - )); + ); + if ($header) { + return new SOAP_Header($name,'{http://soapinterop.org/xsd}SOAPStruct',$inner,$mustUnderstand,$actor); + } + return new SOAP_Value($name,'{http://soapinterop.org/xsd}SOAPStruct',$inner); + } } -} -if (!class_exists('SOAPStructStruct')) { class SOAPStructStruct { var $varString; var $varInt; var $varFloat; var $varStruct; - function SOAPStructStruct($s='arg', $i=34, $f=325.325, $ss=NULL) { + function SOAPStructStruct($s=NULL, $i=NULL, $f=NULL, $ss=NULL) { // XXX unfortunately, a copy of $ss will occure here // ze2 can fix this I think $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; - if (!$ss) $ss = new SOAPStruct(); $this->varStruct = $ss; } - function &to_soap($name = 'inputStruct') + function &__to_soap($name = 'inputStruct') { return new SOAP_Value($name,'{http://soapinterop.org/xsd}SOAPStructStruct', array( #push struct elements into one soap value new SOAP_Value('varString','string',$this->varString), new SOAP_Value('varInt','int',$this->varInt), new SOAP_Value('varFloat','float',$this->varFloat), - $this->varStruct->to_soap('varStruct') + $this->varStruct->__to_soap('varStruct') )); } } -} -if (!class_exists('SOAPArrayStruct')) { class SOAPArrayStruct { var $varString; var $varInt; var $varFloat; var $varArray; - function SOAPArrayStruct($s='arg', $i=34, $f=325.325, $ss=array('good','bad','ugly')) { + function SOAPArrayStruct($s=NULL, $i=NULL, $f=NULL, $ss=NULL) { // XXX unfortunately, a copy of $ss will occure here // ze2 can fix this I think $this->varString = $s; @@ -87,7 +85,7 @@ $this->varArray = $ss; } - function &to_soap($name = 'inputStruct') + function &__to_soap($name = 'inputStruct') { $ar = array(); $c = count($this->varArray); @@ -103,41 +101,62 @@ )); } } -} -if (!class_exists('Person')) { -class Person1 { +class Person { var $Age; var $ID; var $Name; var $Male; - function Person1($a=31, $i='123456', $n='Shane', $m=TRUE) { + function Person($a=NULL, $i=NULL, $n=NULL, $m=NULL) { $this->Age = $a; $this->ID = $i; $this->Name = $n; $this->Male = $m; } -} -class Person2 { - var $Name; - var $Male; - function Person2($n = 'Shane', $m = TRUE) { - $this->Name = $n; - $this->Male = $m; + function __set_attribute($key, $value) + { + $this->$key = $value; } + + function &__to_soap($name = 'x_Person',$ns = 'http://soapinterop.org/xsd', $compound2=false) + { + if (!$compound2) + return new SOAP_Value("\{$ns}$name",'Person', + array( #push struct elements into one soap value + new SOAP_Value("\{$ns}Age",'double',$this->Age), + new SOAP_Value("\{$ns}ID",'float',$this->ID), + ),array('Name'=>$this->Name,'Male'=>$this->Male)); + else + return new SOAP_Value("\{$ns}$name",'Person', + array( #push struct elements into one soap value + new SOAP_Value("\{$ns}Name",'string',$this->Name), + new SOAP_Value("\{$ns}Male",'boolean',$this->Male), + )); + } } class Employee { var $ID; var $salary; var $person; // class person2 - function Employee(&$person,$id='12435',$salary='1000000000000') { + function Employee($person=NULL,$id=NULL,$salary=NULL) { $this->person = $person; $this->ID = $id; $this->salary = $salary; } -} + + function &__to_soap($name = 'x_Employee', $ns='http://soapinterop.org/employee') + { + $person = $this->person->__to_soap('person','http://soapinterop.org/person',true); + $person->namespace = $ns; + return new SOAP_Value("\{$ns}$name",'Employee', + array( #push struct elements into one soap value + &$person, + new SOAP_Value("\{$ns}salary",'double',$this->salary), + new SOAP_Value("\{$ns}ID",'int',$this->ID), + )); + } } ?> Index: pear/SOAP_Interop/params_values.php diff -u pear/SOAP_Interop/params_values.php:1.1 pear/SOAP_Interop/params_values.php:1.2 --- pear/SOAP_Interop/params_values.php:1.1 Sat Aug 31 22:39:06 2002 +++ pear/SOAP_Interop/params_values.php Sat Sep 28 21:02:57 2002 @@ -16,7 +16,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: params_values.php,v 1.1 2002/09/01 02:39:06 shane Exp $ +// $Id: params_values.php,v 1.2 2002/09/29 01:02:57 shane Exp $ // require_once 'SOAP/Value.php'; require_once 'params_classes.php'; @@ -68,20 +68,21 @@ $float_array_null_soapval = new SOAP_Value('inputFloatArray','Array',NULL); $float_array_null_soapval->arrayType='{http://www.w3.org/2001/XMLSchema}float'; -$soapstruct = new SOAPStruct(); -$soapstruct_soapval = $soapstruct->to_soap(); +$soapstruct = new SOAPStruct('arg',34,325.325); +$soapstruct_soapval = $soapstruct->__to_soap(); +$soapstruct_header_soapval = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest'); $soapstruct_array = array(&$soapstruct, &$soapstruct, &$soapstruct); $soapstruct_array_soapval = new SOAP_Value('inputStructArray','Array', array(&$soapstruct_soapval,&$soapstruct_soapval,&$soapstruct_soapval)); -$soapstructstruct = new SOAPStructStruct(); -$soapstructstruct_soapval = $soapstructstruct->to_soap(); +$soapstructstruct = new SOAPStructStruct('arg',34,325.325,$soapstruct); +$soapstructstruct_soapval = &$soapstructstruct->__to_soap(); $soapstructstruct_array = array(&$soapstructstruct, &$soapstructstruct, &$soapstructstruct); $soapstructstruct_array_soapval = new SOAP_Value('inputStructArray','Array', array(&$soapstructstruct_soapval,&$soapstructstruct_soapval,&$soapstructstruct_soapval)); -$soaparraystruct = new SOAPArrayStruct(); -$soaparraystruct_soapval = $soaparraystruct->to_soap(); +$soaparraystruct = new SOAPArrayStruct('arg',34,325.325,array('good','bad','ugly')); +$soaparraystruct_soapval = &$soaparraystruct->__to_soap(); $soaparraystruct_array = array(&$soaparraystruct, &$soaparraystruct, &$soaparraystruct); $soaparraystruct_array_soapval = new SOAP_Value('inputStructArray','Array', array(&$soaparraystruct_soapval,&$soaparraystruct_soapval,&$soaparraystruct_soapval)); @@ -150,8 +151,10 @@ $multidimarray_soapval->options['flatten'] = TRUE; // Round2GroupC values -$person = new Person1(); -$employee = new Employee(new Person2(), '12435', '1000000'); +$_person = new Person(32,12345,'Shane',TRUE); +$person = $_person->__to_soap(); +$_employee = new Employee($_person,12345,1000000.00); +$employee = $_employee->__to_soap(); ?> Index: pear/SOAP_Interop/wsdl/imported/import1B.wsdl +++ pear/SOAP_Interop/wsdl/imported/import1B.wsdl <?xml version="1.0"?> <definitions name="SoapInterop" targetNamespace="http://soapinterop.org/definitions/" xmlns:wsdlns="http://soapinterop.org/definitions/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types/> <message name="echoStringRequest"> <part name="x" type="xsd:string"/> </message> <message name="echoStringResponse"> <part name="Result" type="xsd:string"/> </message> <portType name="SoapInteropImport1PortType"> <operation name="echoString" parameterOrder="x"> <input message="wsdlns:echoStringRequest"/> <output message="wsdlns:echoStringResponse"/> </operation> </portType> </definitions> Index: pear/SOAP_Interop/wsdl/imported/import2B.wsdl +++ pear/SOAP_Interop/wsdl/imported/import2B.wsdl <?xml version="1.0"?> <definitions name="SoapInterop" targetNamespace="http://soapinterop.org/definitions/" xmlns:wsdlns="http://soapinterop.org/definitions/" xmlns:typens="http://soapinterop.org/xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"> <import location="import2B.xsd" namespace="http://soapinterop.org/xsd" /> <message name='Server.echoStruct'> <part name='inputStruct' type='typens:SOAPStruct'/> </message> <message name='Server.echoStructResponse'> <part name='Result' type='typens:SOAPStruct'/> </message> <portType name="SoapInteropImport2PortType"> <operation name='echoStruct' parameterOrder='inputStruct'> <input message='wsdlns:Server.echoStruct' /> <output message='wsdlns:Server.echoStructResponse' /> </operation> </portType> </definitions> Index: pear/SOAP_Interop/wsdl/imported/import2B.xsd +++ pear/SOAP_Interop/wsdl/imported/import2B.xsd <?xml version="1.0"?> <schema targetNamespace='http://soapinterop.org/xsd' xmlns='http://www.w3.org/2001/XMLSchema' elementFormDefault='unqualified'> <complexType name="SOAPStruct"> <all> <element name="varString" type="string" /> <element name="varInt" type="int" /> <element name="varFloat" type="float" /> </all> </complexType> </schema>