client_round2_params.php 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. <?php
  2. //
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4 |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2018 The PHP Group |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.02 of the PHP license, |
  9. // | that is bundled with this package in the file LICENSE, and is |
  10. // | available through the world-wide-web at |
  11. // | http://www.php.net/license/2_02.txt. |
  12. // | If you did not receive a copy of the PHP license and are unable to |
  13. // | obtain it through the world-wide-web, please send a note to |
  14. // | license@php.net so we can mail you a copy immediately. |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Shane Caraveo <Shane@Caraveo.com> |
  17. // +----------------------------------------------------------------------+
  18. define('SOAP_TEST_ACTOR_OTHER','http://some/other/actor');
  19. class SOAP_Test {
  20. var $type = 'php';
  21. var $test_name = NULL;
  22. var $method_name = NULL;
  23. var $method_params = NULL;
  24. var $cmp_func = NULL;
  25. var $expect = NULL;
  26. var $expect_fault = FALSE;
  27. var $headers = NULL;
  28. var $headers_expect = NULL;
  29. var $result = array();
  30. var $show = 1;
  31. var $debug = 0;
  32. var $encoding = 'UTF-8';
  33. function SOAP_Test($methodname, $params, $expect = NULL, $cmp_func = NULL) {
  34. # XXX we have to do this to make php-soap happy with NULL params
  35. if (!$params) $params = array();
  36. if (strchr($methodname,'(')) {
  37. preg_match('/(.*)\((.*)\)/',$methodname,$matches);
  38. $this->test_name = $methodname;
  39. $this->method_name = $matches[1];
  40. } else {
  41. $this->test_name = $this->method_name = $methodname;
  42. }
  43. $this->method_params = $params;
  44. if ($expect !== NULL) {
  45. $this->expect = $expect;
  46. }
  47. if ($cmp_func !== NULL) {
  48. $this->cmp_func = $cmp_func;
  49. }
  50. // determine test type
  51. if ($params) {
  52. $v = array_values($params);
  53. if (gettype($v[0]) == 'object' &&
  54. (get_class($v[0]) == 'SoapVar' || get_class($v[0]) == 'SoapParam'))
  55. $this->type = 'soapval';
  56. }
  57. }
  58. function setResult($ok, $result, $wire, $error = '', $fault = NULL)
  59. {
  60. $this->result['success'] = $ok;
  61. $this->result['result'] = $result;
  62. $this->result['error'] = $error;
  63. $this->result['wire'] = $wire;
  64. $this->result['fault'] = $fault;
  65. }
  66. /**
  67. * showMethodResult
  68. * print simple output about a methods result
  69. *
  70. * @param array endpoint_info
  71. * @param string method
  72. * @access public
  73. */
  74. function showTestResult($debug = 0, $html = 0) {
  75. // debug output
  76. if ($debug) $this->show = 1;
  77. if ($debug) {
  78. echo str_repeat("-",50).$html?"<br>\n":"\n";
  79. }
  80. echo "testing $this->test_name : ";
  81. if ($debug) {
  82. print "method params: ";
  83. print_r($this->params);
  84. print "\n";
  85. }
  86. $ok = $this->result['success'];
  87. if ($ok) {
  88. if ($html) {
  89. print "<font color=\"#00cc00\">SUCCESS</font>\n";
  90. } else {
  91. print "SUCCESS\n";
  92. }
  93. } else {
  94. $fault = $this->result['fault'];
  95. if ($fault) {
  96. $res = $fault->faultcode;
  97. $pos = strpos($res,':');
  98. if ($pos !== false) {
  99. $res = substr($res,$pos+1);
  100. }
  101. if ($html) {
  102. print "<font color=\"#ff0000\">FAILED: [$res] {$fault->faultstring}</font>\n";
  103. } else {
  104. print "FAILED: [$res] {$fault->faultstring}\n";
  105. }
  106. } else {
  107. if ($html) {
  108. print "<font color=\"#ff0000\">FAILED: ".$this->result['result']."</font>\n";
  109. } else {
  110. print "FAILED: ".$this->result['result']."\n";
  111. }
  112. }
  113. }
  114. if ($debug) {
  115. if ($html) {
  116. echo "<pre>\n".htmlentities($this->result['wire'])."</pre>\n";
  117. } else {
  118. echo "\n".htmlentities($this->result['wire'])."\n";
  119. }
  120. }
  121. }
  122. }
  123. # XXX I know this isn't quite right, need to deal with this better
  124. function make_2d($x, $y)
  125. {
  126. for ($_x = 0; $_x < $x; $_x++) {
  127. for ($_y = 0; $_y < $y; $_y++) {
  128. $a[$_x][$_y] = "x{$_x}y{$_y}";
  129. }
  130. }
  131. return $a;
  132. }
  133. function soap_value($name, $value, $type, $type_name=NULL, $type_ns=NULL) {
  134. return new SoapParam(new SoapVar($value,$type,$type_name,$type_ns),$name);
  135. }
  136. class SOAPStruct {
  137. var $varString;
  138. var $varInt;
  139. var $varFloat;
  140. function SOAPStruct($s, $i, $f) {
  141. $this->varString = $s;
  142. $this->varInt = $i;
  143. $this->varFloat = $f;
  144. }
  145. }
  146. //***********************************************************
  147. // Base echoString
  148. $soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => 'hello world!'));
  149. $soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => soap_value('inputString','hello world',XSD_STRING)));
  150. $soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => ''));
  151. $soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => soap_value('inputString','',XSD_STRING)));
  152. $soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => NULL));
  153. $soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => soap_value('inputString',NULL,XSD_STRING)));
  154. //$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"));
  155. //$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)));
  156. $soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => ">,<,&,\",',\\,\n"));
  157. $soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => soap_value('inputString',">,<,&,\",',\\,\n",XSD_STRING)));
  158. $test = new SOAP_Test('echoString(utf-8)', array('inputString' => utf8_encode('ỗÈéóÒ₧⅜ỗỸ')));
  159. $test->encoding = 'UTF-8';
  160. $soap_tests['base'][] = $test;
  161. $test = new SOAP_Test('echoString(utf-8)', array('inputString' => soap_value('inputString',utf8_encode('ỗÈéóÒ₧⅜ỗỸ'),XSD_STRING)));
  162. $test->encoding = 'UTF-8';
  163. $soap_tests['base'][] = $test;
  164. //***********************************************************
  165. // Base echoStringArray
  166. $soap_tests['base'][] = new SOAP_Test('echoStringArray',
  167. array('inputStringArray' => array('good','bad')));
  168. $soap_tests['base'][] = new SOAP_Test('echoStringArray',
  169. array('inputStringArray' =>
  170. soap_value('inputStringArray',array('good','bad'),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
  171. $soap_tests['base'][] = new SOAP_Test('echoStringArray(one)',
  172. array('inputStringArray' => array('good')));
  173. $soap_tests['base'][] = new SOAP_Test('echoStringArray(one)',
  174. array('inputStringArray' =>
  175. soap_value('inputStringArray',array('good'),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
  176. // empty array test
  177. $soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => array()));
  178. $soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => soap_value('inputStringArray',array(),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
  179. # XXX NULL Arrays not supported
  180. // null array test
  181. $soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => NULL));
  182. $soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => soap_value('inputStringArray',NULL,SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
  183. //***********************************************************
  184. // Base echoInteger
  185. $x = new SOAP_Test('echoInteger', array('inputInteger' => 34345));
  186. $soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => 34345));
  187. $soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => soap_value('inputInteger',12345,XSD_INT)));
  188. //***********************************************************
  189. // Base echoIntegerArray
  190. $soap_tests['base'][] = new SOAP_Test('echoIntegerArray', array('inputIntegerArray' => array(1,234324324,2)));
  191. $soap_tests['base'][] = new SOAP_Test('echoIntegerArray',
  192. array('inputIntegerArray' =>
  193. soap_value('inputIntegerArray',
  194. array(new SoapVar(12345,XSD_INT),new SoapVar(654321,XSD_INT)),
  195. SOAP_ENC_ARRAY,"ArrayOfint","http://soapinterop.org/xsd")));
  196. //***********************************************************
  197. // Base echoFloat
  198. $soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => 342.23));
  199. $soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => soap_value('inputFloat',123.45,XSD_FLOAT)));
  200. //***********************************************************
  201. // Base echoFloatArray
  202. $soap_tests['base'][] = new SOAP_Test('echoFloatArray', array('inputFloatArray' => array(1.3223,34.2,325.325)));
  203. $soap_tests['base'][] = new SOAP_Test('echoFloatArray',
  204. array('inputFloatArray' =>
  205. soap_value('inputFloatArray',
  206. array(new SoapVar(123.45,XSD_FLOAT),new SoapVar(654.321,XSD_FLOAT)),
  207. SOAP_ENC_ARRAY,"ArrayOffloat","http://soapinterop.org/xsd")));
  208. //***********************************************************
  209. // Base echoStruct
  210. $soapstruct = new SOAPStruct('arg',34,325.325);
  211. # XXX no way to set a namespace!!!
  212. $soapsoapstruct = soap_value('inputStruct',$soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd");
  213. $soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' =>$soapstruct));
  214. $soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' =>$soapsoapstruct));
  215. //***********************************************************
  216. // Base echoStructArray
  217. $soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' => array(
  218. $soapstruct,$soapstruct,$soapstruct)));
  219. $soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' =>
  220. soap_value('inputStructArray',array(
  221. new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
  222. new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
  223. new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd")),
  224. SOAP_ENC_ARRAY,"ArrayOfSOAPStruct","http://soapinterop.org/xsd")));
  225. //***********************************************************
  226. // Base echoVoid
  227. $soap_tests['base'][] = new SOAP_Test('echoVoid', NULL);
  228. $test = new SOAP_Test('echoVoid', NULL);
  229. $test->type = 'soapval';
  230. $soap_tests['base'][] = $test;
  231. //***********************************************************
  232. // Base echoBase64
  233. $soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' => 'TmVicmFza2E='));
  234. $soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' =>
  235. soap_value('inputBase64','TmVicmFza2E=',XSD_BASE64BINARY)));
  236. //***********************************************************
  237. // Base echoHexBinary
  238. $soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => '736F61707834'),'736F61707834','hex_compare');
  239. $soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' =>
  240. soap_value('inputHexBinary','736F61707834',XSD_HEXBINARY)),'736F61707834','hex_compare');
  241. //***********************************************************
  242. // Base echoDecimal
  243. # XXX test fails because php-soap incorrectly sets decimal to long rather than float
  244. $soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => '12345.67890'));
  245. $soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' =>
  246. soap_value('inputDecimal','12345.67890',XSD_DECIMAL)));
  247. //***********************************************************
  248. // Base echoDate
  249. # php-soap doesn't handle datetime types properly yet
  250. $soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => '2001-05-24T17:31:41Z'), null, 'date_compare');
  251. $soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' =>
  252. soap_value('inputDate','2001-05-24T17:31:41Z',XSD_DATETIME)), null, 'date_compare');
  253. //***********************************************************
  254. // Base echoBoolean
  255. # php-soap sends boolean as zero or one, which is ok, but to be explicit, send true or false.
  256. $soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' => TRUE));
  257. $soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' =>
  258. soap_value('inputBoolean',TRUE,XSD_BOOLEAN)));
  259. $soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' => FALSE));
  260. $soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' =>
  261. soap_value('inputBoolean',FALSE,XSD_BOOLEAN)));
  262. $soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' => 1),true);
  263. $soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' =>
  264. soap_value('inputBoolean',1,XSD_BOOLEAN)),true);
  265. $soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' => 0),false);
  266. $soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' =>
  267. soap_value('inputBoolean',0,XSD_BOOLEAN)),false);
  268. //***********************************************************
  269. // GROUP B
  270. //***********************************************************
  271. // GroupB echoStructAsSimpleTypes
  272. $expect = array(
  273. 'outputString'=>'arg',
  274. 'outputInteger'=>34,
  275. 'outputFloat'=>325.325
  276. );
  277. $soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes',
  278. array('inputStruct' => (object)array(
  279. 'varString'=>'arg',
  280. 'varInt'=>34,
  281. 'varFloat'=>325.325
  282. )), $expect);
  283. $soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes',
  284. array('inputStruct' =>
  285. soap_value('inputStruct',
  286. (object)array('varString' => 'arg',
  287. 'varInt' => 34,
  288. 'varFloat' => 325.325
  289. ), SOAP_ENC_OBJECT, "SOAPStruct","http://soapinterop.org/xsd")), $expect);
  290. //***********************************************************
  291. // GroupB echoSimpleTypesAsStruct
  292. $expect =
  293. (object)array(
  294. 'varString'=>'arg',
  295. 'varInt'=>34,
  296. 'varFloat'=>325.325
  297. );
  298. $soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct',
  299. array(
  300. 'inputString'=>'arg',
  301. 'inputInteger'=>34,
  302. 'inputFloat'=>325.325
  303. ), $expect);
  304. $soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct',
  305. array(
  306. soap_value('inputString','arg', XSD_STRING),
  307. soap_value('inputInteger',34, XSD_INT),
  308. soap_value('inputFloat',325.325, XSD_FLOAT)
  309. ), $expect);
  310. //***********************************************************
  311. // GroupB echo2DStringArray
  312. $soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray',
  313. array('input2DStringArray' => make_2d(3,3)));
  314. $multidimarray =
  315. soap_value('input2DStringArray',
  316. array(
  317. array('row0col0', 'row0col1', 'row0col2'),
  318. array('row1col0', 'row1col1', 'row1col2')
  319. ), SOAP_ENC_ARRAY
  320. );
  321. //$multidimarray->options['flatten'] = TRUE;
  322. $soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray',
  323. array('input2DStringArray' => $multidimarray));
  324. //***********************************************************
  325. // GroupB echoNestedStruct
  326. $strstr = (object)array(
  327. 'varString'=>'arg',
  328. 'varInt'=>34,
  329. 'varFloat'=>325.325,
  330. 'varStruct' => (object)array(
  331. 'varString'=>'arg',
  332. 'varInt'=>34,
  333. 'varFloat'=>325.325
  334. ));
  335. $soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct',
  336. array('inputStruct' => $strstr));
  337. $soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct',
  338. array('inputStruct' =>
  339. soap_value('inputStruct',
  340. (object)array(
  341. 'varString'=>'arg',
  342. 'varInt'=>34,
  343. 'varFloat'=>325.325,
  344. 'varStruct' => new SoapVar((object)array(
  345. 'varString'=>'arg',
  346. 'varInt'=>34,
  347. 'varFloat'=>325.325
  348. ), SOAP_ENC_OBJECT, "SOAPStruct","http://soapinterop.org/xsd")
  349. ), SOAP_ENC_OBJECT, "SOAPStructStruct","http://soapinterop.org/xsd"
  350. )),$strstr);
  351. //***********************************************************
  352. // GroupB echoNestedArray
  353. $arrstr = (object)array(
  354. 'varString'=>'arg',
  355. 'varInt'=>34,
  356. 'varFloat'=>325.325,
  357. 'varArray' => array('red','blue','green')
  358. );
  359. $soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray',
  360. array('inputStruct' => $arrstr));
  361. $soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray',
  362. array('inputStruct' =>
  363. soap_value('inputStruct',
  364. (object)array('varString' => 'arg',
  365. 'varInt' => 34,
  366. 'varFloat' => 325.325,
  367. 'varArray' =>
  368. new SoapVar(array("red", "blue", "green"), SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd")
  369. ), SOAP_ENC_OBJECT, "SOAPArrayStruct","http://soapinterop.org/xsd"
  370. )),$arrstr);
  371. //***********************************************************
  372. // GROUP C header tests
  373. //***********************************************************
  374. // echoMeStringRequest
  375. // echoMeStringRequest with endpoint as header destination, doesn't have to understand
  376. $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=next)', NULL);
  377. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 0, SOAP_ACTOR_NEXT);
  378. $test->headers_expect = array('echoMeStringResponse'=>'hello world');
  379. $soap_tests['GroupC'][] = $test;
  380. $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=next)', NULL);
  381. $test->type = 'soapval';
  382. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 0, SOAP_ACTOR_NEXT);
  383. $test->headers_expect = array('echoMeStringResponse'=>'hello world');
  384. $soap_tests['GroupC'][] = $test;
  385. // echoMeStringRequest with endpoint as header destination, must understand
  386. $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=next)', NULL);
  387. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT);
  388. $test->headers_expect = array('echoMeStringResponse'=>'hello world');
  389. $soap_tests['GroupC'][] = $test;
  390. $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=next)', NULL);
  391. $test->type = 'soapval';
  392. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 1, SOAP_ACTOR_NEXT);
  393. $test->headers_expect = array('echoMeStringResponse'=>'hello world');
  394. $soap_tests['GroupC'][] = $test;
  395. // echoMeStringRequest with endpoint NOT header destination, doesn't have to understand
  396. $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=other)', NULL);
  397. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 0, SOAP_TEST_ACTOR_OTHER);
  398. $test->headers_expect = array();
  399. $soap_tests['GroupC'][] = $test;
  400. $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=other)', NULL);
  401. $test->type = 'soapval';
  402. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 0, SOAP_TEST_ACTOR_OTHER);
  403. $test->headers_expect = array();
  404. $soap_tests['GroupC'][] = $test;
  405. // echoMeStringRequest with endpoint NOT header destination, must understand
  406. $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=other)', NULL);
  407. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_TEST_ACTOR_OTHER);
  408. $test->headers_expect = array();
  409. $soap_tests['GroupC'][] = $test;
  410. $test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=other)', NULL);
  411. $test->type = 'soapval';
  412. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world', XSD_STRING), 1, SOAP_TEST_ACTOR_OTHER);
  413. $test->headers_expect = array();
  414. $soap_tests['GroupC'][] = $test;
  415. // echoMeStringRequest with endpoint header destination, must understand,
  416. // invalid namespace, should receive a fault
  417. $test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL);
  418. $test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT);
  419. $test->headers_expect = array();
  420. $test->expect_fault = TRUE;
  421. $soap_tests['GroupC'][] = $test;
  422. $test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL);
  423. $test->type = 'soapval';
  424. $test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', new SoapVar('hello world', XSD_STRING), 1, SOAP_ACTOR_NEXT);
  425. $test->headers_expect = array();
  426. $test->expect_fault = TRUE;
  427. $soap_tests['GroupC'][] = $test;
  428. //***********************************************************
  429. // echoMeStructRequest
  430. // echoMeStructRequest with endpoint as header destination, doesn't have to understand
  431. $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=next)', NULL);
  432. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
  433. new SOAPStruct('arg',34,325.325), 0, SOAP_ACTOR_NEXT);
  434. $test->headers_expect =
  435. array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
  436. $soap_tests['GroupC'][] = $test;
  437. $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=next)', NULL);
  438. $test->type = 'soapval';
  439. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
  440. new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
  441. 0, SOAP_ACTOR_NEXT);
  442. $test->headers_expect =
  443. array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
  444. $soap_tests['GroupC'][] = $test;
  445. // echoMeStructRequest with endpoint as header destination, must understand
  446. $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=next)', NULL);
  447. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
  448. new SOAPStruct('arg',34,325.325), 1, SOAP_ACTOR_NEXT);
  449. $test->headers_expect =
  450. array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
  451. $soap_tests['GroupC'][] = $test;
  452. $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=next)', NULL);
  453. $test->type = 'soapval';
  454. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
  455. new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
  456. 1, SOAP_ACTOR_NEXT);
  457. $test->headers_expect =
  458. array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
  459. $soap_tests['GroupC'][] = $test;
  460. // echoMeStructRequest with endpoint NOT header destination, doesn't have to understand
  461. $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=other)', NULL);
  462. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
  463. new SOAPStruct('arg',34,325.325), 0, SOAP_TEST_ACTOR_OTHER);
  464. $test->headers_expect = array();
  465. $soap_tests['GroupC'][] = $test;
  466. $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=other)', NULL);
  467. $test->type = 'soapval';
  468. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
  469. new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
  470. 0, SOAP_TEST_ACTOR_OTHER);
  471. $test->headers_expect = array();
  472. $soap_tests['GroupC'][] = $test;
  473. // echoMeStructRequest with endpoint NOT header destination, must understand
  474. $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=other)', NULL);
  475. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
  476. new SOAPStruct('arg',34,325.325), 1, SOAP_TEST_ACTOR_OTHER);
  477. $test->headers_expect = array();
  478. $soap_tests['GroupC'][] = $test;
  479. $test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=other)', NULL);
  480. $test->type = 'soapval';
  481. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
  482. new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
  483. 1, SOAP_TEST_ACTOR_OTHER);
  484. $test->headers_expect = array();
  485. $soap_tests['GroupC'][] = $test;
  486. //***********************************************************
  487. // echoMeUnknown
  488. // echoMeUnknown with endpoint as header destination, doesn't have to understand
  489. $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=next)', NULL);
  490. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',0,SOAP_ACTOR_NEXT);
  491. $test->headers_expect = array();
  492. $soap_tests['GroupC'][] = $test;
  493. $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=next)', NULL);
  494. $test->type = 'soapval';
  495. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),0,SOAP_ACTOR_NEXT);
  496. $test->headers_expect = array();
  497. $soap_tests['GroupC'][] = $test;
  498. // echoMeUnknown with endpoint as header destination, must understand
  499. $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=next)', NULL);
  500. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',1,SOAP_ACTOR_NEXT);
  501. $test->headers_expect = array();
  502. $test->expect_fault = TRUE;
  503. $soap_tests['GroupC'][] = $test;
  504. $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=next)', NULL);
  505. $test->type = 'soapval';
  506. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),1,SOAP_ACTOR_NEXT);
  507. $test->headers_expect = array();
  508. $test->expect_fault = TRUE;
  509. $soap_tests['GroupC'][] = $test;
  510. // echoMeUnknown with endpoint NOT header destination, doesn't have to understand
  511. $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=other)', NULL);
  512. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',0,SOAP_TEST_ACTOR_OTHER);
  513. $test->headers_expect = array();
  514. $soap_tests['GroupC'][] = $test;
  515. $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=other)', NULL);
  516. $test->type = 'soapval';
  517. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),0,SOAP_TEST_ACTOR_OTHER);
  518. $test->headers_expect = array();
  519. $soap_tests['GroupC'][] = $test;
  520. // echoMeUnknown with endpoint NOT header destination, must understand
  521. $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=other)', NULL);
  522. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',1,SOAP_TEST_ACTOR_OTHER);
  523. $test->headers_expect = array();
  524. $soap_tests['GroupC'][] = $test;
  525. $test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=other)', NULL);
  526. $test->type = 'soapval';
  527. $test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),1,SOAP_TEST_ACTOR_OTHER);
  528. $test->headers_expect = array();
  529. $soap_tests['GroupC'][] = $test;
  530. ?>