Back to index

php5  5.3.10
client_round2_params.php
Go to the documentation of this file.
00001 <?php
00002 //
00003 // +----------------------------------------------------------------------+
00004 // | PHP Version 4                                                        |
00005 // +----------------------------------------------------------------------+
00006 // | Copyright (c) 1997-2003 The PHP Group                                |
00007 // +----------------------------------------------------------------------+
00008 // | This source file is subject to version 2.02 of the PHP license,      |
00009 // | that is bundled with this package in the file LICENSE, and is        |
00010 // | available through the world-wide-web at                              |
00011 // | http://www.php.net/license/2_02.txt.                                 |
00012 // | If you did not receive a copy of the PHP license and are unable to   |
00013 // | obtain it through the world-wide-web, please send a note to          |
00014 // | license@php.net so we can mail you a copy immediately.               |
00015 // +----------------------------------------------------------------------+
00016 // | Authors: Shane Caraveo <Shane@Caraveo.com>                           |
00017 // +----------------------------------------------------------------------+
00018 //
00019 // $Id: client_round2_params.php 242949 2007-09-26 15:44:16Z cvs2svn $
00020 //
00021 
00022 define('SOAP_TEST_ACTOR_OTHER','http://some/other/actor');
00023 
00024 class SOAP_Test {
00025     var $type = 'php';
00026     var $test_name = NULL;
00027     var $method_name = NULL;
00028     var $method_params = NULL;
00029     var $cmp_func = NULL;
00030     var $expect = NULL;
00031     var $expect_fault = FALSE;
00032     var $headers = NULL;
00033     var $headers_expect = NULL;
00034     var $result = array();
00035     var $show = 1;
00036     var $debug = 0;
00037     var $encoding = 'UTF-8';
00038 
00039     function SOAP_Test($methodname, $params, $expect = NULL, $cmp_func = NULL) {
00040         # XXX we have to do this to make php-soap happy with NULL params
00041         if (!$params) $params = array();
00042 
00043         if (strchr($methodname,'(')) {
00044             preg_match('/(.*)\((.*)\)/',$methodname,$matches);
00045             $this->test_name = $methodname;
00046             $this->method_name = $matches[1];
00047         } else {
00048             $this->test_name = $this->method_name = $methodname;
00049         }
00050         $this->method_params = $params;
00051         if ($expect !== NULL) {
00052           $this->expect = $expect;
00053         }
00054         if ($cmp_func !== NULL) {
00055           $this->cmp_func = $cmp_func;
00056         }
00057 
00058         // determine test type
00059         if ($params) {
00060         $v = array_values($params);
00061         if (gettype($v[0]) == 'object' &&
00062             (get_class($v[0]) == 'SoapVar' || get_class($v[0]) == 'SoapParam'))
00063             $this->type = 'soapval';
00064         }
00065     }
00066 
00067     function setResult($ok, $result, $wire, $error = '', $fault = NULL)
00068     {
00069         $this->result['success'] = $ok;
00070         $this->result['result'] = $result;
00071         $this->result['error'] = $error;
00072         $this->result['wire'] = $wire;
00073         $this->result['fault'] = $fault;
00074     }
00075 
00084     function showTestResult($debug = 0, $html = 0) {
00085         // debug output
00086         if ($debug) $this->show = 1;
00087         if ($debug) {
00088             echo str_repeat("-",50).$html?"<br>\n":"\n";
00089         }
00090 
00091         echo "testing $this->test_name : ";
00092 
00093         if ($debug) {
00094             print "method params: ";
00095             print_r($this->params);
00096             print "\n";
00097         }
00098 
00099         $ok = $this->result['success'];
00100         if ($ok) {
00101             if ($html) {
00102                 print "<font color=\"#00cc00\">SUCCESS</font>\n";
00103             } else {
00104                 print "SUCCESS\n";
00105             }
00106         } else {
00107             $fault = $this->result['fault'];
00108             if ($fault) {
00109                      $res = $fault->faultcode;
00110                 $pos = strpos($res,':');
00111                 if ($pos !== false) {
00112                      $res = substr($res,$pos+1);                      
00113                 }
00114                 if ($html) {
00115                     print "<font color=\"#ff0000\">FAILED: [$res] {$fault->faultstring}</font>\n";
00116                 } else {
00117                     print "FAILED: [$res] {$fault->faultstring}\n";
00118                 }
00119             } else {
00120                 if ($html) {
00121                     print "<font color=\"#ff0000\">FAILED: ".$this->result['result']."</font>\n";
00122                 } else {
00123                     print "FAILED: ".$this->result['result']."\n";
00124                 }
00125             }
00126         }
00127         if ($debug) {
00128             if ($html) {
00129                 echo "<pre>\n".htmlentities($this->result['wire'])."</pre>\n";
00130             } else {
00131                 echo "\n".htmlentities($this->result['wire'])."\n";
00132             }
00133         }
00134     }
00135 }
00136 
00137 # XXX I know this isn't quite right, need to deal with this better
00138 function make_2d($x, $y)
00139 {
00140     for ($_x = 0; $_x < $x; $_x++) {
00141         for ($_y = 0; $_y < $y; $_y++) {
00142             $a[$_x][$_y] = "x{$_x}y{$_y}";
00143         }
00144     }
00145     return $a;
00146 }
00147 
00148 function soap_value($name, $value, $type, $type_name=NULL, $type_ns=NULL) {
00149     return new SoapParam(new SoapVar($value,$type,$type_name,$type_ns),$name);
00150 }
00151 
00152 class SOAPStruct {
00153     var $varString;
00154     var $varInt;
00155     var $varFloat;
00156     function SOAPStruct($s, $i, $f) {
00157         $this->varString = $s;
00158         $this->varInt = $i;
00159         $this->varFloat = $f;
00160     }
00161 }
00162 
00163 //***********************************************************
00164 // Base echoString
00165 
00166 $soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => 'hello world!'));
00167 $soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => soap_value('inputString','hello world',XSD_STRING)));
00168 $soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => ''));
00169 $soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => soap_value('inputString','',XSD_STRING)));
00170 $soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => NULL));
00171 $soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => soap_value('inputString',NULL,XSD_STRING)));
00172 //$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"));
00173 //$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)));
00174 $soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => ">,<,&,\",',\\,\n"));
00175 $soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => soap_value('inputString',">,<,&,\",',\\,\n",XSD_STRING)));
00176 $test = new SOAP_Test('echoString(utf-8)', array('inputString' => utf8_encode('ỗÈéóÒ₧⅜ỗỸ')));
00177 $test->encoding = 'UTF-8';
00178 $soap_tests['base'][] = $test;
00179 $test = new SOAP_Test('echoString(utf-8)', array('inputString' => soap_value('inputString',utf8_encode('ỗÈéóÒ₧⅜ỗỸ'),XSD_STRING)));
00180 $test->encoding = 'UTF-8';
00181 $soap_tests['base'][] = $test;
00182 
00183 //***********************************************************
00184 // Base echoStringArray
00185 
00186 $soap_tests['base'][] = new SOAP_Test('echoStringArray',
00187         array('inputStringArray' => array('good','bad')));
00188 $soap_tests['base'][] = new SOAP_Test('echoStringArray',
00189         array('inputStringArray' =>
00190             soap_value('inputStringArray',array('good','bad'),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
00191 
00192 $soap_tests['base'][] = new SOAP_Test('echoStringArray(one)',
00193         array('inputStringArray' => array('good')));
00194 $soap_tests['base'][] = new SOAP_Test('echoStringArray(one)',
00195         array('inputStringArray' =>
00196             soap_value('inputStringArray',array('good'),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
00197 
00198 // empty array test
00199 $soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => array()));
00200 $soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => soap_value('inputStringArray',array(),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
00201 
00202 # XXX NULL Arrays not supported
00203 // null array test
00204 $soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => NULL));
00205 $soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => soap_value('inputStringArray',NULL,SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
00206 
00207 //***********************************************************
00208 // Base echoInteger
00209 $x = new SOAP_Test('echoInteger', array('inputInteger' => 34345));
00210 $soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => 34345));
00211 $soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => soap_value('inputInteger',12345,XSD_INT)));
00212 
00213 //***********************************************************
00214 // Base echoIntegerArray
00215 
00216 $soap_tests['base'][] = new SOAP_Test('echoIntegerArray', array('inputIntegerArray' => array(1,234324324,2)));
00217 $soap_tests['base'][] = new SOAP_Test('echoIntegerArray',
00218         array('inputIntegerArray' =>
00219             soap_value('inputIntegerArray',
00220                        array(new SoapVar(12345,XSD_INT),new SoapVar(654321,XSD_INT)),
00221                     SOAP_ENC_ARRAY,"ArrayOfint","http://soapinterop.org/xsd")));
00222 
00223 //***********************************************************
00224 // Base echoFloat
00225 
00226 $soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => 342.23));
00227 $soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => soap_value('inputFloat',123.45,XSD_FLOAT)));
00228 
00229 //***********************************************************
00230 // Base echoFloatArray
00231 
00232 $soap_tests['base'][] = new SOAP_Test('echoFloatArray', array('inputFloatArray' => array(1.3223,34.2,325.325)));
00233 $soap_tests['base'][] = new SOAP_Test('echoFloatArray',
00234         array('inputFloatArray' =>
00235             soap_value('inputFloatArray',
00236                        array(new SoapVar(123.45,XSD_FLOAT),new SoapVar(654.321,XSD_FLOAT)),
00237                     SOAP_ENC_ARRAY,"ArrayOffloat","http://soapinterop.org/xsd")));
00238 //***********************************************************
00239 // Base echoStruct
00240 
00241 $soapstruct = new SOAPStruct('arg',34,325.325);
00242 # XXX no way to set a namespace!!!
00243 $soapsoapstruct = soap_value('inputStruct',$soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd");
00244 $soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' =>$soapstruct));
00245 $soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' =>$soapsoapstruct));
00246 
00247 //***********************************************************
00248 // Base echoStructArray
00249 
00250 $soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' => array(
00251         $soapstruct,$soapstruct,$soapstruct)));
00252 $soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' =>
00253          soap_value('inputStructArray',array(
00254            new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
00255            new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
00256            new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd")),
00257          SOAP_ENC_ARRAY,"ArrayOfSOAPStruct","http://soapinterop.org/xsd")));
00258 
00259 
00260 //***********************************************************
00261 // Base echoVoid
00262 
00263 $soap_tests['base'][] = new SOAP_Test('echoVoid', NULL);
00264 $test = new SOAP_Test('echoVoid', NULL);
00265 $test->type = 'soapval';
00266 $soap_tests['base'][] = $test;
00267 
00268 //***********************************************************
00269 // Base echoBase64
00270 
00271 $soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' => 'TmVicmFza2E='));
00272 $soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' =>
00273         soap_value('inputBase64','TmVicmFza2E=',XSD_BASE64BINARY)));
00274 
00275 //***********************************************************
00276 // Base echoHexBinary
00277 
00278 $soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => '736F61707834'),'736F61707834','hex_compare');
00279 $soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' =>
00280         soap_value('inputHexBinary','736F61707834',XSD_HEXBINARY)),'736F61707834','hex_compare');
00281 
00282 //***********************************************************
00283 // Base echoDecimal
00284 
00285 # XXX test fails because php-soap incorrectly sets decimal to long rather than float
00286 $soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => '12345.67890'));
00287 $soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' =>
00288         soap_value('inputDecimal','12345.67890',XSD_DECIMAL)));
00289 
00290 //***********************************************************
00291 // Base echoDate
00292 
00293 # php-soap doesn't handle datetime types properly yet
00294 $soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => '2001-05-24T17:31:41Z'), null, 'date_compare');
00295 $soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' =>
00296         soap_value('inputDate','2001-05-24T17:31:41Z',XSD_DATETIME)), null, 'date_compare');
00297 
00298 //***********************************************************
00299 // Base echoBoolean
00300 
00301 # php-soap sends boolean as zero or one, which is ok, but to be explicit, send true or false.
00302 $soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' => TRUE));
00303 $soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' =>
00304         soap_value('inputBoolean',TRUE,XSD_BOOLEAN)));
00305 $soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' => FALSE));
00306 $soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' =>
00307         soap_value('inputBoolean',FALSE,XSD_BOOLEAN)));
00308 $soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' => 1),true);
00309 $soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' =>
00310         soap_value('inputBoolean',1,XSD_BOOLEAN)),true);
00311 $soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' => 0),false);
00312 $soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' =>
00313         soap_value('inputBoolean',0,XSD_BOOLEAN)),false);
00314 
00315 
00316 
00317 //***********************************************************
00318 // GROUP B
00319 
00320 
00321 //***********************************************************
00322 // GroupB echoStructAsSimpleTypes
00323 
00324 $expect = array(
00325         'outputString'=>'arg',
00326         'outputInteger'=>34,
00327         'outputFloat'=>325.325
00328     );
00329 $soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes',
00330     array('inputStruct' => (object)array(
00331         'varString'=>'arg',
00332         'varInt'=>34,
00333         'varFloat'=>325.325
00334     )), $expect);
00335 $soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes',
00336     array('inputStruct' =>
00337           soap_value('inputStruct',
00338             (object)array('varString' => 'arg',
00339                                                  'varInt'    => 34,
00340                           'varFloat'  => 325.325
00341             ), SOAP_ENC_OBJECT, "SOAPStruct","http://soapinterop.org/xsd")), $expect);
00342 
00343 //***********************************************************
00344 // GroupB echoSimpleTypesAsStruct
00345 
00346 $expect =
00347     (object)array(
00348         'varString'=>'arg',
00349         'varInt'=>34,
00350         'varFloat'=>325.325
00351     );
00352 $soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct',
00353     array(
00354         'inputString'=>'arg',
00355         'inputInteger'=>34,
00356         'inputFloat'=>325.325
00357     ), $expect);
00358 $soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct',
00359     array(
00360         soap_value('inputString','arg', XSD_STRING),
00361         soap_value('inputInteger',34, XSD_INT),
00362         soap_value('inputFloat',325.325, XSD_FLOAT)
00363     ), $expect);
00364 
00365 //***********************************************************
00366 // GroupB echo2DStringArray
00367 
00368 $soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray',
00369     array('input2DStringArray' => make_2d(3,3)));
00370 
00371 $multidimarray =
00372     soap_value('input2DStringArray',
00373         array(
00374             array('row0col0', 'row0col1', 'row0col2'),
00375             array('row1col0', 'row1col1', 'row1col2')
00376         ), SOAP_ENC_ARRAY
00377     );
00378 //$multidimarray->options['flatten'] = TRUE;
00379 $soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray',
00380     array('input2DStringArray' => $multidimarray));
00381 
00382 //***********************************************************
00383 // GroupB echoNestedStruct
00384 
00385 $strstr = (object)array(
00386         'varString'=>'arg',
00387         'varInt'=>34,
00388         'varFloat'=>325.325,
00389         'varStruct' => (object)array(
00390             'varString'=>'arg',
00391             'varInt'=>34,
00392             'varFloat'=>325.325
00393         ));
00394 $soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct',
00395     array('inputStruct' => $strstr));
00396 $soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct',
00397     array('inputStruct' =>
00398         soap_value('inputStruct',
00399                                           (object)array(
00400                                     'varString'=>'arg',
00401                                    'varInt'=>34,
00402                                     'varFloat'=>325.325,
00403                                    'varStruct' => new SoapVar((object)array(
00404                                         'varString'=>'arg',
00405                                        'varInt'=>34,
00406                                         'varFloat'=>325.325
00407                                    ), SOAP_ENC_OBJECT, "SOAPStruct","http://soapinterop.org/xsd")
00408             ), SOAP_ENC_OBJECT, "SOAPStructStruct","http://soapinterop.org/xsd"
00409         )),$strstr);
00410 
00411 //***********************************************************
00412 // GroupB echoNestedArray
00413 
00414 $arrstr = (object)array(
00415         'varString'=>'arg',
00416         'varInt'=>34,
00417         'varFloat'=>325.325,
00418         'varArray' => array('red','blue','green')
00419     );
00420 $soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray',
00421     array('inputStruct' => $arrstr));
00422 $soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray',
00423     array('inputStruct' =>
00424         soap_value('inputStruct',
00425             (object)array('varString' => 'arg',
00426                           'varInt'    => 34,
00427                           'varFloat'  => 325.325,
00428                           'varArray'  =>
00429                     new SoapVar(array("red", "blue", "green"), SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd")
00430                 ), SOAP_ENC_OBJECT, "SOAPArrayStruct","http://soapinterop.org/xsd"
00431         )),$arrstr);
00432 
00433 
00434 //***********************************************************
00435 // GROUP C header tests
00436 
00437 //***********************************************************
00438 // echoMeStringRequest
00439 
00440 // echoMeStringRequest with endpoint as header destination, doesn't have to understand
00441 $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=next)', NULL);
00442 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 0, SOAP_ACTOR_NEXT);
00443 $test->headers_expect = array('echoMeStringResponse'=>'hello world');
00444 $soap_tests['GroupC'][] = $test;
00445 
00446 $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=next)', NULL);
00447 $test->type = 'soapval';
00448 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 0, SOAP_ACTOR_NEXT);
00449 $test->headers_expect = array('echoMeStringResponse'=>'hello world');
00450 $soap_tests['GroupC'][] = $test;
00451 
00452 // echoMeStringRequest with endpoint as header destination, must understand
00453 $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=next)', NULL);
00454 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT);
00455 $test->headers_expect = array('echoMeStringResponse'=>'hello world');
00456 $soap_tests['GroupC'][] = $test;
00457 
00458 $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=next)', NULL);
00459 $test->type = 'soapval';
00460 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 1, SOAP_ACTOR_NEXT);
00461 $test->headers_expect = array('echoMeStringResponse'=>'hello world');
00462 $soap_tests['GroupC'][] = $test;
00463 
00464 // echoMeStringRequest with endpoint NOT header destination, doesn't have to understand
00465 $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=other)', NULL);
00466 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 0, SOAP_TEST_ACTOR_OTHER);
00467 $test->headers_expect = array();
00468 $soap_tests['GroupC'][] = $test;
00469 
00470 $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=other)', NULL);
00471 $test->type = 'soapval';
00472 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 0, SOAP_TEST_ACTOR_OTHER);
00473 $test->headers_expect = array();
00474 $soap_tests['GroupC'][] = $test;
00475 
00476 // echoMeStringRequest with endpoint NOT header destination, must understand
00477 $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=other)', NULL);
00478 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_TEST_ACTOR_OTHER);
00479 $test->headers_expect = array();
00480 $soap_tests['GroupC'][] = $test;
00481 
00482 $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=other)', NULL);
00483 $test->type = 'soapval';
00484 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world', XSD_STRING), 1, SOAP_TEST_ACTOR_OTHER);
00485 $test->headers_expect = array();
00486 $soap_tests['GroupC'][] = $test;
00487 
00488 // echoMeStringRequest with endpoint header destination, must understand,
00489 // invalid namespace, should recieve a fault
00490 $test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL);
00491 $test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT);
00492 $test->headers_expect = array();
00493 $test->expect_fault = TRUE;
00494 $soap_tests['GroupC'][] = $test;
00495 
00496 $test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL);
00497 $test->type = 'soapval';
00498 $test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', new SoapVar('hello world', XSD_STRING), 1, SOAP_ACTOR_NEXT);
00499 $test->headers_expect = array();
00500 $test->expect_fault = TRUE;
00501 $soap_tests['GroupC'][] = $test;
00502 
00503 //***********************************************************
00504 // echoMeStructRequest
00505 
00506 // echoMeStructRequest with endpoint as header destination, doesn't have to understand
00507 $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=next)', NULL);
00508 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
00509         new SOAPStruct('arg',34,325.325), 0, SOAP_ACTOR_NEXT);
00510 $test->headers_expect =
00511     array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
00512 $soap_tests['GroupC'][] = $test;
00513 
00514 $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=next)', NULL);
00515 $test->type = 'soapval';
00516 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
00517             new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
00518             0, SOAP_ACTOR_NEXT);
00519 $test->headers_expect =
00520     array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
00521 $soap_tests['GroupC'][] = $test;
00522 
00523 // echoMeStructRequest with endpoint as header destination, must understand
00524 $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=next)', NULL);
00525 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
00526         new SOAPStruct('arg',34,325.325), 1, SOAP_ACTOR_NEXT);
00527 $test->headers_expect =
00528     array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
00529 $soap_tests['GroupC'][] = $test;
00530 
00531 $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=next)', NULL);
00532 $test->type = 'soapval';
00533 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
00534             new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
00535             1, SOAP_ACTOR_NEXT);
00536 $test->headers_expect =
00537     array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
00538 $soap_tests['GroupC'][] = $test;
00539 
00540 // echoMeStructRequest with endpoint NOT header destination, doesn't have to understand
00541 $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=other)', NULL);
00542 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
00543         new SOAPStruct('arg',34,325.325), 0, SOAP_TEST_ACTOR_OTHER);
00544 $test->headers_expect = array();
00545 $soap_tests['GroupC'][] = $test;
00546 
00547 $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=other)', NULL);
00548 $test->type = 'soapval';
00549 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
00550             new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
00551             0, SOAP_TEST_ACTOR_OTHER);
00552 $test->headers_expect = array();
00553 $soap_tests['GroupC'][] = $test;
00554 
00555 // echoMeStructRequest with endpoint NOT header destination, must understand
00556 $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=other)', NULL);
00557 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
00558         new SOAPStruct('arg',34,325.325), 1, SOAP_TEST_ACTOR_OTHER);
00559 $test->headers_expect = array();
00560 $soap_tests['GroupC'][] = $test;
00561 
00562 $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=other)', NULL);
00563 $test->type = 'soapval';
00564 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
00565             new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
00566             1, SOAP_TEST_ACTOR_OTHER);
00567 $test->headers_expect = array();
00568 $soap_tests['GroupC'][] = $test;
00569 
00570 //***********************************************************
00571 // echoMeUnknown
00572 
00573 // echoMeUnknown with endpoint as header destination, doesn't have to understand
00574 $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=next)', NULL);
00575 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',0,SOAP_ACTOR_NEXT);
00576 $test->headers_expect = array();
00577 $soap_tests['GroupC'][] = $test;
00578 
00579 $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=next)', NULL);
00580 $test->type = 'soapval';
00581 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),0,SOAP_ACTOR_NEXT);
00582 $test->headers_expect = array();
00583 $soap_tests['GroupC'][] = $test;
00584 
00585 // echoMeUnknown with endpoint as header destination, must understand
00586 $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=next)', NULL);
00587 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',1,SOAP_ACTOR_NEXT);
00588 $test->headers_expect = array();
00589 $test->expect_fault = TRUE;
00590 $soap_tests['GroupC'][] = $test;
00591 
00592 $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=next)', NULL);
00593 $test->type = 'soapval';
00594 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),1,SOAP_ACTOR_NEXT);
00595 $test->headers_expect = array();
00596 $test->expect_fault = TRUE;
00597 $soap_tests['GroupC'][] = $test;
00598 
00599 // echoMeUnknown with endpoint NOT header destination, doesn't have to understand
00600 $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=other)', NULL);
00601 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',0,SOAP_TEST_ACTOR_OTHER);
00602 $test->headers_expect = array();
00603 $soap_tests['GroupC'][] = $test;
00604 
00605 $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=other)', NULL);
00606 $test->type = 'soapval';
00607 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),0,SOAP_TEST_ACTOR_OTHER);
00608 $test->headers_expect = array();
00609 $soap_tests['GroupC'][] = $test;
00610 
00611 // echoMeUnknown with endpoint NOT header destination, must understand
00612 $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=other)', NULL);
00613 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',1,SOAP_TEST_ACTOR_OTHER);
00614 $test->headers_expect = array();
00615 $soap_tests['GroupC'][] = $test;
00616 
00617 $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=other)', NULL);
00618 $test->type = 'soapval';
00619 $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),1,SOAP_TEST_ACTOR_OTHER);
00620 $test->headers_expect = array();
00621 $soap_tests['GroupC'][] = $test;
00622 ?>