client_round2_params.php 28 KB

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