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