summaryrefslogtreecommitdiff
path: root/ext/soap
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-03-14 05:42:27 +0000
committer <>2013-04-03 16:25:08 +0000
commitc4dd7a1a684490673e25aaf4fabec5df138854c4 (patch)
tree4d57c44caae4480efff02b90b9be86f44bf25409 /ext/soap
downloadphp2-master.tar.gz
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/soap')
-rw-r--r--ext/soap/CREDITS2
-rw-r--r--ext/soap/TODO98
-rw-r--r--ext/soap/TODO.old38
-rw-r--r--ext/soap/config.m425
-rw-r--r--ext/soap/config.w3218
-rw-r--r--ext/soap/interop/client_round2.php113
-rw-r--r--ext/soap/interop/client_round2_interop.php785
-rw-r--r--ext/soap/interop/client_round2_params.php622
-rw-r--r--ext/soap/interop/client_round2_results.php75
-rw-r--r--ext/soap/interop/client_round2_run.php53
-rw-r--r--ext/soap/interop/config.php.dist5
-rw-r--r--ext/soap/interop/database_round2.sql44
-rw-r--r--ext/soap/interop/echoheadersvc.wsdl.php398
-rw-r--r--ext/soap/interop/index.php59
-rw-r--r--ext/soap/interop/interop.wsdl.php336
-rw-r--r--ext/soap/interop/interopB.wsdl.php196
-rw-r--r--ext/soap/interop/server_round2_base.php105
-rw-r--r--ext/soap/interop/server_round2_groupB.php58
-rw-r--r--ext/soap/interop/server_round2_groupC.php43
-rw-r--r--ext/soap/interop/test.utility.php143
-rw-r--r--ext/soap/package.xml64
-rw-r--r--ext/soap/php_encoding.c3790
-rw-r--r--ext/soap/php_encoding.h216
-rw-r--r--ext/soap/php_http.c1466
-rw-r--r--ext/soap/php_http.h41
-rw-r--r--ext/soap/php_packet_soap.c426
-rw-r--r--ext/soap/php_packet_soap.h27
-rw-r--r--ext/soap/php_schema.c2549
-rw-r--r--ext/soap/php_schema.h40
-rw-r--r--ext/soap/php_sdl.c3705
-rw-r--r--ext/soap/php_sdl.h272
-rw-r--r--ext/soap/php_soap.dsp156
-rw-r--r--ext/soap/php_soap.h210
-rw-r--r--ext/soap/php_xml.c328
-rw-r--r--ext/soap/php_xml.h79
-rw-r--r--ext/soap/soap.c4847
-rw-r--r--ext/soap/tests/any.phpt92
-rw-r--r--ext/soap/tests/bug46760.phpt18
-rw-r--r--ext/soap/tests/bug48557.phpt73
-rw-r--r--ext/soap/tests/bug48557.wsdl31
-rw-r--r--ext/soap/tests/bugs/bug27722.phpt15
-rw-r--r--ext/soap/tests/bugs/bug27722.wsdl92
-rw-r--r--ext/soap/tests/bugs/bug27742.phpt15
-rw-r--r--ext/soap/tests/bugs/bug27742.wsdl854
-rw-r--r--ext/soap/tests/bugs/bug28751.phpt38
-rw-r--r--ext/soap/tests/bugs/bug28969.phpt38
-rw-r--r--ext/soap/tests/bugs/bug28985.phpt206
-rw-r--r--ext/soap/tests/bugs/bug28985.wsdl683
-rw-r--r--ext/soap/tests/bugs/bug29061.phpt14
-rw-r--r--ext/soap/tests/bugs/bug29061.wsdl41
-rw-r--r--ext/soap/tests/bugs/bug29109.phpt16
-rw-r--r--ext/soap/tests/bugs/bug29109.wsdl121
-rw-r--r--ext/soap/tests/bugs/bug29236.phpt22
-rw-r--r--ext/soap/tests/bugs/bug29236.wsdl287
-rw-r--r--ext/soap/tests/bugs/bug29795.phpt34
-rw-r--r--ext/soap/tests/bugs/bug29795.wsdl40
-rw-r--r--ext/soap/tests/bugs/bug29830.phpt25
-rw-r--r--ext/soap/tests/bugs/bug29839.phpt43
-rw-r--r--ext/soap/tests/bugs/bug29839.wsdl42
-rw-r--r--ext/soap/tests/bugs/bug29844.phpt38
-rw-r--r--ext/soap/tests/bugs/bug29844.wsdl66
-rw-r--r--ext/soap/tests/bugs/bug30045.phpt173
-rw-r--r--ext/soap/tests/bugs/bug30106.phpt72
-rw-r--r--ext/soap/tests/bugs/bug30106.wsdl59
-rw-r--r--ext/soap/tests/bugs/bug30175.phpt47
-rw-r--r--ext/soap/tests/bugs/bug30175.wsdl126
-rw-r--r--ext/soap/tests/bugs/bug30799.phpt25
-rw-r--r--ext/soap/tests/bugs/bug30928.phpt63
-rw-r--r--ext/soap/tests/bugs/bug30928.wsdl49
-rw-r--r--ext/soap/tests/bugs/bug30994.phpt47
-rw-r--r--ext/soap/tests/bugs/bug31422-win.phpt47
-rw-r--r--ext/soap/tests/bugs/bug31422.phpt48
-rw-r--r--ext/soap/tests/bugs/bug31695.phpt62
-rw-r--r--ext/soap/tests/bugs/bug31695.wsdl47
-rw-r--r--ext/soap/tests/bugs/bug31755.phpt19
-rw-r--r--ext/soap/tests/bugs/bug32776.phpt49
-rw-r--r--ext/soap/tests/bugs/bug32776.wsdl47
-rw-r--r--ext/soap/tests/bugs/bug32941.phpt41
-rwxr-xr-xext/soap/tests/bugs/bug32941.wsdl141
-rw-r--r--ext/soap/tests/bugs/bug34449.phpt20
-rw-r--r--ext/soap/tests/bugs/bug34453.phpt43
-rwxr-xr-xext/soap/tests/bugs/bug34453.wsdl42
-rw-r--r--ext/soap/tests/bugs/bug34643.phpt48
-rwxr-xr-xext/soap/tests/bugs/bug34643.wsdl42
-rw-r--r--ext/soap/tests/bugs/bug34657.phpt35
-rw-r--r--ext/soap/tests/bugs/bug35142.phpt135
-rwxr-xr-xext/soap/tests/bugs/bug35142.wsdl543
-rw-r--r--ext/soap/tests/bugs/bug35273.phpt23
-rw-r--r--ext/soap/tests/bugs/bug36226-2.phpt123
-rwxr-xr-xext/soap/tests/bugs/bug36226-2.wsdl543
-rw-r--r--ext/soap/tests/bugs/bug36226.phpt139
-rw-r--r--ext/soap/tests/bugs/bug36575.phpt52
-rwxr-xr-xext/soap/tests/bugs/bug36575.wsdl87
-rw-r--r--ext/soap/tests/bugs/bug36614.phpt13
-rwxr-xr-xext/soap/tests/bugs/bug36614.wsdl204
-rw-r--r--ext/soap/tests/bugs/bug36629.phpt53
-rw-r--r--ext/soap/tests/bugs/bug36908.phpt46
-rwxr-xr-xext/soap/tests/bugs/bug36908.wsdl51
-rw-r--r--ext/soap/tests/bugs/bug36999.phpt50
-rwxr-xr-xext/soap/tests/bugs/bug36999.wsdl48
-rw-r--r--ext/soap/tests/bugs/bug37013.phpt58
-rwxr-xr-xext/soap/tests/bugs/bug37013.wsdl67
-rw-r--r--ext/soap/tests/bugs/bug37083.phpt58
-rwxr-xr-xext/soap/tests/bugs/bug37083.wsdl99
-rw-r--r--ext/soap/tests/bugs/bug37278.phpt24
-rw-r--r--ext/soap/tests/bugs/bug38004.phpt42
-rwxr-xr-xext/soap/tests/bugs/bug38004.wsdl51
-rw-r--r--ext/soap/tests/bugs/bug38005.phpt43
-rw-r--r--ext/soap/tests/bugs/bug38055.phpt41
-rwxr-xr-xext/soap/tests/bugs/bug38055.wsdl49
-rw-r--r--ext/soap/tests/bugs/bug38067.phpt42
-rwxr-xr-xext/soap/tests/bugs/bug38067.wsdl48
-rw-r--r--ext/soap/tests/bugs/bug38536.phpt52
-rwxr-xr-xext/soap/tests/bugs/bug38536.wsdl57
-rw-r--r--ext/soap/tests/bugs/bug39121.phpt73
-rw-r--r--ext/soap/tests/bugs/bug39815.phpt50
-rw-r--r--ext/soap/tests/bugs/bug39832.phpt29
-rwxr-xr-xext/soap/tests/bugs/bug39832.wsdl55
-rw-r--r--ext/soap/tests/bugs/bug40609.phpt21
-rwxr-xr-xext/soap/tests/bugs/bug40609.wsdl26
-rw-r--r--ext/soap/tests/bugs/bug41004.phpt36
-rwxr-xr-xext/soap/tests/bugs/bug41004.wsdl69
-rw-r--r--ext/soap/tests/bugs/bug41097.phpt27
-rw-r--r--ext/soap/tests/bugs/bug41337.phpt12
-rwxr-xr-xext/soap/tests/bugs/bug41337.wsdl63
-rw-r--r--ext/soap/tests/bugs/bug41337_2.phpt12
-rwxr-xr-xext/soap/tests/bugs/bug41337_2.wsdl36
-rwxr-xr-xext/soap/tests/bugs/bug41337_2_1.wsdl47
-rw-r--r--ext/soap/tests/bugs/bug41477.phpt20
-rw-r--r--ext/soap/tests/bugs/bug41566.phpt65
-rw-r--r--ext/soap/tests/bugs/bug42086.phpt31
-rwxr-xr-xext/soap/tests/bugs/bug42086.wsdl141
-rw-r--r--ext/soap/tests/bugs/bug42151.phpt32
-rw-r--r--ext/soap/tests/bugs/bug42183.phpt27
-rw-r--r--ext/soap/tests/bugs/bug42214.phpt24
-rw-r--r--ext/soap/tests/bugs/bug42326.phpt49
-rwxr-xr-xext/soap/tests/bugs/bug42326.wsdl82
-rw-r--r--ext/soap/tests/bugs/bug42359.phpt20
-rwxr-xr-xext/soap/tests/bugs/bug42359.wsdl58
-rw-r--r--ext/soap/tests/bugs/bug42488.phpt22
-rw-r--r--ext/soap/tests/bugs/bug42692.phpt39
-rwxr-xr-xext/soap/tests/bugs/bug42692.wsdl40
-rw-r--r--ext/soap/tests/bugs/bug43045.phpt52
-rw-r--r--ext/soap/tests/bugs/bug44686.phpt14
-rw-r--r--ext/soap/tests/bugs/bug44686.wsdl193
-rw-r--r--ext/soap/tests/bugs/bug44811.phpt19
-rw-r--r--ext/soap/tests/bugs/bug44882.phpt64
-rw-r--r--ext/soap/tests/bugs/bug44882.wsdl75
-rw-r--r--ext/soap/tests/bugs/bug46419.phpt43
-rw-r--r--ext/soap/tests/bugs/bug46427.phpt22
-rw-r--r--ext/soap/tests/bugs/bug47049.phpt19
-rw-r--r--ext/soap/tests/bugs/bug47049.wsdl80
-rw-r--r--ext/soap/tests/bugs/bug47273.phpt53
-rw-r--r--ext/soap/tests/bugs/bug50698_1.phpt13
-rw-r--r--ext/soap/tests/bugs/bug50698_1.wsdl228
-rw-r--r--ext/soap/tests/bugs/bug50698_2.phpt22
-rw-r--r--ext/soap/tests/bugs/bug50698_2.wsdl422
-rw-r--r--ext/soap/tests/bugs/bug50698_3.phpt22
-rw-r--r--ext/soap/tests/bugs/bug50698_3.wsdl312
-rw-r--r--ext/soap/tests/bugs/bug50698_4.phpt13
-rw-r--r--ext/soap/tests/bugs/bug50698_4.wsdl228
-rw-r--r--ext/soap/tests/bugs/bug50762.phpt47
-rw-r--r--ext/soap/tests/bugs/bug50762.wsdl36
-rw-r--r--ext/soap/tests/bugs/bug50997.phpt16
-rw-r--r--ext/soap/tests/bugs/bug50997.wsdl54
-rw-r--r--ext/soap/tests/bugs/bug54911.phpt22
-rw-r--r--ext/soap/tests/bugs/bug55323.phpt45
-rw-r--r--ext/soap/tests/bugs/bug55323.wsdl50
-rw-r--r--ext/soap/tests/bugs/multiport.phpt16
-rw-r--r--ext/soap/tests/bugs/multiport.wsdl88
-rw-r--r--ext/soap/tests/bugs/skipif.inc3
-rw-r--r--ext/soap/tests/bugs/xml.xsd34
-rwxr-xr-xext/soap/tests/bugs/xml2.xsd146
-rw-r--r--ext/soap/tests/classmap.wsdl60
-rw-r--r--ext/soap/tests/classmap001.phpt52
-rw-r--r--ext/soap/tests/classmap002.phpt46
-rw-r--r--ext/soap/tests/classmap003.phpt54
-rwxr-xr-xext/soap/tests/classmap003.wsdl51
-rw-r--r--ext/soap/tests/classmap004.phpt66
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_001p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_001s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_001w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_002p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_002s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_002w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_003s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_003w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_004p.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_004s.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_004w.phpt23
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_005p.phpt20
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_005s.phpt20
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_005w.phpt22
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_006s.phpt23
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_006w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_007p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_007s.phpt22
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_007w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_008p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_008s.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_008w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_009p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt20
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_009w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_010p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_010s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_010w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_011p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_011s.phpt24
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_011w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_012p.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_012s.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_012w.phpt22
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_013p.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_013s.phpt26
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_013w.phpt22
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt29
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_014s.phpt26
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt30
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt31
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt44
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt32
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_016p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_016s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_016w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_017p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_017s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_017w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_018p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_018s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_018w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_019p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_019s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_019w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_020p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_020s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_020w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_021p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_021s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_021w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_022p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_022s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_022w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_023p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_023s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_023w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_024p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_024s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_024w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/round2_base.inc81
-rw-r--r--ext/soap/tests/interop/Round2/Base/round2_base.wsdl332
-rw-r--r--ext/soap/tests/interop/Round2/Base/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_001s.phpt26
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_001w.phpt22
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_002p.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_002s.phpt24
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_002w.phpt22
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_003p.phpt22
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_003s.phpt31
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_003w.phpt24
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_004p.phpt31
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_004s.phpt31
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_004w.phpt32
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_005p.phpt26
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_005s.phpt31
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_005w.phpt27
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/round2_groupB.inc38
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/round2_groupB.wsdl192
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/imported/import1B.wsdl20
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/imported/import2B.wsdl22
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/imported/import2B.xsd12
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt31
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_002w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_003w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt40
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_001w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_002w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt30
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_004w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_001w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_002w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt30
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_004w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_emptysa_001w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_import1_001w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt30
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt30
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt31
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_001w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_002w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt30
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_004w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.inc17
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.wsdl85
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.inc12
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.wsdl65
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.inc28
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.wsdl135
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.inc29
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl175
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.inc14
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.wsdl37
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.inc14
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.wsdl26
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.inc14
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.wsdl26
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl26
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.inc19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.wsdl75
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.inc28
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl126
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt37
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt44
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt51
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt30
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt52
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt52
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.inc17
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.wsdl61
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/r3_groupF_ext_001w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt17
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_001w.phpt21
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_002w.phpt22
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_003w.phpt22
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_004w.phpt25
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.inc14
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.wsdl72
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/round3_groupF_extreq.wsdl73
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.inc22
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.wsdl70
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.inc33
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.wsdl216
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.inc33
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.wsdl171
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.inc25
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl185
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.inc25
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl151
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt30
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt36
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt44
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt39
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt39
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt39
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt54
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt54
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt54
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt54
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt30
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt29
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt37
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt37
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt37
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt37
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt45
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt45
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt45
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt45
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_001w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_002w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_003w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_004w.phpt24
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_005w.phpt24
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_006w.phpt24
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_007w.phpt24
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_008w.phpt25
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_009w.phpt25
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_010w.phpt25
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_011w.phpt25
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_012w.phpt23
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_013w.phpt23
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_014w.phpt23
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_015w.phpt23
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_016w.phpt23
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_017w.phpt23
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_001w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_002w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_003w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_004w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_005w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_006w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_007w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_008w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_009w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_010w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_011w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_012w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_013w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_014w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_015w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_016w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_017w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_001w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_002w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_003w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_004w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.inc38
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl329
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.inc38
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl301
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.inc56
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl418
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.inc56
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl408
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.inc22
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.wsdl81
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_001w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_002w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_003w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_004w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_005w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_006w.phptbin0 -> 1077 bytes
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_007w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt30
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt31
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_010w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_011w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_012w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_013w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt32
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt31
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_016w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_017w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_018w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt30
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt31
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_021w.phpt24
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_022w.phpt23
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt38
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt32
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt31
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_026w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_027w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt30
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_029w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_030w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_031w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_032w.phpt23
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_033w.phpt23
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_034w.phpt22
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_035w.phpt23
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.inc198
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.wsdl1113
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/skipif.inc3
-rw-r--r--ext/soap/tests/schema/schema001.phpt20
-rw-r--r--ext/soap/tests/schema/schema002.phpt23
-rw-r--r--ext/soap/tests/schema/schema003.phpt23
-rw-r--r--ext/soap/tests/schema/schema004.phpt22
-rw-r--r--ext/soap/tests/schema/schema005.phpt24
-rw-r--r--ext/soap/tests/schema/schema006.phpt25
-rw-r--r--ext/soap/tests/schema/schema007.phpt25
-rw-r--r--ext/soap/tests/schema/schema008.phpt27
-rw-r--r--ext/soap/tests/schema/schema009.phpt20
-rw-r--r--ext/soap/tests/schema/schema010.phpt20
-rw-r--r--ext/soap/tests/schema/schema011.phpt24
-rw-r--r--ext/soap/tests/schema/schema012.phpt24
-rw-r--r--ext/soap/tests/schema/schema013.phpt20
-rw-r--r--ext/soap/tests/schema/schema014.phpt22
-rw-r--r--ext/soap/tests/schema/schema015.phpt30
-rw-r--r--ext/soap/tests/schema/schema016.phpt32
-rw-r--r--ext/soap/tests/schema/schema017.phpt29
-rw-r--r--ext/soap/tests/schema/schema018.phpt27
-rw-r--r--ext/soap/tests/schema/schema019.phpt27
-rw-r--r--ext/soap/tests/schema/schema020.phpt29
-rw-r--r--ext/soap/tests/schema/schema021.phpt24
-rw-r--r--ext/soap/tests/schema/schema022.phpt26
-rw-r--r--ext/soap/tests/schema/schema023.phpt29
-rw-r--r--ext/soap/tests/schema/schema024.phpt31
-rw-r--r--ext/soap/tests/schema/schema025.phpt30
-rw-r--r--ext/soap/tests/schema/schema026.phpt31
-rw-r--r--ext/soap/tests/schema/schema027.phpt35
-rw-r--r--ext/soap/tests/schema/schema028.phpt36
-rw-r--r--ext/soap/tests/schema/schema029.phpt38
-rw-r--r--ext/soap/tests/schema/schema030.phpt28
-rw-r--r--ext/soap/tests/schema/schema031.phpt28
-rw-r--r--ext/soap/tests/schema/schema032.phpt26
-rw-r--r--ext/soap/tests/schema/schema033.phpt36
-rw-r--r--ext/soap/tests/schema/schema034.phpt37
-rw-r--r--ext/soap/tests/schema/schema035.phpt38
-rw-r--r--ext/soap/tests/schema/schema036.phpt37
-rw-r--r--ext/soap/tests/schema/schema037.phpt28
-rw-r--r--ext/soap/tests/schema/schema038.phpt29
-rw-r--r--ext/soap/tests/schema/schema039.phpt31
-rw-r--r--ext/soap/tests/schema/schema040.phpt32
-rw-r--r--ext/soap/tests/schema/schema041.phpt31
-rw-r--r--ext/soap/tests/schema/schema042.phpt29
-rw-r--r--ext/soap/tests/schema/schema043.phpt38
-rw-r--r--ext/soap/tests/schema/schema044.phpt29
-rw-r--r--ext/soap/tests/schema/schema045.phpt36
-rw-r--r--ext/soap/tests/schema/schema046.phpt38
-rw-r--r--ext/soap/tests/schema/schema047.phpt34
-rw-r--r--ext/soap/tests/schema/schema048.phpt36
-rw-r--r--ext/soap/tests/schema/schema049.phpt35
-rw-r--r--ext/soap/tests/schema/schema050.phpt28
-rw-r--r--ext/soap/tests/schema/schema051.phpt33
-rw-r--r--ext/soap/tests/schema/schema052.phpt28
-rw-r--r--ext/soap/tests/schema/schema053.phpt26
-rw-r--r--ext/soap/tests/schema/schema054.phpt23
-rw-r--r--ext/soap/tests/schema/schema055.phpt30
-rw-r--r--ext/soap/tests/schema/schema056.phpt29
-rw-r--r--ext/soap/tests/schema/schema057.phpt31
-rw-r--r--ext/soap/tests/schema/schema058.phpt30
-rw-r--r--ext/soap/tests/schema/schema059.phpt31
-rw-r--r--ext/soap/tests/schema/schema060.phpt36
-rw-r--r--ext/soap/tests/schema/schema061.phpt38
-rw-r--r--ext/soap/tests/schema/schema062.phpt29
-rw-r--r--ext/soap/tests/schema/schema063.phpt18
-rw-r--r--ext/soap/tests/schema/schema064.phpt61
-rw-r--r--ext/soap/tests/schema/schema065.phpt26
-rw-r--r--ext/soap/tests/schema/schema066.phpt26
-rw-r--r--ext/soap/tests/schema/schema067.phpt26
-rw-r--r--ext/soap/tests/schema/schema068.phpt18
-rw-r--r--ext/soap/tests/schema/schema069.phpt27
-rw-r--r--ext/soap/tests/schema/schema070.phpt29
-rw-r--r--ext/soap/tests/schema/schema071.phpt23
-rw-r--r--ext/soap/tests/schema/schema072.phpt25
-rw-r--r--ext/soap/tests/schema/schema073.phpt24
-rw-r--r--ext/soap/tests/schema/schema074.phpt29
-rw-r--r--ext/soap/tests/schema/schema075.phpt30
-rw-r--r--ext/soap/tests/schema/schema076.phpt30
-rw-r--r--ext/soap/tests/schema/schema077.phpt30
-rw-r--r--ext/soap/tests/schema/schema078.phpt32
-rw-r--r--ext/soap/tests/schema/schema079.phpt32
-rw-r--r--ext/soap/tests/schema/schema080.phpt32
-rw-r--r--ext/soap/tests/schema/schema081.phpt29
-rw-r--r--ext/soap/tests/schema/schema082.phpt31
-rw-r--r--ext/soap/tests/schema/schema083.phpt30
-rw-r--r--ext/soap/tests/schema/schema084.phpt31
-rw-r--r--ext/soap/tests/schema/schema085.phpt45
-rw-r--r--ext/soap/tests/schema/skipif.inc5
-rw-r--r--ext/soap/tests/schema/test_schema.inc77
-rw-r--r--ext/soap/tests/server001.phpt33
-rw-r--r--ext/soap/tests/server002.phpt37
-rw-r--r--ext/soap/tests/server003.phpt32
-rw-r--r--ext/soap/tests/server004.phpt40
-rw-r--r--ext/soap/tests/server005.phpt36
-rw-r--r--ext/soap/tests/server006.phpt42
-rw-r--r--ext/soap/tests/server007.phpt26
-rw-r--r--ext/soap/tests/server008.phpt29
-rw-r--r--ext/soap/tests/server009.phpt69
-rw-r--r--ext/soap/tests/server010.phpt61
-rw-r--r--ext/soap/tests/server011.phpt27
-rw-r--r--ext/soap/tests/server012.phpt20
-rw-r--r--ext/soap/tests/server013.phpt44
-rw-r--r--ext/soap/tests/server014.phpt37
-rw-r--r--ext/soap/tests/server015.phpt33
-rw-r--r--ext/soap/tests/server016.phpt34
-rw-r--r--ext/soap/tests/server017.phpt34
-rw-r--r--ext/soap/tests/server018.phpt34
-rw-r--r--ext/soap/tests/server019.phpt36
-rw-r--r--ext/soap/tests/server020.phpt37
-rw-r--r--ext/soap/tests/server021.phpt40
-rw-r--r--ext/soap/tests/server022.phpt41
-rw-r--r--ext/soap/tests/server023.phpt37
-rw-r--r--ext/soap/tests/server024.phpt49
-rw-r--r--ext/soap/tests/server025.phpt48
-rwxr-xr-xext/soap/tests/server025.wsdl55
-rw-r--r--ext/soap/tests/server026.phpt37
-rw-r--r--ext/soap/tests/server027.phpt30
-rw-r--r--ext/soap/tests/server028.phpt41
-rw-r--r--ext/soap/tests/server029.phpt55
-rw-r--r--ext/soap/tests/server030.phpt53
-rw-r--r--ext/soap/tests/server030.wsdl59
-rw-r--r--ext/soap/tests/server031.phpt69
-rw-r--r--ext/soap/tests/setheaders.phpt38
-rw-r--r--ext/soap/tests/skipif.inc3
-rw-r--r--ext/soap/tests/soap12/T01.phpt23
-rw-r--r--ext/soap/tests/soap12/T02.phpt23
-rw-r--r--ext/soap/tests/soap12/T03.phpt22
-rw-r--r--ext/soap/tests/soap12/T04.phpt23
-rw-r--r--ext/soap/tests/soap12/T05.phpt23
-rw-r--r--ext/soap/tests/soap12/T10.phpt23
-rw-r--r--ext/soap/tests/soap12/T11.phpt24
-rw-r--r--ext/soap/tests/soap12/T12.phpt23
-rw-r--r--ext/soap/tests/soap12/T13.phpt23
-rw-r--r--ext/soap/tests/soap12/T14.phpt23
-rw-r--r--ext/soap/tests/soap12/T15.phpt24
-rw-r--r--ext/soap/tests/soap12/T19.phpt24
-rw-r--r--ext/soap/tests/soap12/T22.phpt24
-rw-r--r--ext/soap/tests/soap12/T23.phpt24
-rw-r--r--ext/soap/tests/soap12/T24.phpt21
-rw-r--r--ext/soap/tests/soap12/T25.phpt22
-rw-r--r--ext/soap/tests/soap12/T26.phpt21
-rw-r--r--ext/soap/tests/soap12/T27.phpt29
-rw-r--r--ext/soap/tests/soap12/T28.phpt22
-rw-r--r--ext/soap/tests/soap12/T29.phpt23
-rw-r--r--ext/soap/tests/soap12/T30.phpt20
-rw-r--r--ext/soap/tests/soap12/T31.phpt22
-rw-r--r--ext/soap/tests/soap12/T32.phpt25
-rw-r--r--ext/soap/tests/soap12/T33.phpt20
-rw-r--r--ext/soap/tests/soap12/T34.phpt24
-rw-r--r--ext/soap/tests/soap12/T35.phpt24
-rw-r--r--ext/soap/tests/soap12/T36.phpt23
-rw-r--r--ext/soap/tests/soap12/T37.phpt23
-rw-r--r--ext/soap/tests/soap12/T38_1.phpt27
-rw-r--r--ext/soap/tests/soap12/T38_2.phpt27
-rw-r--r--ext/soap/tests/soap12/T39.phpt22
-rw-r--r--ext/soap/tests/soap12/T40.phpt26
-rw-r--r--ext/soap/tests/soap12/T41.phpt30
-rw-r--r--ext/soap/tests/soap12/T42.phpt41
-rw-r--r--ext/soap/tests/soap12/T43.phpt30
-rw-r--r--ext/soap/tests/soap12/T44.phpt27
-rw-r--r--ext/soap/tests/soap12/T45.phpt35
-rw-r--r--ext/soap/tests/soap12/T46.phpt36
-rw-r--r--ext/soap/tests/soap12/T47.phpt31
-rw-r--r--ext/soap/tests/soap12/T48.phpt29
-rw-r--r--ext/soap/tests/soap12/T49.phpt29
-rw-r--r--ext/soap/tests/soap12/T50.phpt29
-rw-r--r--ext/soap/tests/soap12/T51.phpt27
-rw-r--r--ext/soap/tests/soap12/T52.phpt25
-rw-r--r--ext/soap/tests/soap12/T53.phpt25
-rw-r--r--ext/soap/tests/soap12/T54.phpt25
-rw-r--r--ext/soap/tests/soap12/T55.phpt25
-rw-r--r--ext/soap/tests/soap12/T56.phpt34
-rw-r--r--ext/soap/tests/soap12/T57.phpt32
-rw-r--r--ext/soap/tests/soap12/T58.phpt28
-rw-r--r--ext/soap/tests/soap12/T59.phpt28
-rw-r--r--ext/soap/tests/soap12/T60.phpt29
-rw-r--r--ext/soap/tests/soap12/T61.phpt28
-rw-r--r--ext/soap/tests/soap12/T63.phpt25
-rw-r--r--ext/soap/tests/soap12/T64.phpt24
-rw-r--r--ext/soap/tests/soap12/T65.phpt26
-rw-r--r--ext/soap/tests/soap12/T66.phpt23
-rw-r--r--ext/soap/tests/soap12/T67.phpt23
-rw-r--r--ext/soap/tests/soap12/T68.phpt32
-rw-r--r--ext/soap/tests/soap12/T69.phpt19
-rw-r--r--ext/soap/tests/soap12/T70.phpt23
-rw-r--r--ext/soap/tests/soap12/T71.phpt24
-rw-r--r--ext/soap/tests/soap12/T72.phpt22
-rw-r--r--ext/soap/tests/soap12/T73.phpt26
-rw-r--r--ext/soap/tests/soap12/T74.phpt28
-rw-r--r--ext/soap/tests/soap12/T75.phpt28
-rw-r--r--ext/soap/tests/soap12/T76_1.phpt25
-rw-r--r--ext/soap/tests/soap12/T76_2.phpt32
-rw-r--r--ext/soap/tests/soap12/T77_1.phpt25
-rw-r--r--ext/soap/tests/soap12/T77_2.phpt24
-rw-r--r--ext/soap/tests/soap12/T77_3.phpt27
-rw-r--r--ext/soap/tests/soap12/T78.phpt23
-rw-r--r--ext/soap/tests/soap12/T80.phpt19
-rw-r--r--ext/soap/tests/soap12/skipif.inc3
-rw-r--r--ext/soap/tests/soap12/soap12-test.inc131
-rw-r--r--ext/soap/tests/soap12/soap12-test.wsdl771
-rw-r--r--ext/soap/tests/test.wsdl55
-rw-r--r--ext/soap/tests/transport001.phpt36
-rw-r--r--ext/soap/tests/typemap001.phpt63
-rw-r--r--ext/soap/tests/typemap002.phpt58
-rw-r--r--ext/soap/tests/typemap003.phpt57
-rw-r--r--ext/soap/tests/typemap004.phpt43
-rw-r--r--ext/soap/tests/typemap005.phpt64
-rw-r--r--ext/soap/tests/typemap006.phpt59
-rw-r--r--ext/soap/tests/typemap007.phpt59
-rw-r--r--ext/soap/tests/typemap008.phpt45
-rw-r--r--ext/soap/tests/typemap009.phpt58
-rw-r--r--ext/soap/tests/typemap010.phpt58
-rw-r--r--ext/soap/tests/typemap011.phpt51
-rw-r--r--ext/soap/tests/typemap012.phpt47
-rw-r--r--ext/soap/tests/typemap013.phpt58
666 files changed, 51411 insertions, 0 deletions
diff --git a/ext/soap/CREDITS b/ext/soap/CREDITS
new file mode 100644
index 0000000..83c9b1c
--- /dev/null
+++ b/ext/soap/CREDITS
@@ -0,0 +1,2 @@
+SOAP
+Brad Lafountain, Shane Caraveo, Dmitry Stogov
diff --git a/ext/soap/TODO b/ext/soap/TODO
new file mode 100644
index 0000000..ad0b11c
--- /dev/null
+++ b/ext/soap/TODO
@@ -0,0 +1,98 @@
+General
+-------
+- make sure soapserver.map(), soap_encode_to_xml() and soap_encode_to_zval() are really need
+- reimplement SoapObject::__getfunctions() and SoapObject::__gettypes()
+ to return structures instead of strings
+- error handling???
+
+SOAP
+----
+- SOAP routing
+- root attribute (it is defined by SOAP 1.1, but not SOAP 1.2)
+- make sure soap 1.1 and 1.2 are supported fully
+
+Encoding
+--------
+? full support for standard simple types (
+ ? language, (pattern: "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*")
+ ? NMTOKEN, (pattern: "\c+") (\c: [a-zA-Z0-9.\-_:])
+ ? NMTOKENS, (list: NMTOKEN, minLength: 1)
+ ? Name, (pattern: "\i\c*") (\i: [a-zA-Z_:]
+ ? NCName, (pattern: "[\i-[:]][\c-[:]]*")
+ ? ID, (base: NCName)
+ ? IDREF, (base: NCName)
+ ? IDREFS, (list: IDREF; minLength: 1)
+ ? ENTITY, (base: NCName)
+ ? ENTITIES, (list: ENTITY; minLength: 1)
+ ? duration)
+? full support for standard date/time types (
+ ? dateTime,
+ ? time,
+ ? date,
+ ? gYearMonth,
+ ? gYear,
+ ? gMonthDay,
+ ? gDay,
+ ? gMonth)
+? full support for arrays
+ - SOAP 1.1 encoding of arrays with holes (partially transmitted and sparse arrays)
+ SOAP 1.2 doesn't support partially transmitted and sparse arrays
+- references to external resources
+? support for "nillable" and "nil"
+? default values of <element>
+? provide schema 1999/2001 support???
+? make internal refrences for soap encoding (use seralization logic)???
+? provide user space overriding of serialization certin objects and types???
+
+WSDL
+----
+? server part support for "document" style encoding
+? support for <fault>, <soap:fault>
+? <soap:headerfault>
+- <soap:body> parts attribute (with MIME/DIME binding)
+- MIME binding
+- DIME binding
+- support for portType/operation parameterOrder attribute
+- support for binding operation input/output name attribute (part of overloading)
+- function/method overloading/redeclaration (test(int); test(string))
+- wsdl auto generation
+- HTTP GET/POST binding
+- SOAP security extension
+
+Schema
+------
+- <redefine>
+? support for user defined simple types
+ ? restiction
+ ? enumeration
+ ? length (for string, anyURI, hexBinary, base64Binary and derived) list???
+ ? minLength (for string, hexBinary, base64Binary and derived) list???
+ ? maxLength (for string, hexBinary, base64Binary and derived) list???
+ + whiteSpace (preserve, replace [#x9,#xA,#xD=>#x20], collapse [replace+?])
+ - pattern
+ - minExclusive (for numeric, date types)
+ - minInclusive (for numeric, date types)
+ - maxExclusive (for numeric, date types)
+ - maxInclusive (for numeric, date types)
+ - totalDigits (for decimal)
+ - fractionDigits (for decimal)
+ ? union
+? support for user defined complex types
+ ? full support for content model encoding/decoding
+ - <any>
+ - <anyAttribute>
+
+Transport
+---------
+? HTTP status codes
+? HTTP chunked Transfer-Encoding
+? support for HTTP compression (gzip,x-gzip,defalte)
+- transport abstraction layer???
+
+Interop Testing
+---------------
+- more interop rounds/groups
+
+UDDI
+----
+- ???
diff --git a/ext/soap/TODO.old b/ext/soap/TODO.old
new file mode 100644
index 0000000..59deb4b
--- /dev/null
+++ b/ext/soap/TODO.old
@@ -0,0 +1,38 @@
+TODO:
+make sure soap 1.1 and 1.2 is supported fully
+Better WSDL support Client and server (how much validation is needed here?)
+UDDI??
+make internal refrences for soap encoding (use seralization logic)
+add ini option for always soap_error_handler
+provide user space overriding of serialization certin objects and types
+serialization in general needs to be polished/finished... all xsd types
+look to see if php-soap will work with out always_populate_raw_post_data on
+see if client will work with ssl.. should be eaiser with php_streams
+work on soap seralizer (php serialization)
+-work on a soap-service 'regiestry' and 'proxy' (apache soap style)
+-convert all string mainpulation to use smart_str
+make the 'soap' packet abstract.. maybe incorperate xml-rpc
+make the transport layer abstract.. what other transport layers are needed?... who uses smtp? what about jabber?
+make $soap_object->data = 'text'; maybe invoke a set_*() and/or get_*() method
+when using wsdls and function names are similar find the best match
+ void test(int);
+ void test(string);
+ maybe use the same alogrithim as ext/java.
+investigate further http keep_alive... inital testing proved slower.. maybe php_streams will speed things up..
+provide schema 1999/2001 support....
+through memory leak testing
+possible using shared memory for sdl caching...
+api for clearing/checking sdl caching...
+make php-soap work as a standalone server using php_streams and the new socket extension
+http authication
+proxy support
+wsdl generation static and auto (.net style (http://server.com/soapserver.php?WSDL)) using phpdoc parsing engine
+interpo testing...
+BENCHMARKING...... lets prove how fast it is.
+do some more work on website
+
+does this list stop... what exactly have i done?
+im sure im forgetting 20 thousand more things....
+
+
+ - brad
diff --git a/ext/soap/config.m4 b/ext/soap/config.m4
new file mode 100644
index 0000000..8acad8d
--- /dev/null
+++ b/ext/soap/config.m4
@@ -0,0 +1,25 @@
+dnl $Id$
+dnl config.m4 for extension soap
+
+PHP_ARG_ENABLE(soap, whether to enable SOAP support,
+[ --enable-soap Enable SOAP support])
+
+if test -z "$PHP_LIBXML_DIR"; then
+ PHP_ARG_WITH(libxml-dir, libxml2 install dir,
+ [ --with-libxml-dir=DIR SOAP: libxml2 install prefix], no, no)
+fi
+
+if test "$PHP_SOAP" != "no"; then
+
+ if test "$PHP_LIBXML" = "no"; then
+ AC_MSG_ERROR([SOAP extension requires LIBXML extension, add --enable-libxml])
+ fi
+
+ PHP_SETUP_LIBXML(SOAP_SHARED_LIBADD, [
+ AC_DEFINE(HAVE_SOAP,1,[ ])
+ PHP_NEW_EXTENSION(soap, soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c, $ext_shared)
+ PHP_SUBST(SOAP_SHARED_LIBADD)
+ ], [
+ AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
+ ])
+fi
diff --git a/ext/soap/config.w32 b/ext/soap/config.w32
new file mode 100644
index 0000000..7aa73b5
--- /dev/null
+++ b/ext/soap/config.w32
@@ -0,0 +1,18 @@
+// $Id$
+// vim:ft=javascript
+
+ARG_ENABLE("soap", "SOAP support", "no");
+
+if (PHP_SOAP != "no") {
+ if (PHP_LIBXML == "yes" && ADD_EXTENSION_DEP('soap', 'libxml')) {
+ EXTENSION('soap', 'soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c');
+ AC_DEFINE('HAVE_PHP_SOAP', 1, "SOAP support");
+
+ if (!PHP_SOAP_SHARED) {
+ ADD_FLAG('CFLAGS_SOAP', "/D LIBXML_STATIC ");
+ }
+ } else {
+ WARNING("soap not enabled, libxml not found");
+ PHP_SOAP = "no"
+ }
+}
diff --git a/ext/soap/interop/client_round2.php b/ext/soap/interop/client_round2.php
new file mode 100644
index 0000000..c130747
--- /dev/null
+++ b/ext/soap/interop/client_round2.php
@@ -0,0 +1,113 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <title>Round 2 Interop Client Tests</title>
+</head>
+
+<body>
+<a href="index.php">Back to Interop Index</a><br>
+<p>&nbsp;</p>
+<?php
+require_once 'client_round2_interop.php';
+
+$iop = new Interop_Client();
+
+function endpointList($test,$sel_endpoint)
+{
+ global $iop;
+ $iop->getEndpoints($test);
+ echo "<select name='endpoint'>\n";
+ echo "<option value=''>-- All Endpoints --</option>\n";
+ foreach ($iop->endpoints as $epname => $epinfo) {
+ $selected = '';
+ if ($sel_endpoint == $epname) $selected = ' SELECTED';
+ echo "<option value='$epname'$selected>$epname</option>\n";
+ }
+ echo "</select>\n";
+}
+function methodList($test,$sel_method)
+{
+ global $iop;
+ global $soap_tests;
+
+ echo "<select name='method'>\n";
+ echo "<option value='ALL'>-- Run All Methods --</option>\n";
+ $prev_method = "";
+ foreach ($soap_tests[$test] as $x) {
+ $method = $x->test_name;
+ if ($method != $prev_method) {
+ $prev_method = $method;
+ $selected = '';
+ if ($sel_method == $method) $selected = ' SELECTED';
+ echo "<option value='$method'$selected>$method</option>\n";
+ }
+ }
+ echo "</select>\n";
+}
+
+function endpointTestForm($test, $endpoint, $method, $paramType, $useWSDL)
+{
+ global $PHP_SELF;
+ if (!$test) $test = 'base';
+ echo "Round 2 '$test' Selected<br>\n";
+ echo "Select endpoint and method to run:<br>\n";
+ echo "<form action='$PHP_SELF' method='post'>\n";
+ echo "<input type='hidden' name='test' value='$test'>\n";
+ endpointList($test, $endpoint);
+ methodList($test, $method);
+ echo "<select name='paramType'>";
+// echo "<option value='all'>-- All --</option>";
+ echo "<option value='soapval'".($paramType=='soapval'?' selected':'').">soap value</option>";
+ echo "<option value='php'".($paramType=='php'?' selected':'').">php internal type</option></select>\n";
+ echo "<select name='useWSDL'>";
+// echo "<option value='all'>-- All --</option>";
+ echo "<option value='0'>go Direct</option>";
+ echo "<option value='1'".($useWSDL?' selected':'').">use WSDL</option></select>\n";
+ echo "<input type='submit' value='Go'>\n";
+ echo "</form><br>\n";
+}
+
+function testSelectForm($selected_test = NULL)
+{
+ global $iop, $PHP_SELF;
+ echo "Select a Round 2 test case to run:<br>\n";
+ echo "<form action='$PHP_SELF' method='post'>\n";
+ echo "<select name='test'>\n";
+ foreach ($iop->tests as $test) {
+ $selected = '';
+ if ($selected_test == $test) $selected = ' SELECTED';
+ echo "<option value='$test'$selected>$test</option>\n";
+ }
+ echo "</select>\n";
+ echo "<input type='submit' value='Go'>\n";
+ echo "</form><br>\n";
+}
+
+testSelectForm($_POST['test']);
+endpointTestForm($_POST['test'],$_POST['endpoint'],$_POST['method'],$_POST['paramType'],$_POST['useWSDL']);
+
+if ($_POST['test'] && array_key_exists('endpoint', $_POST) && array_key_exists('method', $_POST)) {
+ // here we execute the orders
+ echo "<h2>Calling {$_POST['method']} at {$_POST['endpoint']}</h2>\n";
+ echo "NOTE: wire's are slightly modified to display better in web browsers.<br>\n";
+
+ $iop->currentTest = $_POST['test']; // see $tests above
+ $iop->paramType = $_POST['paramType']; // 'php' or 'soapval'
+ $iop->useWSDL = $_POST['useWSDL']; // 1= do wsdl tests
+ $iop->numServers = 0; // 0 = all
+ $iop->specificEndpoint = $_POST['endpoint']; // test only this endpoint
+ $iop->testMethod = $_POST['method']=='ALL'?'':$_POST['method']; // test only this method
+ $iop->skipEndpointList = array(); // endpoints to skip
+ $iop->nosave = 0; // 1= disable saving results to database
+ // debug output
+ $iop->show = 0;
+ $iop->debug = 0;
+ $iop->showFaults = 0; // used in result table output
+ echo '<pre>';
+ $iop->doTest(); // run a single set of tests using above options
+ echo '</pre>';
+}
+?>
+</body>
+</html>
diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php
new file mode 100644
index 0000000..5b97873
--- /dev/null
+++ b/ext/soap/interop/client_round2_interop.php
@@ -0,0 +1,785 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane@Caraveo.com> |
+// +----------------------------------------------------------------------+
+//
+// $Id$
+//
+require_once 'DB.php'; // PEAR/DB
+require_once 'client_round2_params.php';
+require_once 'test.utility.php';
+require_once 'config.php';
+
+error_reporting(E_ALL ^ E_NOTICE);
+
+class Interop_Client
+{
+ // database DNS
+ var $DSN = "";
+
+ var $baseURL = "";
+
+ // our central interop server, where we can get the list of endpoints
+ var $interopServer = "http://www.whitemesa.net/wsdl/interopInfo.wsdl";
+
+ // our local endpoint, will always get added to the database for all tests
+ var $localEndpoint;
+
+ // specify testing
+ var $currentTest = 'base'; // see $tests above
+ var $paramType = 'php'; // 'php' or 'soapval'
+ var $useWSDL = 0; // 1= do wsdl tests
+ var $numServers = 0; // 0 = all
+ var $specificEndpoint = ''; // test only this endpoint
+ var $testMethod = ''; // test only this method
+ var $skipEndpointList = array(); // endpoints to skip
+ var $nosave = 0;
+ var $startAt = ''; // start in list at this endpoint
+ // debug output
+ var $show = 1;
+ var $debug = 0;
+ var $showFaults = 0; // used in result table output
+
+ // PRIVATE VARIABLES
+ var $dbc = NULL;
+ var $totals = array();
+ var $tests = array('base','GroupB', 'GroupC');
+ var $paramTypes = array('php', 'soapval');
+ var $endpoints = array();
+ var $html = 1;
+
+ function Interop_Client() {
+ global $interopConfig;
+ $this->DSN = $interopConfig['DSN'];
+ $this->baseURL = $interopConfig['baseURL'];
+ //$this->baseURL = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
+ // set up the database connection
+ $this->dbc = DB::connect($this->DSN, true);
+ // if it errors out, just ignore it and rely on regular methods
+ if (DB::isError($this->dbc)) {
+ echo $this->dbc->getMessage();
+ $this->dbc = NULL;
+ }
+ // set up local endpoint
+ $this->localEndpoint['base'] = (object)array(
+ 'endpointName'=>'PHP ext/soap',
+ 'endpointURL'=>$this->baseURL.'/server_round2_base.php',
+ 'wsdlURL'=>$this->baseURL.'/interop.wsdl.php'
+ );
+ $this->localEndpoint['GroupB'] = (object)array(
+ 'endpointName'=>'PHP ext/soap',
+ 'endpointURL'=>$this->baseURL.'/server_round2_groupB.php',
+ 'wsdlURL'=>$this->baseURL.'/interopB.wsdl.php'
+ );
+ $this->localEndpoint['GroupC'] = (object)array(
+ 'endpointName'=>'PHP ext/soap',
+ 'endpointURL'=>$this->baseURL.'/server_round2_groupC.php',
+ 'wsdlURL'=>$this->baseURL.'/echoheadersvc.wsdl.php');
+ }
+
+ function _fetchEndpoints(&$soapclient, $test) {
+ $this->_getEndpoints($test, 1);
+
+ // retreive endpoints from the endpoint server
+ $endpointArray = $soapclient->__soapCall("GetEndpointInfo",array("groupName"=>$test),array('soapaction'=>"http://soapinterop.org/",'uri'=>"http://soapinterop.org/"));
+ if (is_soap_fault($endpointArray) || PEAR::isError($endpointArray)) {
+ if ($this->html) print "<pre>";
+ print $soapclient->wire."\n";
+ print_r($endpointArray);
+ if ($this->html) print "</pre>";
+ print "\n";
+ return;
+ }
+
+ // add our local endpoint
+ if ($this->localEndpoint[$test]) {
+ array_push($endpointArray, $this->localEndpoint[$test]);
+ }
+
+ if (!$endpointArray) return;
+
+ // reset the status to zero
+ $res = $this->dbc->query("update endpoints set status = 0 where class='$test'");
+ if (DB::isError($res)) {
+ die ($res->getMessage());
+ }
+ if (is_object($res)) $res->free();
+ // save new endpoints into database
+ foreach($endpointArray as $k => $v){
+ if (array_key_exists($v->endpointName,$this->endpoints)) {
+ $res = $this->dbc->query("update endpoints set endpointURL='{$v->endpointURL}', wsdlURL='{$v->wsdlURL}', status=1 where id={$this->endpoints[$v->endpointName]['id']}");
+ } else {
+ $res = $this->dbc->query("insert into endpoints (endpointName,endpointURL,wsdlURL,class) values('{$v->endpointName}','{$v->endpointURL}','{$v->wsdlURL}','$test')");
+ }
+ if (DB::isError($res)) {
+ die ($res->getMessage());
+ }
+ if (is_object($res)) $res->free();
+ }
+ }
+
+ /**
+ * fetchEndpoints
+ * retreive endpoints interop server
+ *
+ * @return boolean result
+ * @access private
+ */
+ function fetchEndpoints($test = NULL) {
+ // fetch from the interop server
+ try {
+ $soapclient = new SoapClient($this->interopServer);
+ if ($test) {
+ $this->_fetchEndpoints($soapclient, $test);
+ } else {
+ foreach ($this->tests as $test) {
+ $this->_fetchEndpoints($soapclient, $test);
+ }
+ $test = 'base';
+ }
+ } catch (SoapFault $fault) {
+ if ($this->html) {
+ echo "<pre>$fault</pre>\n";
+ } else {
+ echo "$fault\n";
+ }
+ return NULL;
+ }
+ // retreive all endpoints now
+ $this->currentTest = $test;
+ $x = $this->_getEndpoints($test);
+ return $x;
+ }
+
+ /**
+ * getEndpoints
+ * retreive endpoints from either database or interop server
+ *
+ * @param string base (see local var $tests)
+ * @param boolean all (if false, only get valid endpoints, status=1)
+ * @return boolean result
+ * @access private
+ */
+ function getEndpoints($base = 'base', $all = 0) {
+ if (!$this->_getEndpoints($base, $all)) {
+ return $this->fetchEndpoints($base);
+ }
+ return TRUE;
+ }
+
+ /**
+ * _getEndpoints
+ * retreive endpoints from database
+ *
+ * @param string base (see local var $tests)
+ * @param boolean all (if false, only get valid endpoints, status=1)
+ * @return boolean result
+ * @access private
+ */
+ function _getEndpoints($base = "", $all = 0) {
+ $this->endpoints = array();
+
+ // build sql
+ $sql = "select * from endpoints ";
+ if ($base) {
+ $sql .= "where class='$base' ";
+ if (!$all) $sql .= "and status=1";
+ } else
+ if (!$all) $sql .= "where status=1";
+ $sql .= " order by endpointName";
+
+
+ $db_ep = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC );
+ if (DB::isError($db_ep)) {
+ echo $sql."\n";
+ echo $db_ep->getMessage();
+ return FALSE;
+ }
+ // rearange the array
+ foreach ($db_ep as $entry) {
+ $this->endpoints[$entry['endpointName']] = $entry;
+ }
+
+ if (count($this->endpoints) > 0) {
+ $this->currentTest = $base;
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+ /**
+ * getResults
+ * retreive results from the database, stuff them into the endpoint array
+ *
+ * @access private
+ */
+ function getResults($test = 'base', $type = 'php', $wsdl = 0) {
+ // be sure we have the right endpoints for this test result
+ $this->getEndpoints($test);
+
+ // retreive the results and put them into the endpoint info
+ $sql = "select * from results where class='$test' and type='$type' and wsdl=$wsdl";
+ $results = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC );
+ foreach ($results as $result) {
+ // find the endpoint
+ foreach ($this->endpoints as $epn => $epi) {
+ if ($epi['id'] == $result['endpoint']) {
+ // store the info
+ $this->endpoints[$epn]['methods'][$result['function']] = $result;
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * saveResults
+ * save the results of a method test into the database
+ *
+ * @access private
+ */
+ function _saveResults($endpoint_id, &$soap_test) {
+ if ($this->nosave) return;
+
+ $result = $soap_test->result;
+ $wire = $result['wire'];
+ if ($result['success']) {
+ $success = 'OK';
+ $error = '';
+ } else {
+ $success = $result['fault']->faultcode;
+ $pos = strpos($success,':');
+ if ($pos !== false) {
+ $success = substr($success,$pos+1);
+ }
+ $error = $result['fault']->faultstring;
+ if (!$wire) $wire= $result['fault']->detail;
+ }
+
+ $test_name = $soap_test->test_name;
+
+ $sql = "delete from results where endpoint=$endpoint_id ".
+ "and class='$this->currentTest' and type='$this->paramType' ".
+ "and wsdl=$this->useWSDL and function=".
+ $this->dbc->quote($test_name);
+ #echo "\n".$sql;
+ $res = $this->dbc->query($sql);
+ if (DB::isError($res)) {
+ die ($res->getMessage());
+ }
+ if (is_object($res)) $res->free();
+
+ $sql = "insert into results (endpoint,stamp,class,type,wsdl,function,result,error,wire) ".
+ "values($endpoint_id,".time().",'$this->currentTest',".
+ "'$this->paramType',$this->useWSDL,".
+ $this->dbc->quote($test_name).",".
+ $this->dbc->quote($success).",".
+ $this->dbc->quote($error).",".
+ ($wire?$this->dbc->quote($wire):"''").")";
+ #echo "\n".$sql;
+ $res = $this->dbc->query($sql);
+
+ if (DB::isError($res)) {
+ die ($res->getMessage());
+ }
+ if (is_object($res)) $res->free();
+ }
+
+ /**
+ * decodeSoapval
+ * decodes a soap value to php type, used for test result comparisions
+ *
+ * @param SOAP_Value soapval
+ * @return mixed result
+ * @access public
+ */
+ function decodeSoapval($soapval)
+ {
+ if (gettype($soapval) == "object" &&
+ (strcasecmp(get_class($soapval),"SoapParam") == 0 ||
+ strcasecmp(get_class($soapval),"SoapVar") == 0)) {
+ if (strcasecmp(get_class($soapval),"SoapParam") == 0)
+ $val = $soapval->param_data->enc_value;
+ else
+ $val = $soapval->enc_value;
+ } else {
+ $val = $soapval;
+ }
+ if (is_array($val)) {
+ foreach($val as $k => $v) {
+ if (gettype($v) == "object" &&
+ (strcasecmp(get_class($soapval),"SoapParam") == 0 ||
+ strcasecmp(get_class($soapval),"SoapVar") == 0)) {
+ $val[$k] = $this->decodeSoapval($v);
+ }
+ }
+ }
+ return $val;
+ }
+
+ /**
+ * compareResult
+ * compare two php types for a match
+ *
+ * @param string expect
+ * @param string test_result
+ * @return boolean result
+ * @access public
+ */
+ function compareResult($expect, $result, $type = NULL)
+ {
+ return compare($expect, $result);
+ }
+
+
+ /**
+ * doEndpointMethod
+ * run a method on an endpoint and store it's results to the database
+ *
+ * @param array endpoint_info
+ * @param SOAP_Test test
+ * @return boolean result
+ * @access public
+ */
+ function doEndpointMethod(&$endpoint_info, &$soap_test) {
+ $ok = FALSE;
+
+ // prepare a holder for the test results
+ $soap_test->result['class'] = $this->currentTest;
+ $soap_test->result['type'] = $this->paramType;
+ $soap_test->result['wsdl'] = $this->useWSDL;
+
+ if ($this->useWSDL) {
+ if (array_key_exists('wsdlURL',$endpoint_info)) {
+ if (!array_key_exists('client',$endpoint_info)) {
+ try {
+ $endpoint_info['client'] = new SoapClient($endpoint_info['wsdlURL'], array("trace"=>1));
+ } catch (SoapFault $ex) {
+ $endpoint_info['client']->wsdl->fault = $ex;
+ }
+ }
+ $soap =& $endpoint_info['client'];
+
+ # XXX how do we determine a failure on retreiving/parsing wsdl?
+ if ($soap->wsdl->fault) {
+ $fault = $soap->wsdl->fault;
+ $soap_test->setResult(0,'WSDL',
+ $fault->faultstring."\n\n".$fault->detail,
+ $fault->faultstring,
+ $fault
+ );
+ return FALSE;
+ }
+ } else {
+ $fault = new SoapFault('WSDL',"no WSDL defined for $endpoint");
+ $soap_test->setResult(0,'WSDL',
+ $fault->faultstring,
+ $fault->faultstring,
+ $fault
+ );
+ return FALSE;
+ }
+ $namespace = false;
+ $soapaction = false;
+ } else {
+ $namespace = $soapaction = 'http://soapinterop.org/';
+ // hack to make tests work with MS SoapToolkit
+ // it's the only one that uses this soapaction, and breaks if
+ // it isn't right. Can't wait for soapaction to be fully depricated
+ if ($this->currentTest == 'base' &&
+ strstr($endpoint_info['endpointName'],'MS SOAP ToolKit 2.0')) {
+ $soapaction = 'urn:soapinterop';
+ }
+ if (!array_key_exists('client',$endpoint_info)) {
+ $endpoint_info['client'] = new SoapClient(null,array('location'=>$endpoint_info['endpointURL'],'uri'=>$soapaction,'trace'=>1));
+ }
+ $soap = $endpoint_info['client'];
+ }
+// // add headers to the test
+// if ($soap_test->headers) {
+// // $header is already a SOAP_Header class
+// foreach ($soap_test->headers as $header) {
+// $soap->addHeader($header);
+// }
+// }
+ // XXX no way to set encoding
+ // this lets us set UTF-8, US-ASCII or other
+ //$soap->setEncoding($soap_test->encoding);
+try {
+ if ($this->useWSDL && !$soap_test->headers && !$soap_test->headers_expect) {
+ $args = '';
+ foreach ($soap_test->method_params as $pname => $param) {
+ $arg = '$soap_test->method_params["'.$pname.'"]';
+ $args .= $args?','.$arg:$arg;
+ }
+ $return = eval('return $soap->'.$soap_test->method_name.'('.$args.');');
+ } else {
+ if ($soap_test->headers || $soap_test->headers_expect) {
+ $return = $soap->__soapCall($soap_test->method_name,$soap_test->method_params,array('soapaction'=>$soapaction,'uri'=>$namespace), $soap_test->headers, $result_headers);
+ } else {
+ $return = $soap->__soapCall($soap_test->method_name,$soap_test->method_params,array('soapaction'=>$soapaction,'uri'=>$namespace));
+ }
+ }
+} catch (SoapFault $ex) {
+ $return = $ex;
+}
+
+ if(!is_soap_fault($return)){
+ if ($soap_test->expect !== NULL) {
+ $sent = $soap_test->expect;
+ } else if (is_array($soap_test->method_params) && count($soap_test->method_params) == 1) {
+ reset($soap_test->method_params);
+ $sent = current($soap_test->method_params);
+ } else if (is_array($soap_test->method_params) && count($soap_test->method_params) == 0) {
+ $sent = null;
+ } else {
+ $sent = $soap_test->method_params;
+ }
+
+ // compare header results
+ $headers_ok = TRUE;
+ if ($soap_test->headers || $soap_test->headers_expect) {
+ $headers_ok = $this->compareResult($soap_test->headers_expect, $result_headers);
+ }
+
+ # we need to decode what we sent so we can compare!
+ $sent_d = $this->decodeSoapval($sent);
+
+ $soap_test->result['sent'] = $sent;
+ $soap_test->result['return'] = $return;
+
+ // compare the results with what we sent
+
+ if ($soap_test->cmp_func !== NULL) {
+ $cmp_func = $soap_test->cmp_func;
+ $ok = $cmp_func($sent_d,$return);
+ } else {
+ $ok = $this->compareResult($sent_d,$return, $sent->type);
+ if (!$ok && $soap_test->expect) {
+ $ok = $this->compareResult($soap_test->expect,$return);
+ }
+ }
+
+ // save the wire
+ $wire = "REQUEST:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastrequest()))."\n\n".
+ "RESPONSE:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastresponse()))."\n\n".
+ "EXPECTED:\n".var_dump_str($sent_d)."\n".
+ "RESULTL:\n".var_dump_str($return);
+ if ($soap_test->headers_expect) {
+ $wire .= "\nEXPECTED HEADERS:\n".var_dump_str($soap_test->headers_expect)."\n".
+ "RESULT HEADERS:\n".var_dump_str($result_headers);
+ }
+ #print "Wire:".htmlentities($wire);
+
+ if($ok){
+ if (!$headers_ok) {
+ $fault = new SoapFault('HEADER','The returned result did not match what we expected to receive');
+ $soap_test->setResult(0,$fault->faultcode,
+ $wire,
+ $fault->faultstring,
+ $fault
+ );
+ } else {
+ $soap_test->setResult(1,'OK',$wire);
+ $success = TRUE;
+ }
+ } else {
+ $fault = new SoapFault('RESULT','The returned result did not match what we expected to receive');
+ $soap_test->setResult(0,$fault->faultcode,
+ $wire,
+ $fault->faultstring,
+ $fault
+ );
+ }
+ } else {
+ $fault = $return;
+ if ($soap_test->expect_fault) {
+ $ok = 1;
+ $res = 'OK';
+ } else {
+ $ok = 0;
+ $res =$fault->faultcode;
+ $pos = strpos($res,':');
+ if ($pos !== false) {
+ $res = substr($res,$pos+1);
+ }
+ }
+ // save the wire
+ $wire = "REQUEST:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastrequest()))."\n\n".
+ "RESPONSE:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastresponse()))."\n".
+ "RESULTL:\n".var_dump_str($return);
+ #print "Wire:".htmlentities($wire);
+
+ $soap_test->setResult($ok,$res, $wire,$fault->faultstring, $fault);
+
+ }
+ return $ok;
+ }
+
+
+ /**
+ * doTest
+ * run a single round of tests
+ *
+ * @access public
+ */
+ function doTest() {
+ global $soap_tests;
+ // get endpoints for this test
+ $this->getEndpoints($this->currentTest);
+ #clear totals
+ $this->totals = array();
+
+ $i = 0;
+ foreach($this->endpoints as $endpoint => $endpoint_info){
+
+ // if we specify an endpoint, skip until we find it
+ if ($this->specificEndpoint && $endpoint != $this->specificEndpoint) continue;
+ if ($this->useWSDL && !$endpoint_info['endpointURL']) continue;
+
+ $skipendpoint = FALSE;
+ $this->totals['servers']++;
+ #$endpoint_info['tests'] = array();
+
+ if ($this->show) {
+ print "Processing $endpoint at {$endpoint_info['endpointURL']}";
+ if ($this->html) print "<br>\n"; else print "\n";
+ }
+
+ foreach($soap_tests[$this->currentTest] as $soap_test) {
+ //foreach(array_keys($method_params[$this->currentTest][$this->paramType]) as $method)
+
+ // only run the type of test we're looking for (php or soapval)
+ if ($soap_test->type != $this->paramType) continue;
+
+ // if we haven't reached our startpoint, skip
+ if ($this->startAt && $this->startAt != $endpoint_info['endpointName']) continue;
+ $this->startAt = '';
+
+ // if this is in our skip list, skip it
+ if (in_array($endpoint, $this->skipEndpointList)) {
+ $skipendpoint = TRUE;
+ $skipfault = new SoapFault('SKIP','endpoint skipped');
+ $soap_test->setResult(0,$fault->faultcode, '',
+ $skipfault->faultstring,
+ $skipfault
+ );
+ #$endpoint_info['tests'][] = &$soap_test;
+ #$soap_test->showTestResult($this->debug, $this->html);
+ #$this->_saveResults($endpoint_info['id'], $soap_test->method_name);
+ $soap_test->result = NULL;
+ continue;
+ }
+
+ // if we're looking for a specific method, skip unless we have it
+ if ($this->testMethod && strcmp($this->testMethod,$soap_test->test_name) != 0) continue;
+
+ // if we are skipping the rest of the tests (due to error) note a fault
+ if ($skipendpoint) {
+ $soap_test->setResult(0,$fault->faultcode, '',
+ $skipfault->faultstring,
+ $skipfault
+ );
+ #$endpoint_info['tests'][] = &$soap_test;
+ $this->totals['fail']++;
+ } else {
+ // run the endpoint test
+ if ($this->doEndpointMethod($endpoint_info, $soap_test)) {
+ $this->totals['success']++;
+ } else {
+ $skipendpoint = $soap_test->result['fault']->faultcode=='HTTP'
+ && strstr($soap_test->result['fault']->faultstring,'Connect Error');
+ $skipfault = $soap_test->result['fault'];
+ $this->totals['fail']++;
+ }
+ #$endpoint_info['tests'][] = &$soap_test;
+ }
+ $soap_test->showTestResult($this->debug, $this->html);
+ $this->_saveResults($endpoint_info['id'], $soap_test);
+ $soap_test->result = NULL;
+ $this->totals['calls']++;
+ }
+ if ($this->numservers && ++$i >= $this->numservers) break;
+ }
+ }
+
+ function doGroupTests() {
+ $dowsdl = array(0,1);
+ foreach($dowsdl as $usewsdl) {
+ $this->useWSDL = $usewsdl;
+ foreach($this->paramTypes as $ptype) {
+ // skip a pointless test
+ if ($usewsdl && $ptype == 'soapval') break;
+ $this->paramType = $ptype;
+ $this->doTest();
+ }
+ }
+ }
+
+ /**
+ * doTests
+ * go all out. This takes time.
+ *
+ * @access public
+ */
+ function doTests() {
+ // the mother of all interop tests
+ $dowsdl = array(0,1);
+ foreach($this->tests as $test) {
+ $this->currentTest = $test;
+ foreach($dowsdl as $usewsdl) {
+ $this->useWSDL = $usewsdl;
+ foreach($this->paramTypes as $ptype) {
+ // skip a pointless test
+ if ($usewsdl && $ptype == 'soapval') break;
+ $this->paramType = $ptype;
+ $this->doTest();
+ }
+ }
+ }
+ }
+
+ // ***********************************************************
+ // output functions
+
+ /**
+ * getResults
+ * retreive results from the database, stuff them into the endpoint array
+ *
+ * @access private
+ */
+ function getMethodList($test = 'base') {
+ // retreive the results and put them into the endpoint info
+ $sql = "select distinct(function) from results where class='$test' order by function";
+ $results = $this->dbc->getAll($sql);
+ $ar = array();
+ foreach($results as $result) {
+ $ar[] = $result[0];
+ }
+ return $ar;
+ }
+
+ function outputTable()
+ {
+ $methods = $this->getMethodList($this->currentTest);
+ if (!$methods) return;
+ $this->getResults($this->currentTest,$this->paramType,$this->useWSDL);
+
+ echo "<b>Testing $this->currentTest ";
+ if ($this->useWSDL) echo "using WSDL ";
+ else echo "using Direct calls ";
+ echo "with $this->paramType values</b><br>\n";
+
+ // calculate totals for this table
+ $this->totals['success'] = 0;
+ $this->totals['fail'] = 0;
+ $this->totals['servers'] = 0; #count($this->endpoints);
+ foreach ($this->endpoints as $endpoint => $endpoint_info) {
+ if (count($endpoint_info['methods']) > 0) {
+ $this->totals['servers']++;
+ foreach ($methods as $method) {
+ $r = $endpoint_info['methods'][$method]['result'];
+ if ($r == 'OK') $this->totals['success']++;
+ else $this->totals['fail']++;
+ }
+ } else {
+ unset($this->endpoints[$endpoint]);
+ }
+ }
+ $this->totals['calls'] = count($methods) * $this->totals['servers'];
+
+ echo "\n\n<b>Servers: {$this->totals['servers']} Calls: {$this->totals['calls']} Success: {$this->totals['success']} Fail: {$this->totals['fail']}</b><br>\n";
+
+ echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n";
+ echo "<tr><td class=\"BLANK\">Endpoint</td>\n";
+ foreach ($methods as $method) {
+ $info = split(':', $method);
+ echo "<td class='BLANK' valign='top'>";
+ foreach ($info as $m) {
+ $hi = split(',',$m);
+ echo '<b>'.$hi[0]."</b><br>\n";
+ if (count($hi) > 1) {
+ echo "&nbsp;&nbsp;Actor=".($hi[1]?'Target':'Not Target')."<br>\n";
+ echo "&nbsp;&nbsp;MustUnderstand=$hi[2]<br>\n";
+ }
+ }
+ echo "</td>\n";
+ }
+ echo "</tr>\n";
+ $faults = array();
+ $fi = 0;
+ foreach ($this->endpoints as $endpoint => $endpoint_info) {
+ if (array_key_exists('wsdlURL',$endpoint_info)) {
+ echo "<tr><td class=\"BLANK\"><a href=\"{$endpoint_info['wsdlURL']}\">$endpoint</a></td>\n";
+ } else {
+ echo "<tr><td class=\"BLANK\">$endpoint</td>\n";
+ }
+ foreach ($methods as $method) {
+ $id = $endpoint_info['methods'][$method]['id'];
+ $r = $endpoint_info['methods'][$method]['result'];
+ $e = $endpoint_info['methods'][$method]['error'];
+ if ($e) {
+ $faults[$fi++] = $e;
+ }
+ if ($r) {
+ echo "<td class='$r'><a href='$PHP_SELF?wire=$id'>$r</a></td>\n";
+ } else {
+ echo "<td class='untested'>untested</td>\n";
+ }
+ }
+ echo "</tr>\n";
+ }
+ echo "</table><br>\n";
+ if ($this->showFaults && count($faults) > 0) {
+ echo "<b>ERROR Details:</b><br>\n<ul>\n";
+ # output more error detail
+ foreach ($faults as $fault) {
+ echo '<li>'.HTMLSpecialChars($fault)."</li>\n";
+ }
+ }
+ echo "</ul><br><br>\n";
+ }
+
+ function outputTables() {
+ // the mother of all interop tests
+ $dowsdl = array(0,1);
+ foreach($this->tests as $test) {
+ $this->currentTest = $test;
+ foreach($dowsdl as $usewsdl) {
+ $this->useWSDL = $usewsdl;
+ foreach($this->paramTypes as $ptype) {
+ // skip a pointless test
+ if ($usewsdl && $ptype == 'soapval') break;
+ $this->paramType = $ptype;
+ $this->outputTable();
+ }
+ }
+ }
+ }
+
+ function showWire($id) {
+ $results = $this->dbc->getAll("select * from results where id=$id",NULL, DB_FETCHMODE_ASSOC );
+ #$wire = preg_replace("/>/",">\n",$results[0]['wire']);
+ $wire = $results[0]['wire'];
+ if ($this->html) print "<pre>";
+ echo "\n".HTMLSpecialChars($wire);
+ if ($this->html) print "</pre>";
+ print "\n";
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/ext/soap/interop/client_round2_params.php b/ext/soap/interop/client_round2_params.php
new file mode 100644
index 0000000..f0987a1
--- /dev/null
+++ b/ext/soap/interop/client_round2_params.php
@@ -0,0 +1,622 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane@Caraveo.com> |
+// +----------------------------------------------------------------------+
+//
+// $Id$
+//
+
+define('SOAP_TEST_ACTOR_OTHER','http://some/other/actor');
+
+class SOAP_Test {
+ var $type = 'php';
+ var $test_name = NULL;
+ var $method_name = NULL;
+ var $method_params = NULL;
+ var $cmp_func = NULL;
+ var $expect = NULL;
+ var $expect_fault = FALSE;
+ var $headers = NULL;
+ var $headers_expect = NULL;
+ var $result = array();
+ var $show = 1;
+ var $debug = 0;
+ var $encoding = 'UTF-8';
+
+ function SOAP_Test($methodname, $params, $expect = NULL, $cmp_func = NULL) {
+ # XXX we have to do this to make php-soap happy with NULL params
+ if (!$params) $params = array();
+
+ if (strchr($methodname,'(')) {
+ preg_match('/(.*)\((.*)\)/',$methodname,$matches);
+ $this->test_name = $methodname;
+ $this->method_name = $matches[1];
+ } else {
+ $this->test_name = $this->method_name = $methodname;
+ }
+ $this->method_params = $params;
+ if ($expect !== NULL) {
+ $this->expect = $expect;
+ }
+ if ($cmp_func !== NULL) {
+ $this->cmp_func = $cmp_func;
+ }
+
+ // determine test type
+ if ($params) {
+ $v = array_values($params);
+ if (gettype($v[0]) == 'object' &&
+ (get_class($v[0]) == 'SoapVar' || get_class($v[0]) == 'SoapParam'))
+ $this->type = 'soapval';
+ }
+ }
+
+ function setResult($ok, $result, $wire, $error = '', $fault = NULL)
+ {
+ $this->result['success'] = $ok;
+ $this->result['result'] = $result;
+ $this->result['error'] = $error;
+ $this->result['wire'] = $wire;
+ $this->result['fault'] = $fault;
+ }
+
+ /**
+ * showMethodResult
+ * print simple output about a methods result
+ *
+ * @param array endpoint_info
+ * @param string method
+ * @access public
+ */
+ function showTestResult($debug = 0, $html = 0) {
+ // debug output
+ if ($debug) $this->show = 1;
+ if ($debug) {
+ echo str_repeat("-",50).$html?"<br>\n":"\n";
+ }
+
+ echo "testing $this->test_name : ";
+
+ if ($debug) {
+ print "method params: ";
+ print_r($this->params);
+ print "\n";
+ }
+
+ $ok = $this->result['success'];
+ if ($ok) {
+ if ($html) {
+ print "<font color=\"#00cc00\">SUCCESS</font>\n";
+ } else {
+ print "SUCCESS\n";
+ }
+ } else {
+ $fault = $this->result['fault'];
+ if ($fault) {
+ $res = $fault->faultcode;
+ $pos = strpos($res,':');
+ if ($pos !== false) {
+ $res = substr($res,$pos+1);
+ }
+ if ($html) {
+ print "<font color=\"#ff0000\">FAILED: [$res] {$fault->faultstring}</font>\n";
+ } else {
+ print "FAILED: [$res] {$fault->faultstring}\n";
+ }
+ } else {
+ if ($html) {
+ print "<font color=\"#ff0000\">FAILED: ".$this->result['result']."</font>\n";
+ } else {
+ print "FAILED: ".$this->result['result']."\n";
+ }
+ }
+ }
+ if ($debug) {
+ if ($html) {
+ echo "<pre>\n".htmlentities($this->result['wire'])."</pre>\n";
+ } else {
+ echo "\n".htmlentities($this->result['wire'])."\n";
+ }
+ }
+ }
+}
+
+# XXX I know this isn't quite right, need to deal with this better
+function make_2d($x, $y)
+{
+ for ($_x = 0; $_x < $x; $_x++) {
+ for ($_y = 0; $_y < $y; $_y++) {
+ $a[$_x][$_y] = "x{$_x}y{$_y}";
+ }
+ }
+ return $a;
+}
+
+function soap_value($name, $value, $type, $type_name=NULL, $type_ns=NULL) {
+ return new SoapParam(new SoapVar($value,$type,$type_name,$type_ns),$name);
+}
+
+class SOAPStruct {
+ var $varString;
+ var $varInt;
+ var $varFloat;
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+
+//***********************************************************
+// Base echoString
+
+$soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => 'hello world!'));
+$soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => soap_value('inputString','hello world',XSD_STRING)));
+$soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => ''));
+$soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => soap_value('inputString','',XSD_STRING)));
+$soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => NULL));
+$soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => soap_value('inputString',NULL,XSD_STRING)));
+//$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"));
+//$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)));
+$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => ">,<,&,\",',\\,\n"));
+$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => soap_value('inputString',">,<,&,\",',\\,\n",XSD_STRING)));
+$test = new SOAP_Test('echoString(utf-8)', array('inputString' => utf8_encode('ỗÈéóÒ₧⅜ỗỸ')));
+$test->encoding = 'UTF-8';
+$soap_tests['base'][] = $test;
+$test = new SOAP_Test('echoString(utf-8)', array('inputString' => soap_value('inputString',utf8_encode('ỗÈéóÒ₧⅜ỗỸ'),XSD_STRING)));
+$test->encoding = 'UTF-8';
+$soap_tests['base'][] = $test;
+
+//***********************************************************
+// Base echoStringArray
+
+$soap_tests['base'][] = new SOAP_Test('echoStringArray',
+ array('inputStringArray' => array('good','bad')));
+$soap_tests['base'][] = new SOAP_Test('echoStringArray',
+ array('inputStringArray' =>
+ soap_value('inputStringArray',array('good','bad'),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
+
+$soap_tests['base'][] = new SOAP_Test('echoStringArray(one)',
+ array('inputStringArray' => array('good')));
+$soap_tests['base'][] = new SOAP_Test('echoStringArray(one)',
+ array('inputStringArray' =>
+ soap_value('inputStringArray',array('good'),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
+
+// empty array test
+$soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => array()));
+$soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => soap_value('inputStringArray',array(),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
+
+# XXX NULL Arrays not supported
+// null array test
+$soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => NULL));
+$soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => soap_value('inputStringArray',NULL,SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
+
+//***********************************************************
+// Base echoInteger
+$x = new SOAP_Test('echoInteger', array('inputInteger' => 34345));
+$soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => 34345));
+$soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => soap_value('inputInteger',12345,XSD_INT)));
+
+//***********************************************************
+// Base echoIntegerArray
+
+$soap_tests['base'][] = new SOAP_Test('echoIntegerArray', array('inputIntegerArray' => array(1,234324324,2)));
+$soap_tests['base'][] = new SOAP_Test('echoIntegerArray',
+ array('inputIntegerArray' =>
+ soap_value('inputIntegerArray',
+ array(new SoapVar(12345,XSD_INT),new SoapVar(654321,XSD_INT)),
+ SOAP_ENC_ARRAY,"ArrayOfint","http://soapinterop.org/xsd")));
+
+//***********************************************************
+// Base echoFloat
+
+$soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => 342.23));
+$soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => soap_value('inputFloat',123.45,XSD_FLOAT)));
+
+//***********************************************************
+// Base echoFloatArray
+
+$soap_tests['base'][] = new SOAP_Test('echoFloatArray', array('inputFloatArray' => array(1.3223,34.2,325.325)));
+$soap_tests['base'][] = new SOAP_Test('echoFloatArray',
+ array('inputFloatArray' =>
+ soap_value('inputFloatArray',
+ array(new SoapVar(123.45,XSD_FLOAT),new SoapVar(654.321,XSD_FLOAT)),
+ SOAP_ENC_ARRAY,"ArrayOffloat","http://soapinterop.org/xsd")));
+//***********************************************************
+// Base echoStruct
+
+$soapstruct = new SOAPStruct('arg',34,325.325);
+# XXX no way to set a namespace!!!
+$soapsoapstruct = soap_value('inputStruct',$soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd");
+$soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' =>$soapstruct));
+$soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' =>$soapsoapstruct));
+
+//***********************************************************
+// Base echoStructArray
+
+$soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' => array(
+ $soapstruct,$soapstruct,$soapstruct)));
+$soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' =>
+ soap_value('inputStructArray',array(
+ new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
+ new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
+ new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd")),
+ SOAP_ENC_ARRAY,"ArrayOfSOAPStruct","http://soapinterop.org/xsd")));
+
+
+//***********************************************************
+// Base echoVoid
+
+$soap_tests['base'][] = new SOAP_Test('echoVoid', NULL);
+$test = new SOAP_Test('echoVoid', NULL);
+$test->type = 'soapval';
+$soap_tests['base'][] = $test;
+
+//***********************************************************
+// Base echoBase64
+
+$soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' => 'TmVicmFza2E='));
+$soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' =>
+ soap_value('inputBase64','TmVicmFza2E=',XSD_BASE64BINARY)));
+
+//***********************************************************
+// Base echoHexBinary
+
+$soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => '736F61707834'),'736F61707834','hex_compare');
+$soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' =>
+ soap_value('inputHexBinary','736F61707834',XSD_HEXBINARY)),'736F61707834','hex_compare');
+
+//***********************************************************
+// Base echoDecimal
+
+# XXX test fails because php-soap incorrectly sets decimal to long rather than float
+$soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => '12345.67890'));
+$soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' =>
+ soap_value('inputDecimal','12345.67890',XSD_DECIMAL)));
+
+//***********************************************************
+// Base echoDate
+
+# php-soap doesn't handle datetime types properly yet
+$soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => '2001-05-24T17:31:41Z'), null, 'date_compare');
+$soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' =>
+ soap_value('inputDate','2001-05-24T17:31:41Z',XSD_DATETIME)), null, 'date_compare');
+
+//***********************************************************
+// Base echoBoolean
+
+# php-soap sends boolean as zero or one, which is ok, but to be explicit, send true or false.
+$soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' => TRUE));
+$soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' =>
+ soap_value('inputBoolean',TRUE,XSD_BOOLEAN)));
+$soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' => FALSE));
+$soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' =>
+ soap_value('inputBoolean',FALSE,XSD_BOOLEAN)));
+$soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' => 1),true);
+$soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' =>
+ soap_value('inputBoolean',1,XSD_BOOLEAN)),true);
+$soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' => 0),false);
+$soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' =>
+ soap_value('inputBoolean',0,XSD_BOOLEAN)),false);
+
+
+
+//***********************************************************
+// GROUP B
+
+
+//***********************************************************
+// GroupB echoStructAsSimpleTypes
+
+$expect = array(
+ 'outputString'=>'arg',
+ 'outputInteger'=>34,
+ 'outputFloat'=>325.325
+ );
+$soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes',
+ array('inputStruct' => (object)array(
+ 'varString'=>'arg',
+ 'varInt'=>34,
+ 'varFloat'=>325.325
+ )), $expect);
+$soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes',
+ array('inputStruct' =>
+ soap_value('inputStruct',
+ (object)array('varString' => 'arg',
+ 'varInt' => 34,
+ 'varFloat' => 325.325
+ ), SOAP_ENC_OBJECT, "SOAPStruct","http://soapinterop.org/xsd")), $expect);
+
+//***********************************************************
+// GroupB echoSimpleTypesAsStruct
+
+$expect =
+ (object)array(
+ 'varString'=>'arg',
+ 'varInt'=>34,
+ 'varFloat'=>325.325
+ );
+$soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct',
+ array(
+ 'inputString'=>'arg',
+ 'inputInteger'=>34,
+ 'inputFloat'=>325.325
+ ), $expect);
+$soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct',
+ array(
+ soap_value('inputString','arg', XSD_STRING),
+ soap_value('inputInteger',34, XSD_INT),
+ soap_value('inputFloat',325.325, XSD_FLOAT)
+ ), $expect);
+
+//***********************************************************
+// GroupB echo2DStringArray
+
+$soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray',
+ array('input2DStringArray' => make_2d(3,3)));
+
+$multidimarray =
+ soap_value('input2DStringArray',
+ array(
+ array('row0col0', 'row0col1', 'row0col2'),
+ array('row1col0', 'row1col1', 'row1col2')
+ ), SOAP_ENC_ARRAY
+ );
+//$multidimarray->options['flatten'] = TRUE;
+$soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray',
+ array('input2DStringArray' => $multidimarray));
+
+//***********************************************************
+// GroupB echoNestedStruct
+
+$strstr = (object)array(
+ 'varString'=>'arg',
+ 'varInt'=>34,
+ 'varFloat'=>325.325,
+ 'varStruct' => (object)array(
+ 'varString'=>'arg',
+ 'varInt'=>34,
+ 'varFloat'=>325.325
+ ));
+$soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct',
+ array('inputStruct' => $strstr));
+$soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct',
+ array('inputStruct' =>
+ soap_value('inputStruct',
+ (object)array(
+ 'varString'=>'arg',
+ 'varInt'=>34,
+ 'varFloat'=>325.325,
+ 'varStruct' => new SoapVar((object)array(
+ 'varString'=>'arg',
+ 'varInt'=>34,
+ 'varFloat'=>325.325
+ ), SOAP_ENC_OBJECT, "SOAPStruct","http://soapinterop.org/xsd")
+ ), SOAP_ENC_OBJECT, "SOAPStructStruct","http://soapinterop.org/xsd"
+ )),$strstr);
+
+//***********************************************************
+// GroupB echoNestedArray
+
+$arrstr = (object)array(
+ 'varString'=>'arg',
+ 'varInt'=>34,
+ 'varFloat'=>325.325,
+ 'varArray' => array('red','blue','green')
+ );
+$soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray',
+ array('inputStruct' => $arrstr));
+$soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray',
+ array('inputStruct' =>
+ soap_value('inputStruct',
+ (object)array('varString' => 'arg',
+ 'varInt' => 34,
+ 'varFloat' => 325.325,
+ 'varArray' =>
+ new SoapVar(array("red", "blue", "green"), SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd")
+ ), SOAP_ENC_OBJECT, "SOAPArrayStruct","http://soapinterop.org/xsd"
+ )),$arrstr);
+
+
+//***********************************************************
+// GROUP C header tests
+
+//***********************************************************
+// echoMeStringRequest
+
+// echoMeStringRequest with endpoint as header destination, doesn't have to understand
+$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=next)', NULL);
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 0, SOAP_ACTOR_NEXT);
+$test->headers_expect = array('echoMeStringResponse'=>'hello world');
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=next)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 0, SOAP_ACTOR_NEXT);
+$test->headers_expect = array('echoMeStringResponse'=>'hello world');
+$soap_tests['GroupC'][] = $test;
+
+// echoMeStringRequest with endpoint as header destination, must understand
+$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=next)', NULL);
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT);
+$test->headers_expect = array('echoMeStringResponse'=>'hello world');
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=next)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 1, SOAP_ACTOR_NEXT);
+$test->headers_expect = array('echoMeStringResponse'=>'hello world');
+$soap_tests['GroupC'][] = $test;
+
+// echoMeStringRequest with endpoint NOT header destination, doesn't have to understand
+$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=other)', NULL);
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 0, SOAP_TEST_ACTOR_OTHER);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=other)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 0, SOAP_TEST_ACTOR_OTHER);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+// echoMeStringRequest with endpoint NOT header destination, must understand
+$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=other)', NULL);
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_TEST_ACTOR_OTHER);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=other)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world', XSD_STRING), 1, SOAP_TEST_ACTOR_OTHER);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+// echoMeStringRequest with endpoint header destination, must understand,
+// invalid namespace, should recieve a fault
+$test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL);
+$test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT);
+$test->headers_expect = array();
+$test->expect_fault = TRUE;
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', new SoapVar('hello world', XSD_STRING), 1, SOAP_ACTOR_NEXT);
+$test->headers_expect = array();
+$test->expect_fault = TRUE;
+$soap_tests['GroupC'][] = $test;
+
+//***********************************************************
+// echoMeStructRequest
+
+// echoMeStructRequest with endpoint as header destination, doesn't have to understand
+$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=next)', NULL);
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
+ new SOAPStruct('arg',34,325.325), 0, SOAP_ACTOR_NEXT);
+$test->headers_expect =
+ array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=next)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
+ new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
+ 0, SOAP_ACTOR_NEXT);
+$test->headers_expect =
+ array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
+$soap_tests['GroupC'][] = $test;
+
+// echoMeStructRequest with endpoint as header destination, must understand
+$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=next)', NULL);
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
+ new SOAPStruct('arg',34,325.325), 1, SOAP_ACTOR_NEXT);
+$test->headers_expect =
+ array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=next)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
+ new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
+ 1, SOAP_ACTOR_NEXT);
+$test->headers_expect =
+ array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
+$soap_tests['GroupC'][] = $test;
+
+// echoMeStructRequest with endpoint NOT header destination, doesn't have to understand
+$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=other)', NULL);
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
+ new SOAPStruct('arg',34,325.325), 0, SOAP_TEST_ACTOR_OTHER);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=other)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
+ new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
+ 0, SOAP_TEST_ACTOR_OTHER);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+// echoMeStructRequest with endpoint NOT header destination, must understand
+$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=other)', NULL);
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
+ new SOAPStruct('arg',34,325.325), 1, SOAP_TEST_ACTOR_OTHER);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=other)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
+ new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
+ 1, SOAP_TEST_ACTOR_OTHER);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+//***********************************************************
+// echoMeUnknown
+
+// echoMeUnknown with endpoint as header destination, doesn't have to understand
+$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=next)', NULL);
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',0,SOAP_ACTOR_NEXT);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=next)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),0,SOAP_ACTOR_NEXT);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+// echoMeUnknown with endpoint as header destination, must understand
+$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=next)', NULL);
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',1,SOAP_ACTOR_NEXT);
+$test->headers_expect = array();
+$test->expect_fault = TRUE;
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=next)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),1,SOAP_ACTOR_NEXT);
+$test->headers_expect = array();
+$test->expect_fault = TRUE;
+$soap_tests['GroupC'][] = $test;
+
+// echoMeUnknown with endpoint NOT header destination, doesn't have to understand
+$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=other)', NULL);
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',0,SOAP_TEST_ACTOR_OTHER);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=other)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),0,SOAP_TEST_ACTOR_OTHER);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+// echoMeUnknown with endpoint NOT header destination, must understand
+$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=other)', NULL);
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',1,SOAP_TEST_ACTOR_OTHER);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+
+$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=other)', NULL);
+$test->type = 'soapval';
+$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),1,SOAP_TEST_ACTOR_OTHER);
+$test->headers_expect = array();
+$soap_tests['GroupC'][] = $test;
+?>
diff --git a/ext/soap/interop/client_round2_results.php b/ext/soap/interop/client_round2_results.php
new file mode 100644
index 0000000..5be7199
--- /dev/null
+++ b/ext/soap/interop/client_round2_results.php
@@ -0,0 +1,75 @@
+<?php
+// NOTE: do not run this directly under a web server, as it will take a very long
+// time to execute. Run from a command line or something, and redirect output
+// to an html file.
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane@Caraveo.com> |
+// +----------------------------------------------------------------------+
+//
+// $Id$
+//
+require_once 'client_round2_interop.php';
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+<style>
+TD { background-color: Red; }
+TD.BLANK { background-color: White; }
+TD.OK { background-color: Lime; }
+TD.RESULT { background-color: Green; }
+TD.untested { background-color: White; }
+TD.CONNECT { background-color: Yellow; }
+TD.TRANSPORT { background-color: Yellow; }
+TD.WSDL { background-color: Yellow; }
+TD.WSDLCACHE { background-color: Yellow; }
+TD.WSDLPARSER { background-color: Yellow; }
+TD.HTTP { background-color: Yellow; }
+TD.SMTP { background-color: Yellow; }
+</style>
+ <title>PHP SOAP Client Interop Test Results</title>
+</head>
+
+<body bgcolor="White" text="Black">
+<h2 align="center">PHP SOAP Client Interop Test Results: Round2</h2>
+
+<a href="index.php">Back to Interop Index</a><br>
+<p>&nbsp;</p>
+
+<?php
+$iop = new Interop_Client();
+
+if ($_GET['detail'] == 1) $iop->showFaults = 1;
+
+if ($_GET['wire']) {
+ $iop->showWire($_GET['wire']);
+} else {
+ $iop->getEndpoints();
+ $iop->getResults();
+
+ if ($_GET['test']) {
+ $iop->currentTest = $_GET['test'];
+ $iop->useWSDL = $_GET['wsdl']?$_GET['wsdl']:0;
+ $iop->paramType = $_GET['type']?$_GET['type']:'php';
+ $iop->outputTable();
+ } else {
+ $iop->outputTables();
+ }
+}
+?>
+</body>
+</html>
diff --git a/ext/soap/interop/client_round2_run.php b/ext/soap/interop/client_round2_run.php
new file mode 100644
index 0000000..86f30f8
--- /dev/null
+++ b/ext/soap/interop/client_round2_run.php
@@ -0,0 +1,53 @@
+<?php
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane@Caraveo.com> |
+// +----------------------------------------------------------------------+
+//
+// $Id$
+//
+
+set_time_limit(0);
+require_once 'client_round2_interop.php';
+
+$iop = new Interop_Client();
+$iop->html = 0;
+
+// force a fetch of endpoints, this happens irregardless if no endpoints in database
+$iop->fetchEndpoints();
+
+// set some options
+$iop->currentTest = 'GroupC'; // see $tests above
+$iop->paramType = 'php'; // 'php' or 'soapval'
+$iop->useWSDL = 1; // 1= do wsdl tests
+$iop->numServers = 0; // 0 = all
+//$iop->specificEndpoint = 'PHP ext/soap'; // test only this endpoint
+//$iop->testMethod = 'echoString'; // test only this method
+
+// endpoints to skip
+//$iop->skipEndpointList = array('Apache Axis','IONA XMLBus','IONA XMLBus (CORBA)','MS SOAP ToolKit 2.0','MS SOAP ToolKit 3.0','Spheon JSOAP','SQLData SOAP Server','WASP Advanced 3.0');
+$iop->startAt='';
+$iop->nosave = 0; // 1= disable saving results to database
+// debug output
+$iop->show = 1;
+$iop->debug = 0;
+$iop->showFaults = 0; // used in result table output
+
+$iop->doTest(); // run a single set of tests using above options
+#$iop->doGroupTests(); // run a group of tests set in $currentTest
+#$iop->doTests(); // run all tests, ignore above options
+#$iop->outputTables();
+echo "done\n";
+
+?>
diff --git a/ext/soap/interop/config.php.dist b/ext/soap/interop/config.php.dist
new file mode 100644
index 0000000..afdeaf9
--- /dev/null
+++ b/ext/soap/interop/config.php.dist
@@ -0,0 +1,5 @@
+<?php
+// configuration items
+$interopConfig['DSN'] = 'mysql://root@localhost/soapinterop';
+$interopConfig['baseURL'] = 'http://localhost/soap/interop';
+?> \ No newline at end of file
diff --git a/ext/soap/interop/database_round2.sql b/ext/soap/interop/database_round2.sql
new file mode 100644
index 0000000..6834b0e
--- /dev/null
+++ b/ext/soap/interop/database_round2.sql
@@ -0,0 +1,44 @@
+# phpMyAdmin MySQL-Dump
+# version 2.2.5
+# http://phpwizard.net/phpMyAdmin/
+# http://phpmyadmin.sourceforge.net/ (download page)
+#
+# Host: localhost
+# Generation Time: Apr 08, 2002 at 08:32 PM
+# Server version: 3.23.49
+# PHP Version: 4.1.1
+# Database : `interop`
+# --------------------------------------------------------
+
+#
+# Table structure for table `endpoints`
+#
+
+CREATE TABLE endpoints (
+ id int(11) NOT NULL auto_increment,
+ endpointName varchar(50) NOT NULL default '',
+ endpointURL varchar(255) NOT NULL default '',
+ wsdlURL varchar(255) NOT NULL default '',
+ class varchar(20) NOT NULL default '',
+ status int(11) NOT NULL default '1',
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `results`
+#
+
+CREATE TABLE results (
+ id int(11) NOT NULL auto_increment,
+ endpoint int(11) NOT NULL default '0',
+ stamp int(11) NOT NULL default '0',
+ class varchar(10) NOT NULL default '',
+ type varchar(10) default NULL,
+ wsdl int(11) NOT NULL default '0',
+ function varchar(255) NOT NULL default '',
+ result varchar(25) NOT NULL default '',
+ error text,
+ wire text NOT NULL,
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
diff --git a/ext/soap/interop/echoheadersvc.wsdl.php b/ext/soap/interop/echoheadersvc.wsdl.php
new file mode 100644
index 0000000..e707024
--- /dev/null
+++ b/ext/soap/interop/echoheadersvc.wsdl.php
@@ -0,0 +1,398 @@
+<?php
+header("Content-Type: text/xml");
+echo '<?xml version="1.0"?>';
+echo "\n";
+?>
+<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd">
+
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+
+ <complexType name="ArrayOfstring">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOfint">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOffloat">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOfSOAPStruct">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varString" type="string" nillable="true"/>
+ <element name="varInt" type="int" nillable="true"/>
+ <element name="varFloat" type="float" nillable="true"/>
+ </all>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="echoHeaderString_Request">
+ <part name="echoMeStringRequest" type="xsd:string"/>
+ </message>
+ <message name="echoHeaderString_Response">
+ <part name="echoMeStringResponse" type="xsd:string"/>
+ </message>
+ <message name="echoHeaderStruct_Request">
+ <part name="echoMeStructRequest" type="s:SOAPStruct"/>
+ </message>
+ <message name="echoHeaderStruct_Response">
+ <part name="echoMeStructResponse" type="s:SOAPStruct"/>
+ </message>
+ <message name="echoStringRequest">
+ <part name="inputString" type="xsd:string"/>
+ </message>
+ <message name="echoStringResponse">
+ <part name="return" type="xsd:string"/>
+ </message>
+ <message name="echoStringArrayRequest">
+ <part name="inputStringArray" type="s:ArrayOfstring"/>
+ </message>
+ <message name="echoStringArrayResponse">
+ <part name="return" type="s:ArrayOfstring"/>
+ </message>
+ <message name="echoIntegerRequest">
+ <part name="inputInteger" type="xsd:int"/>
+ </message>
+ <message name="echoIntegerResponse">
+ <part name="return" type="xsd:int"/>
+ </message>
+ <message name="echoIntegerArrayRequest">
+ <part name="inputIntegerArray" type="s:ArrayOfint"/>
+ </message>
+ <message name="echoIntegerArrayResponse">
+ <part name="return" type="s:ArrayOfint"/>
+ </message>
+ <message name="echoFloatRequest">
+ <part name="inputFloat" type="xsd:float"/>
+ </message>
+ <message name="echoFloatResponse">
+ <part name="return" type="xsd:float"/>
+ </message>
+ <message name="echoFloatArrayRequest">
+ <part name="inputFloatArray" type="s:ArrayOffloat"/>
+ </message>
+ <message name="echoFloatArrayResponse">
+ <part name="return" type="s:ArrayOffloat"/>
+ </message>
+ <message name="echoStructRequest">
+ <part name="inputStruct" type="s:SOAPStruct"/>
+ </message>
+ <message name="echoStructResponse">
+ <part name="return" type="s:SOAPStruct"/>
+ </message>
+ <message name="echoStructArrayRequest">
+ <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/>
+ </message>
+ <message name="echoStructArrayResponse">
+ <part name="return" type="s:ArrayOfSOAPStruct"/>
+ </message>
+ <message name="echoVoidRequest"/>
+ <message name="echoVoidResponse"/>
+ <message name="echoBase64Request">
+ <part name="inputBase64" type="xsd:base64Binary"/>
+ </message>
+ <message name="echoBase64Response">
+ <part name="return" type="xsd:base64Binary"/>
+ </message>
+ <message name="echoDateRequest">
+ <part name="inputDate" type="xsd:dateTime"/>
+ </message>
+ <message name="echoDateResponse">
+ <part name="return" type="xsd:dateTime"/>
+ </message>
+ <message name="echoHexBinaryRequest">
+ <part name="inputHexBinary" type="xsd:hexBinary"/>
+ </message>
+ <message name="echoHexBinaryResponse">
+ <part name="return" type="xsd:hexBinary"/>
+ </message>
+ <message name="echoDecimalRequest">
+ <part name="inputDecimal" type="xsd:decimal"/>
+ </message>
+ <message name="echoDecimalResponse">
+ <part name="return" type="xsd:decimal"/>
+ </message>
+ <message name="echoBooleanRequest">
+ <part name="inputBoolean" type="xsd:boolean"/>
+ </message>
+ <message name="echoBooleanResponse">
+ <part name="return" type="xsd:boolean"/>
+ </message>
+
+ <portType name="InteropTestPortType">
+ <operation name="echoString" parameterOrder="inputString">
+ <input message="tns:echoStringRequest"/>
+ <output message="tns:echoStringResponse"/>
+ </operation>
+ <operation name="echoStringArray" parameterOrder="inputStringArray">
+ <input message="tns:echoStringArrayRequest"/>
+ <output message="tns:echoStringArrayResponse"/>
+ </operation>
+ <operation name="echoInteger" parameterOrder="inputInteger">
+ <input message="tns:echoIntegerRequest"/>
+ <output message="tns:echoIntegerResponse"/>
+ </operation>
+ <operation name="echoIntegerArray" parameterOrder="inputIntegerArray">
+ <input message="tns:echoIntegerArrayRequest"/>
+ <output message="tns:echoIntegerArrayResponse"/>
+ </operation>
+ <operation name="echoFloat" parameterOrder="inputFloat">
+ <input message="tns:echoFloatRequest"/>
+ <output message="tns:echoFloatResponse"/>
+ </operation>
+ <operation name="echoFloatArray" parameterOrder="inputFloatArray">
+ <input message="tns:echoFloatArrayRequest"/>
+ <output message="tns:echoFloatArrayResponse"/>
+ </operation>
+ <operation name="echoStruct" parameterOrder="inputStruct">
+ <input message="tns:echoStructRequest"/>
+ <output message="tns:echoStructResponse"/>
+ </operation>
+ <operation name="echoStructArray" parameterOrder="inputStructArray">
+ <input message="tns:echoStructArrayRequest"/>
+ <output message="tns:echoStructArrayResponse"/>
+ </operation>
+ <operation name="echoVoid">
+ <input message="tns:echoVoidRequest"/>
+ <output message="tns:echoVoidResponse"/>
+ </operation>
+ <operation name="echoBase64" parameterOrder="inputBase64">
+ <input message="tns:echoBase64Request"/>
+ <output message="tns:echoBase64Response"/>
+ </operation>
+ <operation name="echoDate" parameterOrder="inputDate">
+ <input message="tns:echoDateRequest"/>
+ <output message="tns:echoDateResponse"/>
+ </operation>
+ <operation name="echoHexBinary" parameterOrder="inputHexBinary">
+ <input message="tns:echoHexBinaryRequest"/>
+ <output message="tns:echoHexBinaryResponse"/>
+ </operation>
+ <operation name="echoDecimal" parameterOrder="inputDecimal">
+ <input message="tns:echoDecimalRequest"/>
+ <output message="tns:echoDecimalResponse"/>
+ </operation>
+ <operation name="echoBoolean" parameterOrder="inputBoolean">
+ <input message="tns:echoBooleanRequest"/>
+ <output message="tns:echoBooleanResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="InteropEchoHeaderBinding" type="tns:InteropTestPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <operation name="echoString">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStringArray">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoInteger">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoIntegerArray">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoFloat">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoFloatArray">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStructArray">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoVoid">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoBase64">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoDate">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoHexBinary">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoDecimal">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoBoolean">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+
+ </binding>
+
+ <service name="interopLabEchoHeader">
+
+ <port name="interopPortEchoHdr" binding="tns:InteropEchoHeaderBinding">
+ <soap:address location="<?php echo ((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']));?>/server_round2_groupC.php"/>
+ </port>
+
+ </service>
+</definitions>
diff --git a/ext/soap/interop/index.php b/ext/soap/interop/index.php
new file mode 100644
index 0000000..1ae25d9
--- /dev/null
+++ b/ext/soap/interop/index.php
@@ -0,0 +1,59 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <title>PHP SOAP Interop</title>
+</head>
+<?php
+// get our endpoint
+$server = $_SERVER['HTTP_HOST'].':'.$_SERVER['SERVER_PORT'];
+$base = (isset($_SERVER['HTTPS'])?"https://":"http://").$server.dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php";
+$groupb = (isset($_SERVER['HTTPS'])?"https://":"http://").$server.dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php";
+$groupc = (isset($_SERVER['HTTPS'])?"https://":"http://").$server.dirname($_SERVER['PHP_SELF'])."/echoheadersvc.wsdl.php";
+?>
+<body>
+
+<h2 align='center'>PHP SOAP Interop</h2>
+<p>Welcome to the PHP SOAP Interop pages. These pages are set up for
+SOAP Builder interop tests. You can find out more about the interop tests
+at <a href="http://www.whitemesa.com/interop.htm">White Mesa</a>.</p>
+<p>Currently Round 2 base, Group B and Group C interop tests are enabled.</p>
+
+<h3>Round 2 Interop Server</h3>
+Base WSDL: <a href="<?php echo $base ?>"><?php echo $base ?></a><br>
+Group B WSDL: <a href="<?php echo $groupb ?>"><?php echo $groupb ?></a><br>
+Group C WSDL: <a href="<?php echo $groupc ?>"><?php echo $groupc ?></a><br>
+
+<h3>Interop Client</h3>
+
+<p>Notes: Tests are done both "Direct" and with "WSDL". WSDL tests use the supplied interop WSDL
+to run the tests against. The Direct method uses an internal prebuilt list of methods and parameters
+for the test.</p>
+<p>Tests are also run against two methods of generating method parameters. The first, 'php', attempts
+to directly serialize PHP variables into soap values. The second method, 'soapval', uses a SoapParam and SoapVar
+classes to define what the type of the value is.</p>
+
+<h3>Client Test Interface</h3>
+<p>The <a href="client_round2.php">client interface</a> allows you to run the PHP SOAP
+Client against a choosen interop server. Each run updates the results database below.</p>
+
+<h3>Interop Client Test Results</h3>
+<p>This is a database of the current test results using PHP SOAP Clients against interop servers.</p>
+<p>More detail (wire) about errors (marked yellow or red) can be obtained by clicking on the
+link in the result box. If we have an HTTP error
+attempting to connect to the endpoint, we will mark all consecutive attempts as errors, and skip
+testing that endpoint. This reduces the time it takes to run the tests if a server is unavailable.</p>
+<ul>
+<li><a href="client_round2_results.php?test=base&type=php&wsdl=0">Base results using PHP native types</a></li>
+<li><a href="client_round2_results.php?test=base&type=soapval&wsdl=0">Base results using SOAP types</a></li>
+<li><a href="client_round2_results.php?test=base&type=php&wsdl=1">Base results using PHP native types with WSDL</a></li>
+<li><a href="client_round2_results.php?test=GroupB&type=php&wsdl=0">Group B results using PHP native types</a></li>
+<li><a href="client_round2_results.php?test=GroupB&type=soapval&wsdl=0">Group B results using SOAP types</a></li>
+<li><a href="client_round2_results.php?test=GroupB&type=php&wsdl=1">Group B results using PHP native types with WSDL</a></li>
+<li><a href="client_round2_results.php?test=GroupC&type=php&wsdl=0">Group C results using PHP native types</a></li>
+<li><a href="client_round2_results.php?test=GroupC&type=soapval&wsdl=0">Group C results using SOAP types</a></li>
+<li><a href="client_round2_results.php?test=GroupC&type=php&wsdl=1">Group C results using PHP native types with WSDL</a></li>
+<li><a href="client_round2_results.php">Show All Results</a></li>
+</ul>
+</body>
+</html>
diff --git a/ext/soap/interop/interop.wsdl.php b/ext/soap/interop/interop.wsdl.php
new file mode 100644
index 0000000..6ed2d17
--- /dev/null
+++ b/ext/soap/interop/interop.wsdl.php
@@ -0,0 +1,336 @@
+<?php
+header("Content-Type: text/xml");
+echo '<?xml version="1.0"?>';
+echo "\n";
+?>
+<definitions name="InteropTest"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="http://soapinterop.org/"
+ xmlns:s="http://soapinterop.org/xsd"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://soapinterop.org/">
+
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd">
+ <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+ <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
+ <xsd:complexType name="ArrayOfstring">
+ <xsd:complexContent>
+ <xsd:restriction base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="ArrayOfint">
+ <xsd:complexContent>
+ <xsd:restriction base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="ArrayOffloat">
+ <xsd:complexContent>
+ <xsd:restriction base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="SOAPStruct">
+ <xsd:all>
+ <xsd:element name="varString" type="string"/>
+ <xsd:element name="varInt" type="int"/>
+ <xsd:element name="varFloat" type="float"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="ArrayOfSOAPStruct">
+ <xsd:complexContent>
+ <xsd:restriction base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </schema>
+ </types>
+
+ <message name="echoStringRequest">
+ <part name="inputString" type="xsd:string" />
+ </message>
+ <message name="echoStringResponse">
+ <part name="outputString" type="xsd:string" />
+ </message>
+ <message name="echoStringArrayRequest">
+ <part name="inputStringArray" type="s:ArrayOfstring" />
+ </message>
+ <message name="echoStringArrayResponse">
+ <part name="outputStringArray" type="s:ArrayOfstring" />
+ </message>
+ <message name="echoIntegerRequest">
+ <part name="inputInteger" type="xsd:int" />
+ </message>
+ <message name="echoIntegerResponse">
+ <part name="outputInteger" type="xsd:int" />
+ </message>
+ <message name="echoIntegerArrayRequest">
+ <part name="inputIntegerArray" type="s:ArrayOfint" />
+ </message>
+ <message name="echoIntegerArrayResponse">
+ <part name="outputIntegerArray" type="s:ArrayOfint" />
+ </message>
+ <message name="echoFloatRequest">
+ <part name="inputFloat" type="xsd:float" />
+ </message>
+ <message name="echoFloatResponse">
+ <part name="outputFloat" type="xsd:float" />
+ </message>
+ <message name="echoFloatArrayRequest">
+ <part name="inputFloatArray" type="s:ArrayOffloat" />
+ </message>
+ <message name="echoFloatArrayResponse">
+ <part name="outputFloatArray" type="s:ArrayOffloat" />
+ </message>
+ <message name="echoStructRequest">
+ <part name="inputStruct" type="s:SOAPStruct" />
+ </message>
+ <message name="echoStructResponse">
+ <part name="outputStruct" type="s:SOAPStruct" />
+ </message>
+ <message name="echoStructArrayRequest">
+ <part name="inputStructArray" type="s:ArrayOfSOAPStruct" />
+ </message>
+ <message name="echoStructArrayResponse">
+ <part name="outputStructArray" type="s:ArrayOfSOAPStruct" />
+ </message>
+ <message name="echoVoidRequest">
+ </message>
+ <message name="echoVoidResponse">
+ </message>
+ <message name="echoBase64Request">
+ <part name="inputBase64" type="xsd:base64Binary" />
+ </message>
+ <message name="echoBase64Response">
+ <part name="outputBase64" type="xsd:base64Binary" />
+ </message>
+ <message name="echoDateRequest">
+ <part name="inputDate" type="xsd:dateTime" />
+ </message>
+ <message name="echoDateResponse">
+ <part name="outputDate" type="xsd:dateTime" />
+ </message>
+ <message name="echoHexBinaryRequest">
+ <part name="inputHexBinary" type="xsd:hexBinary" />
+ </message>
+ <message name="echoHexBinaryResponse">
+ <part name="outputHexBinary" type="xsd:hexBinary" />
+ </message>
+ <message name="echoDecimalRequest">
+ <part name="inputDecimal" type="xsd:decimal" />
+ </message>
+ <message name="echoDecimalResponse">
+ <part name="outputDecimal" type="xsd:decimal" />
+ </message>
+ <message name="echoBooleanRequest">
+ <part name="inputBoolean" type="xsd:boolean" />
+ </message>
+ <message name="echoBooleanResponse">
+ <part name="outputBoolean" type="xsd:boolean" />
+ </message>
+
+ <portType name="InteropTestPortType">
+ <operation name="echoString">
+ <input message="tns:echoStringRequest"/>
+ <output message="tns:echoStringResponse"/>
+ </operation>
+ <operation name="echoStringArray">
+ <input message="tns:echoStringArrayRequest"/>
+ <output message="tns:echoStringArrayResponse"/>
+ </operation>
+ <operation name="echoInteger">
+ <input message="tns:echoIntegerRequest"/>
+ <output message="tns:echoIntegerResponse"/>
+ </operation>
+ <operation name="echoIntegerArray">
+ <input message="tns:echoIntegerArrayRequest"/>
+ <output message="tns:echoIntegerArrayResponse"/>
+ </operation>
+ <operation name="echoFloat">
+ <input message="tns:echoFloatRequest"/>
+ <output message="tns:echoFloatResponse"/>
+ </operation>
+ <operation name="echoFloatArray">
+ <input message="tns:echoFloatArrayRequest"/>
+ <output message="tns:echoFloatArrayResponse"/>
+ </operation>
+ <operation name="echoStruct">
+ <input message="tns:echoStructRequest"/>
+ <output message="tns:echoStructResponse"/>
+ </operation>
+ <operation name="echoStructArray">
+ <input message="tns:echoStructArrayRequest"/>
+ <output message="tns:echoStructArrayResponse"/>
+ </operation>
+ <operation name="echoVoid">
+ <input message="tns:echoVoidRequest"/>
+ <output message="tns:echoVoidResponse"/>
+ </operation>
+ <operation name="echoBase64">
+ <input message="tns:echoBase64Request"/>
+ <output message="tns:echoBase64Response"/>
+ </operation>
+ <operation name="echoDate">
+ <input message="tns:echoDateRequest"/>
+ <output message="tns:echoDateResponse"/>
+ </operation>
+ <operation name="echoHexBinary">
+ <input message="tns:echoHexBinaryRequest"/>
+ <output message="tns:echoHexBinaryResponse"/>
+ </operation>
+ <operation name="echoDecimal">
+ <input message="tns:echoDecimalRequest"/>
+ <output message="tns:echoDecimalResponse"/>
+ </operation>
+ <operation name="echoBoolean">
+ <input message="tns:echoBooleanRequest"/>
+ <output message="tns:echoBooleanResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="InteropTestBinding" type="tns:InteropTestPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStringArray">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoInteger">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoIntegerArray">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoFloat">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoFloatArray">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStructArray">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoVoid">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoBase64">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoDate">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoHexBinary">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoDecimal">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoBoolean">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="InteropTest">
+ <port name="InteropTestPort" binding="tns:InteropTestBinding">
+ <soap:address location="<?php echo ((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']));?>/server_round2_base.php"/>
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/interop/interopB.wsdl.php b/ext/soap/interop/interopB.wsdl.php
new file mode 100644
index 0000000..3113b1c
--- /dev/null
+++ b/ext/soap/interop/interopB.wsdl.php
@@ -0,0 +1,196 @@
+<?php
+header("Content-Type: text/xml");
+echo '<?xml version="1.0"?>';
+echo "\n";
+?>
+<definitions name="InteropTest"
+ targetNamespace="http://soapinterop.org/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="http://soapinterop.org/"
+ xmlns:s="http://soapinterop.org/xsd"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://soapinterop.org/xsd">
+
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+
+ <complexType name="ArrayOfstring">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOfint">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOffloat">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOfSOAPStruct">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varString" type="string" nillable="true"/>
+ <element name="varInt" type="int" nillable="true"/>
+ <element name="varFloat" type="float" nillable="true"/>
+ </all>
+ </complexType>
+ <complexType name="SOAPStructStruct">
+ <all>
+ <element name="varString" type="string" nillable="true"/>
+ <element name="varInt" type="int" nillable="true"/>
+ <element name="varFloat" type="float" nillable="true"/>
+ <element name="varStruct" type="s:SOAPStruct"/>
+ </all>
+ </complexType>
+ <complexType name="SOAPArrayStruct">
+ <all>
+ <element name="varString" type="string" nillable="true"/>
+ <element name="varInt" type="int" nillable="true"/>
+ <element name="varFloat" type="float" nillable="true"/>
+ <element name="varArray" type="s:ArrayOfstring"/>
+ </all>
+ </complexType>
+ <complexType name="ArrayOfString2D">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[,]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="echoStructAsSimpleTypesRequest">
+ <part name="inputStruct" type="s:SOAPStruct"/>
+ </message>
+ <message name="echoStructAsSimpleTypesResponse">
+ <part name="outputString" type="xsd:string"/>
+ <part name="outputInteger" type="xsd:int"/>
+ <part name="outputFloat" type="xsd:float"/>
+ </message>
+ <message name="echoSimpleTypesAsStructRequest">
+ <part name="inputString" type="xsd:string"/>
+ <part name="inputInteger" type="xsd:int"/>
+ <part name="inputFloat" type="xsd:float"/>
+ </message>
+ <message name="echoSimpleTypesAsStructResponse">
+ <part name="return" type="s:SOAPStruct"/>
+ </message>
+ <message name="echo2DStringArrayRequest">
+ <part name="input2DStringArray" type="s:ArrayOfString2D"/>
+ </message>
+ <message name="echo2DStringArrayResponse">
+ <part name="return" type="s:ArrayOfString2D"/>
+ </message>
+ <message name="echoNestedStructRequest">
+ <part name="inputStruct" type="s:SOAPStructStruct"/>
+ </message>
+ <message name="echoNestedStructResponse">
+ <part name="return" type="s:SOAPStructStruct"/>
+ </message>
+ <message name="echoNestedArrayRequest">
+ <part name="inputStruct" type="s:SOAPArrayStruct"/>
+ </message>
+ <message name="echoNestedArrayResponse">
+ <part name="return" type="s:SOAPArrayStruct"/>
+ </message>
+
+ <portType name="InteropTestPortTypeB">
+ <operation name="echoStructAsSimpleTypes" parameterOrder="inputStruct outputString outputInteger outputFloat">
+ <input message="tns:echoStructAsSimpleTypesRequest" name="echoStructAsSimpleTypes"/>
+ <output message="tns:echoStructAsSimpleTypesResponse" name="echoStructAsSimpleTypesResponse"/>
+ </operation>
+ <operation name="echoSimpleTypesAsStruct" parameterOrder="inputString inputInteger inputFloat">
+ <input message="tns:echoSimpleTypesAsStructRequest" name="echoSimpleTypesAsStruct"/>
+ <output message="tns:echoSimpleTypesAsStructResponse" name="echoSimpleTypesAsStructResponse"/>
+ </operation>
+ <operation name="echo2DStringArray" parameterOrder="input2DStringArray">
+ <input message="tns:echo2DStringArrayRequest" name="echo2DStringArray"/>
+ <output message="tns:echo2DStringArrayResponse" name="echo2DStringArrayResponse"/>
+ </operation>
+ <operation name="echoNestedStruct" parameterOrder="inputStruct">
+ <input message="tns:echoNestedStructRequest" name="echoNestedStruct"/>
+ <output message="tns:echoNestedStructResponse" name="echoNestedStructResponse"/>
+ </operation>
+ <operation name="echoNestedArray" parameterOrder="inputStruct">
+ <input message="tns:echoNestedArrayRequest" name="echoNestedArray"/>
+ <output message="tns:echoNestedArrayResponse" name="echoNestedArrayResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="InteropTestSoapBindingB" type="tns:InteropTestPortTypeB">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoStructAsSimpleTypes">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoSimpleTypesAsStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echo2DStringArray">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoNestedStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoNestedArray">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="interopLabB">
+ <port name="interopTestPortB" binding="tns:InteropTestSoapBindingB">
+ <soap:address location="<?php echo ((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']));?>/server_round2_groupB.php"/>
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/interop/server_round2_base.php b/ext/soap/interop/server_round2_base.php
new file mode 100644
index 0000000..1cfe57d
--- /dev/null
+++ b/ext/soap/interop/server_round2_base.php
@@ -0,0 +1,105 @@
+<?
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more |
+// | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author |
+// +----------------------------------------------------------------------+
+//
+// $Id$
+//
+
+class SOAP_Interop_Base {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+ function echoStringArray($inputStringArray)
+ {
+ return $inputStringArray;
+ }
+
+
+ function echoInteger($inputInteger)
+ {
+ return $inputInteger;
+ }
+
+ function echoIntegerArray($inputIntegerArray)
+ {
+ return $inputIntegerArray;
+ }
+
+ function echoFloat($inputFloat)
+ {
+ return $inputFloat;
+ }
+
+ function echoFloatArray($inputFloatArray)
+ {
+ return $inputFloatArray;
+ }
+
+ function echoStruct($inputStruct)
+ {
+ return $inputStruct;
+ }
+
+ function echoStructArray($inputStructArray)
+ {
+ return $inputStructArray;
+ }
+
+ function echoVoid()
+ {
+ return NULL;
+ }
+
+ function echoBase64($b_encoded)
+ {
+ return $b_encoded;
+ }
+
+ function echoDate($timeInstant)
+ {
+ return $timeInstant;
+ }
+
+ function echoHexBinary($hb)
+ {
+ return $hb;
+ }
+
+ function echoDecimal($dec)
+ {
+ return $dec;
+ }
+
+ function echoBoolean($boolean)
+ {
+ return $boolean;
+ }
+
+ function echoMimeAttachment($stuff)
+ {
+ return new SOAP_Attachment('return','application/octet-stream',NULL,$stuff);
+ }
+}
+
+$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php");
+$server->setClass("SOAP_Interop_Base");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/interop/server_round2_groupB.php b/ext/soap/interop/server_round2_groupB.php
new file mode 100644
index 0000000..9b63bc7
--- /dev/null
+++ b/ext/soap/interop/server_round2_groupB.php
@@ -0,0 +1,58 @@
+<?
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more |
+// | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author |
+// +----------------------------------------------------------------------+
+//
+// $Id$
+//
+
+class SOAP_Interop_GroupB {
+
+ function echoStructAsSimpleTypes ($struct)
+ {
+ return array('outputString' => $struct->varString,
+ 'outputInteger' => $struct->varInt,
+ 'outputFloat' => $struct->varFloat);
+ }
+
+ function echoSimpleTypesAsStruct($string, $int, $float)
+ {
+ return (object)array("varString" => $string,
+ "varInt" => $int,
+ "varFloat" => $float);
+ }
+
+ function echoNestedStruct($struct)
+ {
+ return $struct;
+ }
+
+ function echo2DStringArray($ary)
+ {
+ return $ary;
+ }
+
+ function echoNestedArray($ary)
+ {
+ return $ary;
+ }
+}
+
+$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php");
+$server->setClass("SOAP_Interop_GroupB");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/interop/server_round2_groupC.php b/ext/soap/interop/server_round2_groupC.php
new file mode 100644
index 0000000..1ca042e
--- /dev/null
+++ b/ext/soap/interop/server_round2_groupC.php
@@ -0,0 +1,43 @@
+<?
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane@Caraveo.com> |
+// +----------------------------------------------------------------------+
+//
+// $Id$
+//
+
+class SOAP_Interop_GroupC {
+ var $method_namespace = 'http://soapinterop.org/echoheader/';
+
+ function echoMeStringRequest($string)
+ {
+ return new SoapHeader($this->method_namespace, "echoMeStringResponse", $string);
+ }
+
+ function echoMeStructRequest($struct)
+ {
+ return new SoapHeader($this->method_namespace, "echoMeStructResponse", $struct);
+ }
+
+ function echoVoid()
+ {
+ }
+}
+
+$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/echoheadersvc.wsdl.php");
+$server->setClass("SOAP_Interop_GroupC");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/interop/test.utility.php b/ext/soap/interop/test.utility.php
new file mode 100644
index 0000000..5b1f699
--- /dev/null
+++ b/ext/soap/interop/test.utility.php
@@ -0,0 +1,143 @@
+<?php
+
+function timestamp_to_soap_datetime($t) {
+ return date('Y-m-d\TH:i:sO',$t);
+}
+
+function soap_datetime_to_timestamp($t) {
+ /* Ignore Microsecconds */
+ $iso8601 = '(-?[0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]*)?(Z|[+\-][0-9]{4}|[+\-][0-9]{2}:[0-9]{2})?';
+ if (!is_int($t)) {
+ if (!ereg($iso8601,$t,$r)) {
+ return false;
+ }
+ $t = gmmktime($r[4],$r[5],$r[6],$r[2],$r[3],$r[1]);
+ if (!empty($r[8]) && $r[8] != 'Z') {
+ $op = substr($r[8],0,1);
+ $h = substr($r[8],1,2);
+ if (strstr($r[8],':')) {
+ $m = substr($r[8],4,2);
+ } else {
+ $m = substr($r[8],3,2);
+ }
+ $t += (($op == "-"?1:-1) * $h * 60 + $m) * 60;
+ }
+ }
+ return $t;
+}
+
+function date_compare($f1,$f2)
+{
+ return soap_datetime_to_timestamp($f1) == soap_datetime_to_timestamp($f2);
+}
+
+function hex_compare($f1, $f2)
+{
+ return strcasecmp($f1,$f2) == 0;
+}
+
+function number_compare($f1, $f2)
+{
+ # figure out which has the least fractional digits
+ preg_match('/.*?\.(.*)/',$f1,$m1);
+ preg_match('/.*?\.(.*)/',$f2,$m2);
+ #print_r($m1);
+ # always use at least 2 digits of precision
+ $d = max(min(strlen(count($m1)?$m1[1]:'0'),strlen(count($m2)?$m2[1]:'0')),2);
+ $f1 = round($f1, $d);
+ $f2 = round($f2, $d);
+ return $f1 == $f2;
+// return bccomp($f1, $f2, $d) == 0;
+}
+
+function boolean_compare($f1, $f2)
+{
+ if (($f1 == 'true' || $f1 === TRUE || $f1 != 0) &&
+ ($f2 == 'true' || $f2 === TRUE || $f2 != 0)) return TRUE;
+ if (($f1 == 'false' || $f1 === FALSE || $f1 == 0) &&
+ ($f2 == 'false' || $f2 === FALSE || $f2 == 0)) return TRUE;
+ return FALSE;
+}
+
+function string_compare($e1, $e2)
+{
+ if (is_numeric($e1) && is_numeric($e2)) {
+ return number_compare($e1, $e2);
+ }
+ # handle dateTime comparison
+ $e1_type = gettype($e1);
+ $e2_type = gettype($e2);
+ $ok = FALSE;
+ if ($e1_type == "string") {
+// $dt = new SOAP_Type_dateTime();
+// $ok = $dt->compare($e1, $e2) == 0;
+ $oj = false;
+ }
+ return $ok || $e1 == $e2 || strcasecmp(trim($e1), trim($e2)) == 0;
+}
+
+function array_compare(&$ar1, &$ar2) {
+ if (gettype($ar1) != 'array' || gettype($ar2) != 'array') return FALSE;
+ if (count($ar1) != count($ar2)) return FALSE;
+ foreach ($ar1 as $k => $v) {
+ if (!array_key_exists($k,$ar2)) return FALSE;
+ if (!compare($v,$ar2[$k])) return FALSE;
+ }
+ return TRUE;
+}
+
+function object_compare(&$obj1, &$obj2) {
+ if (gettype($obj1) != 'object' || gettype($obj2) != 'object') return FALSE;
+// if (class_name(obj1) != class_name(obj2)) return FALSE;
+ $ar1 = (array)$obj1;
+ $ar2 = (array)$obj2;
+ return array_compare($ar1,$ar2);
+}
+
+function compare(&$x,&$y) {
+ $ok = 0;
+ $x_type = gettype($x);
+ $y_type = gettype($y);
+ if ($x_type == $y_type) {
+ if ($x_type == "array") {
+ $ok = array_compare($x, $y);
+ } else if ($x_type == "object") {
+ $ok = object_compare($x, $y);
+ } else if ($x_type == "double") {
+ $ok = number_compare($x, $y);
+// } else if ($x_type == 'boolean') {
+// $ok = boolean_compare($x, $y);
+ } else {
+ $ok = ($x == $y);
+// $ok = string_compare($expect, $result);
+ }
+ }
+ return $ok;
+}
+
+
+function parseMessage($msg)
+{
+ # strip line endings
+ #$msg = preg_replace('/\r|\n/', ' ', $msg);
+ $response = new SOAP_Parser($msg);
+ if ($response->fault) {
+ return $response->fault->getFault();
+ }
+ $return = $response->getResponse();
+ $v = $response->decode($return);
+ if (gettype($v) == 'array' && count($v)==1) {
+ return array_shift($v);
+ }
+ return $v;
+}
+
+function var_dump_str($var) {
+ ob_start();
+ var_dump($var);
+ $res = ob_get_contents();
+ ob_end_clean();
+ return $res;
+}
+
+?> \ No newline at end of file
diff --git a/ext/soap/package.xml b/ext/soap/package.xml
new file mode 100644
index 0000000..e43fd36
--- /dev/null
+++ b/ext/soap/package.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!-- do not use the "Type" attribute here, that one is only for
+ generated package.xml files -->
+<package>
+ <name>ext_soap</name>
+ <summary>Provides SOAP Services</summary>
+ <description>
+ Description of package....
+ </description>
+ <status>beta</status>
+ <maintainers>
+ <maintainer>
+ <user>rodif_bl</user>
+ <name>Brad Lafountain</name>
+ <email>rodif_bl@yahoo.com</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>shane</user>
+ <name>Shane Caraveo</name>
+ <email>shane@caraveo.com</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>dmitry</user>
+ <name>Dmitry Stogov</name>
+ <email>dmitry@zend.com</email>
+ <role>lead</role>
+ </maintainer>
+ </maintainers>
+ <license>PHP</license>
+ <release>
+ <version>0.1</version>
+ <date>2002-07-07</date>
+ <state>alpha</state>
+ <notes>
+ - First offical PEAR/PECL release
+ </notes>
+ </release>
+ <filelist>
+ <dir name="/">
+ <file role="doc">CREDITS</file>
+ <file role="doc">EXPERIMENTAL</file>
+ <file role="doc">TODO</file>
+ <file role="src">config.m4</file>
+ <file role="src">php_encoding.c</file>
+ <file role="src">php_encoding.h</file>
+ <file role="src">php_http.c</file>
+ <file role="src">php_http.h</file>
+ <file role="src">php_packet_soap.c</file>
+ <file role="src">php_packet_soap.h</file>
+ <file role="src">php_schema.c</file>
+ <file role="src">php_schema.h</file>
+ <file role="src">php_sdl.c</file>
+ <file role="src">php_sdl.h</file>
+ <file role="src">php_soap.h</file>
+ <file role="src">php_soap.h</file>
+ <file role="src">php_xml.c</file>
+ <file role="src">php_xml.h</file>
+ <file role="src">soap.c</file>
+ <file role="src">php_soap.dsp</file>
+ </dir>
+ </filelist>
+</package>
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
new file mode 100644
index 0000000..897956d
--- /dev/null
+++ b/ext/soap/php_encoding.c
@@ -0,0 +1,3790 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#include <time.h>
+
+#include "php_soap.h"
+#include "ext/libxml/php_libxml.h"
+#include "ext/standard/base64.h"
+#include <libxml/parserInternals.h>
+#include "zend_strtod.h"
+#include "zend_interfaces.h"
+
+/* zval type decode */
+static zval *to_zval_double(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+static zval *to_zval_long(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+static zval *to_zval_bool(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+static zval *to_zval_string(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+static zval *to_zval_stringr(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+static zval *to_zval_stringc(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+static zval *to_zval_map(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+static zval *to_zval_null(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+static zval *to_zval_base64(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+static zval *to_zval_hexbin(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+
+static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+
+/* String encode */
+static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+
+/* Null encode */
+static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+
+/* Array encode */
+static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+
+static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_list1(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+
+/* Datetime encode/decode */
+static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *format, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_time(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_date(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_gyearmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_gyear(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_gmonthday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_gday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+
+static zval *to_zval_object(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+static zval *to_zval_array(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+
+static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+
+static zval *to_zval_any(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+
+/* Try and guess for non-wsdl clients and servers */
+static zval *guess_zval_convert(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+
+static int is_map(zval *array);
+static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *out_type TSRMLS_DC);
+
+static xmlNodePtr check_and_resolve_href(xmlNodePtr data);
+
+static void set_ns_prop(xmlNodePtr node, char *ns, char *name, char *val);
+static void set_xsi_nil(xmlNodePtr node);
+static void set_xsi_type(xmlNodePtr node, char *type);
+
+static void get_type_str(xmlNodePtr node, const char* ns, const char* type, smart_str* ret);
+static void set_ns_and_type_ex(xmlNodePtr node, char *ns, char *type);
+
+static void set_ns_and_type(xmlNodePtr node, encodeTypePtr type);
+
+#define FIND_XML_NULL(xml,zval) \
+ { \
+ xmlAttrPtr null; \
+ if (!xml) { \
+ ZVAL_NULL(zval); \
+ return zval; \
+ } \
+ if (xml->properties) { \
+ null = get_attribute(xml->properties, "nil"); \
+ if (null) { \
+ ZVAL_NULL(zval); \
+ return zval; \
+ } \
+ } \
+ }
+
+#define CHECK_XML_NULL(xml) \
+ { \
+ xmlAttrPtr null; \
+ if (!xml) { \
+ zval *ret; \
+ ALLOC_INIT_ZVAL(ret); \
+ ZVAL_NULL(ret); \
+ return ret; \
+ } \
+ if (xml->properties) { \
+ null = get_attribute(xml->properties, "nil"); \
+ if (null) { \
+ zval *ret; \
+ ALLOC_INIT_ZVAL(ret); \
+ ZVAL_NULL(ret); \
+ return ret; \
+ } \
+ } \
+ }
+
+#define FIND_ZVAL_NULL(zval, xml, style) \
+{ \
+ if (!zval || Z_TYPE_P(zval) == IS_NULL) { \
+ if (style == SOAP_ENCODED) {\
+ set_xsi_nil(xml); \
+ } \
+ return xml; \
+ } \
+}
+
+encode defaultEncoding[] = {
+ {{UNKNOWN_TYPE, NULL, NULL, NULL}, guess_zval_convert, guess_xml_convert},
+
+ {{IS_NULL, "nil", XSI_NAMESPACE, NULL}, to_zval_null, to_xml_null},
+ {{IS_STRING, XSD_STRING_STRING, XSD_NAMESPACE, NULL}, to_zval_string, to_xml_string},
+ {{IS_LONG, XSD_INT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{IS_DOUBLE, XSD_FLOAT_STRING, XSD_NAMESPACE, NULL}, to_zval_double, to_xml_double},
+ {{IS_BOOL, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL}, to_zval_bool, to_xml_bool},
+ {{IS_CONSTANT, XSD_STRING_STRING, XSD_NAMESPACE, NULL}, to_zval_string, to_xml_string},
+ {{IS_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_array, guess_array_map},
+ {{IS_CONSTANT_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_array, to_xml_array},
+ {{IS_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_object, to_xml_object},
+ {{IS_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_array, guess_array_map},
+ {{IS_CONSTANT_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_array, to_xml_array},
+ {{IS_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_object, to_xml_object},
+
+ {{XSD_STRING, XSD_STRING_STRING, XSD_NAMESPACE, NULL}, to_zval_string, to_xml_string},
+ {{XSD_BOOLEAN, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL}, to_zval_bool, to_xml_bool},
+ {{XSD_DECIMAL, XSD_DECIMAL_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_FLOAT, XSD_FLOAT_STRING, XSD_NAMESPACE, NULL}, to_zval_double, to_xml_double},
+ {{XSD_DOUBLE, XSD_DOUBLE_STRING, XSD_NAMESPACE, NULL}, to_zval_double, to_xml_double},
+
+ {{XSD_DATETIME, XSD_DATETIME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_datetime},
+ {{XSD_TIME, XSD_TIME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_time},
+ {{XSD_DATE, XSD_DATE_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_date},
+ {{XSD_GYEARMONTH, XSD_GYEARMONTH_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gyearmonth},
+ {{XSD_GYEAR, XSD_GYEAR_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gyear},
+ {{XSD_GMONTHDAY, XSD_GMONTHDAY_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gmonthday},
+ {{XSD_GDAY, XSD_GDAY_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gday},
+ {{XSD_GMONTH, XSD_GMONTH_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gmonth},
+ {{XSD_DURATION, XSD_DURATION_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_duration},
+
+ {{XSD_HEXBINARY, XSD_HEXBINARY_STRING, XSD_NAMESPACE, NULL}, to_zval_hexbin, to_xml_hexbin},
+ {{XSD_BASE64BINARY, XSD_BASE64BINARY_STRING, XSD_NAMESPACE, NULL}, to_zval_base64, to_xml_base64},
+
+ {{XSD_LONG, XSD_LONG_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_INT, XSD_INT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_SHORT, XSD_SHORT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_BYTE, XSD_BYTE_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_NONPOSITIVEINTEGER, XSD_NONPOSITIVEINTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_POSITIVEINTEGER, XSD_POSITIVEINTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_NONNEGATIVEINTEGER, XSD_NONNEGATIVEINTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_NEGATIVEINTEGER, XSD_NEGATIVEINTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_UNSIGNEDBYTE, XSD_UNSIGNEDBYTE_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_UNSIGNEDSHORT, XSD_UNSIGNEDSHORT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_UNSIGNEDINT, XSD_UNSIGNEDINT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_UNSIGNEDLONG, XSD_UNSIGNEDLONG_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_INTEGER, XSD_INTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+
+ {{XSD_ANYTYPE, XSD_ANYTYPE_STRING, XSD_NAMESPACE, NULL}, guess_zval_convert, guess_xml_convert},
+ {{XSD_UR_TYPE, XSD_UR_TYPE_STRING, XSD_NAMESPACE, NULL}, guess_zval_convert, guess_xml_convert},
+ {{XSD_ANYURI, XSD_ANYURI_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_QNAME, XSD_QNAME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_NOTATION, XSD_NOTATION_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_NORMALIZEDSTRING, XSD_NORMALIZEDSTRING_STRING, XSD_NAMESPACE, NULL}, to_zval_stringr, to_xml_string},
+ {{XSD_TOKEN, XSD_TOKEN_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_LANGUAGE, XSD_LANGUAGE_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_NMTOKEN, XSD_NMTOKEN_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_NMTOKENS, XSD_NMTOKENS_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_list1},
+ {{XSD_NAME, XSD_NAME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_NCNAME, XSD_NCNAME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_ID, XSD_ID_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_IDREF, XSD_IDREF_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_IDREFS, XSD_IDREFS_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_list1},
+ {{XSD_ENTITY, XSD_ENTITY_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_ENTITIES, XSD_ENTITIES_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_list1},
+
+ {{APACHE_MAP, APACHE_MAP_STRING, APACHE_NAMESPACE, NULL}, to_zval_map, to_xml_map},
+
+ {{SOAP_ENC_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_object, to_xml_object},
+ {{SOAP_ENC_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_array, to_xml_array},
+ {{SOAP_ENC_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_object, to_xml_object},
+ {{SOAP_ENC_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_array, to_xml_array},
+
+ /* support some of the 1999 data types */
+ {{XSD_STRING, XSD_STRING_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_string, to_xml_string},
+ {{XSD_BOOLEAN, XSD_BOOLEAN_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_bool, to_xml_bool},
+ {{XSD_DECIMAL, XSD_DECIMAL_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+ {{XSD_FLOAT, XSD_FLOAT_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_double, to_xml_double},
+ {{XSD_DOUBLE, XSD_DOUBLE_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_double, to_xml_double},
+
+ {{XSD_LONG, XSD_LONG_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_INT, XSD_INT_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_SHORT, XSD_SHORT_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_BYTE, XSD_BYTE_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{XSD_1999_TIMEINSTANT, XSD_1999_TIMEINSTANT_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_stringc, to_xml_string},
+
+ {{XSD_ANYXML, "<anyXML>", "<anyXML>", NULL}, to_zval_any, to_xml_any},
+
+ {{END_KNOWN_TYPES, NULL, NULL, NULL}, guess_zval_convert, guess_xml_convert}
+};
+
+int numDefaultEncodings = sizeof(defaultEncoding)/sizeof(encode);
+
+
+void whiteSpace_replace(xmlChar* str)
+{
+ while (*str != '\0') {
+ if (*str == '\x9' || *str == '\xA' || *str == '\xD') {
+ *str = ' ';
+ }
+ str++;
+ }
+}
+
+void whiteSpace_collapse(xmlChar* str)
+{
+ xmlChar *pos;
+ xmlChar old;
+
+ pos = str;
+ whiteSpace_replace(str);
+ while (*str == ' ') {
+ str++;
+ }
+ old = '\0';
+ while (*str != '\0') {
+ if (*str != ' ' || old != ' ') {
+ *pos = *str;
+ pos++;
+ }
+ old = *str;
+ str++;
+ }
+ if (old == ' ') {
+ --pos;
+ }
+ *pos = '\0';
+}
+
+static encodePtr find_encoder_by_type_name(sdlPtr sdl, const char *type)
+{
+ if (sdl && sdl->encoders) {
+ HashPosition pos;
+ encodePtr *enc;
+
+ for (zend_hash_internal_pointer_reset_ex(sdl->encoders, &pos);
+ zend_hash_get_current_data_ex(sdl->encoders, (void **) &enc, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(sdl->encoders, &pos)) {
+ if (strcmp((*enc)->details.type_str, type) == 0) {
+ return *enc;
+ }
+ }
+ }
+ return NULL;
+}
+
+static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) {
+ xmlNodePtr *node_ptr;
+
+ if (SOAP_GLOBAL(ref_map)) {
+ if (Z_TYPE_P(data) == IS_OBJECT) {
+ data = (zval*)zend_objects_get_address(data TSRMLS_CC);
+ }
+ if (zend_hash_index_find(SOAP_GLOBAL(ref_map), (ulong)data, (void**)&node_ptr) == SUCCESS) {
+ xmlAttrPtr attr = (*node_ptr)->properties;
+ char *id;
+ smart_str prefix = {0};
+
+ if (*node_ptr == node) {
+ return 0;
+ }
+ xmlNodeSetName(node, (*node_ptr)->name);
+ xmlSetNs(node, (*node_ptr)->ns);
+ if (SOAP_GLOBAL(soap_version) == SOAP_1_1) {
+ while (1) {
+ attr = get_attribute(attr, "id");
+ if (attr == NULL || attr->ns == NULL) {
+ break;
+ }
+ attr = attr->next;
+ }
+ if (attr) {
+ id = (char*)attr->children->content;
+ smart_str_appendc(&prefix, '#');
+ smart_str_appends(&prefix, id);
+ smart_str_0(&prefix);
+ id = prefix.c;
+ } else {
+ SOAP_GLOBAL(cur_uniq_ref)++;
+ smart_str_appendl(&prefix, "#ref", 4);
+ smart_str_append_long(&prefix, SOAP_GLOBAL(cur_uniq_ref));
+ smart_str_0(&prefix);
+ id = prefix.c;
+ xmlSetProp((*node_ptr), BAD_CAST("id"), BAD_CAST(id+1));
+ }
+ xmlSetProp(node, BAD_CAST("href"), BAD_CAST(id));
+ } else {
+ attr = get_attribute_ex(attr, "id", SOAP_1_2_ENC_NAMESPACE);
+ if (attr) {
+ id = (char*)attr->children->content;
+ smart_str_appendc(&prefix, '#');
+ smart_str_appends(&prefix, id);
+ smart_str_0(&prefix);
+ id = prefix.c;
+ } else {
+ SOAP_GLOBAL(cur_uniq_ref)++;
+ smart_str_appendl(&prefix, "#ref", 4);
+ smart_str_append_long(&prefix, SOAP_GLOBAL(cur_uniq_ref));
+ smart_str_0(&prefix);
+ id = prefix.c;
+ set_ns_prop((*node_ptr), SOAP_1_2_ENC_NAMESPACE, "id", id+1);
+ }
+ set_ns_prop(node, SOAP_1_2_ENC_NAMESPACE, "ref", id);
+ }
+ smart_str_free(&prefix);
+ return 1;
+ } else {
+ zend_hash_index_update(SOAP_GLOBAL(ref_map), (ulong)data, (void**)&node, sizeof(xmlNodePtr), NULL);
+ }
+ }
+ return 0;
+}
+
+static zval* soap_find_xml_ref(xmlNodePtr node TSRMLS_DC)
+{
+ zval **data_ptr;
+
+ if (SOAP_GLOBAL(ref_map) &&
+ zend_hash_index_find(SOAP_GLOBAL(ref_map), (ulong)node, (void**)&data_ptr) == SUCCESS) {
+ Z_SET_ISREF_PP(data_ptr);
+ Z_ADDREF_PP(data_ptr);
+ return *data_ptr;
+ }
+ return NULL;
+}
+
+static zend_bool soap_check_xml_ref(zval **data, xmlNodePtr node TSRMLS_DC)
+{
+ zval **data_ptr;
+
+ if (SOAP_GLOBAL(ref_map)) {
+ if (zend_hash_index_find(SOAP_GLOBAL(ref_map), (ulong)node, (void**)&data_ptr) == SUCCESS) {
+ if (*data != *data_ptr) {
+ zval_ptr_dtor(data);
+ *data = *data_ptr;
+ Z_SET_ISREF_PP(data);
+ Z_ADDREF_PP(data);
+ return 1;
+ }
+ } else {
+ zend_hash_index_update(SOAP_GLOBAL(ref_map), (ulong)node, (void**)data, sizeof(zval*), NULL);
+ }
+ }
+ return 0;
+}
+
+static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xmlNodePtr parent, int check_class_map TSRMLS_DC)
+{
+ xmlNodePtr node = NULL;
+ int add_type = 0;
+
+ /* Special handling of class SoapVar */
+ if (data &&
+ Z_TYPE_P(data) == IS_OBJECT &&
+ Z_OBJCE_P(data) == soap_var_class_entry) {
+ zval **ztype, **zdata, **zns, **zstype, **zname, **znamens;
+ encodePtr enc = NULL;
+ HashTable *ht = Z_OBJPROP_P(data);
+
+ if (zend_hash_find(ht, "enc_type", sizeof("enc_type"), (void **)&ztype) == FAILURE) {
+ soap_error0(E_ERROR, "Encoding: SoapVar has no 'enc_type' property");
+ }
+
+ if (zend_hash_find(ht, "enc_stype", sizeof("enc_stype"), (void **)&zstype) == SUCCESS) {
+ if (zend_hash_find(ht, "enc_ns", sizeof("enc_ns"), (void **)&zns) == SUCCESS) {
+ enc = get_encoder(SOAP_GLOBAL(sdl), Z_STRVAL_PP(zns), Z_STRVAL_PP(zstype));
+ } else {
+ zns = NULL;
+ enc = get_encoder_ex(SOAP_GLOBAL(sdl), Z_STRVAL_PP(zstype), Z_STRLEN_PP(zstype));
+ }
+ if (enc == NULL && SOAP_GLOBAL(typemap)) {
+ encodePtr *new_enc;
+ smart_str nscat = {0};
+
+ if (zns != NULL) {
+ smart_str_appendl(&nscat, Z_STRVAL_PP(zns), Z_STRLEN_PP(zns));
+ smart_str_appendc(&nscat, ':');
+ }
+ smart_str_appendl(&nscat, Z_STRVAL_PP(zstype), Z_STRLEN_PP(zstype));
+ smart_str_0(&nscat);
+ if (zend_hash_find(SOAP_GLOBAL(typemap), nscat.c, nscat.len + 1, (void**)&new_enc) == SUCCESS) {
+ enc = *new_enc;
+ }
+ smart_str_free(&nscat);
+ }
+ }
+ if (enc == NULL) {
+ enc = get_conversion(Z_LVAL_P(*ztype));
+ }
+ if (enc == NULL) {
+ enc = encode;
+ }
+
+ if (zend_hash_find(ht, "enc_value", sizeof("enc_value"), (void **)&zdata) == FAILURE) {
+ node = master_to_xml(enc, NULL, style, parent TSRMLS_CC);
+ } else {
+ node = master_to_xml(enc, *zdata, style, parent TSRMLS_CC);
+ }
+
+ if (style == SOAP_ENCODED || (SOAP_GLOBAL(sdl) && encode != enc)) {
+ if (zend_hash_find(ht, "enc_stype", sizeof("enc_stype"), (void **)&zstype) == SUCCESS) {
+ if (zend_hash_find(ht, "enc_ns", sizeof("enc_ns"), (void **)&zns) == SUCCESS) {
+ set_ns_and_type_ex(node, Z_STRVAL_PP(zns), Z_STRVAL_PP(zstype));
+ } else {
+ set_ns_and_type_ex(node, NULL, Z_STRVAL_PP(zstype));
+ }
+ }
+ }
+
+ if (zend_hash_find(ht, "enc_name", sizeof("enc_name"), (void **)&zname) == SUCCESS) {
+ xmlNodeSetName(node, BAD_CAST(Z_STRVAL_PP(zname)));
+ }
+ if (zend_hash_find(ht, "enc_namens", sizeof("enc_namens"), (void **)&znamens) == SUCCESS) {
+ xmlNsPtr nsp = encode_add_ns(node, Z_STRVAL_PP(znamens));
+ xmlSetNs(node, nsp);
+ }
+ } else {
+ if (check_class_map && SOAP_GLOBAL(class_map) && data &&
+ Z_TYPE_P(data) == IS_OBJECT &&
+ !Z_OBJPROP_P(data)->nApplyCount) {
+ zend_class_entry *ce = Z_OBJCE_P(data);
+ HashPosition pos;
+ zval **tmp;
+ char *type_name = NULL;
+ uint type_len;
+ ulong idx;
+
+ for (zend_hash_internal_pointer_reset_ex(SOAP_GLOBAL(class_map), &pos);
+ zend_hash_get_current_data_ex(SOAP_GLOBAL(class_map), (void **) &tmp, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(SOAP_GLOBAL(class_map), &pos)) {
+ if (Z_TYPE_PP(tmp) == IS_STRING &&
+ ce->name_length == Z_STRLEN_PP(tmp) &&
+ zend_binary_strncasecmp(ce->name, ce->name_length, Z_STRVAL_PP(tmp), ce->name_length, ce->name_length) == 0 &&
+ zend_hash_get_current_key_ex(SOAP_GLOBAL(class_map), &type_name, &type_len, &idx, 0, &pos) == HASH_KEY_IS_STRING) {
+
+ /* TODO: namespace isn't stored */
+ encodePtr enc = NULL;
+ if (SOAP_GLOBAL(sdl)) {
+ enc = get_encoder(SOAP_GLOBAL(sdl), SOAP_GLOBAL(sdl)->target_ns, type_name);
+ if (!enc) {
+ enc = find_encoder_by_type_name(SOAP_GLOBAL(sdl), type_name);
+ }
+ }
+ if (enc) {
+ if (encode != enc && style == SOAP_LITERAL) {
+ add_type = 1;
+ }
+ encode = enc;
+ }
+ break;
+ }
+ }
+ }
+
+ if (encode == NULL) {
+ encode = get_conversion(UNKNOWN_TYPE);
+ }
+ if (SOAP_GLOBAL(typemap) && encode->details.type_str) {
+ smart_str nscat = {0};
+ encodePtr *new_enc;
+
+ if (encode->details.ns) {
+ smart_str_appends(&nscat, encode->details.ns);
+ smart_str_appendc(&nscat, ':');
+ }
+ smart_str_appends(&nscat, encode->details.type_str);
+ smart_str_0(&nscat);
+ if (zend_hash_find(SOAP_GLOBAL(typemap), nscat.c, nscat.len + 1, (void**)&new_enc) == SUCCESS) {
+ encode = *new_enc;
+ }
+ smart_str_free(&nscat);
+ }
+ if (encode->to_xml) {
+ node = encode->to_xml(&encode->details, data, style, parent TSRMLS_CC);
+ if (add_type) {
+ set_ns_and_type(node, &encode->details);
+ }
+ }
+ }
+ return node;
+}
+
+xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ return master_to_xml_int(encode, data, style, parent, 1 TSRMLS_CC);
+}
+
+static zval *master_to_zval_int(encodePtr encode, xmlNodePtr data TSRMLS_DC)
+{
+ zval *ret = NULL;
+
+ if (SOAP_GLOBAL(typemap)) {
+ if (encode->details.type_str) {
+ smart_str nscat = {0};
+ encodePtr *new_enc;
+
+ if (encode->details.ns) {
+ smart_str_appends(&nscat, encode->details.ns);
+ smart_str_appendc(&nscat, ':');
+ }
+ smart_str_appends(&nscat, encode->details.type_str);
+ smart_str_0(&nscat);
+ if (zend_hash_find(SOAP_GLOBAL(typemap), nscat.c, nscat.len + 1, (void**)&new_enc) == SUCCESS) {
+ encode = *new_enc;
+ }
+ smart_str_free(&nscat);
+ } else {
+ xmlAttrPtr type_attr = get_attribute_ex(data->properties,"type", XSI_NAMESPACE);
+
+ if (type_attr != NULL) {
+ encodePtr *new_enc;
+ xmlNsPtr nsptr;
+ char *ns, *cptype;
+ smart_str nscat = {0};
+
+ parse_namespace(type_attr->children->content, &cptype, &ns);
+ nsptr = xmlSearchNs(data->doc, data, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ smart_str_appends(&nscat, (char*)nsptr->href);
+ smart_str_appendc(&nscat, ':');
+ }
+ smart_str_appends(&nscat, cptype);
+ smart_str_0(&nscat);
+ efree(cptype);
+ if (ns) {efree(ns);}
+ if (zend_hash_find(SOAP_GLOBAL(typemap), nscat.c, nscat.len + 1, (void**)&new_enc) == SUCCESS) {
+ encode = *new_enc;
+ }
+ smart_str_free(&nscat);
+ }
+ }
+ }
+ if (encode->to_zval) {
+ ret = encode->to_zval(&encode->details, data TSRMLS_CC);
+ }
+ return ret;
+}
+
+zval *master_to_zval(encodePtr encode, xmlNodePtr data TSRMLS_DC)
+{
+ data = check_and_resolve_href(data);
+
+ if (encode == NULL) {
+ encode = get_conversion(UNKNOWN_TYPE);
+ } else {
+ /* Use xsi:type if it is defined */
+ xmlAttrPtr type_attr = get_attribute_ex(data->properties,"type", XSI_NAMESPACE);
+
+ if (type_attr != NULL) {
+ encodePtr enc = get_encoder_from_prefix(SOAP_GLOBAL(sdl), data, type_attr->children->content);
+
+ if (enc != NULL && enc != encode) {
+ encodePtr tmp = enc;
+ while (tmp &&
+ tmp->details.sdl_type != NULL &&
+ tmp->details.sdl_type->kind != XSD_TYPEKIND_COMPLEX) {
+ if (enc == tmp->details.sdl_type->encode ||
+ tmp == tmp->details.sdl_type->encode) {
+ enc = NULL;
+ break;
+ }
+ tmp = tmp->details.sdl_type->encode;
+ }
+ if (enc != NULL) {
+ encode = enc;
+ }
+ }
+ }
+ }
+ return master_to_zval_int(encode, data TSRMLS_CC);
+}
+
+xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ xmlNodePtr ret = NULL;
+ zval *return_value;
+
+ if (type && type->map && type->map->to_xml) {
+ MAKE_STD_ZVAL(return_value);
+
+ if (call_user_function(EG(function_table), NULL, type->map->to_xml, return_value, 1, &data TSRMLS_CC) == FAILURE) {
+ soap_error0(E_ERROR, "Encoding: Error calling to_xml callback");
+ }
+ if (Z_TYPE_P(return_value) == IS_STRING) {
+ xmlDocPtr doc = soap_xmlParseMemory(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value));
+ if (doc && doc->children) {
+ ret = xmlDocCopyNode(doc->children, parent->doc, 1);
+ }
+ xmlFreeDoc(doc);
+ }
+
+ zval_ptr_dtor(&return_value);
+ }
+ if (!ret) {
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ }
+ xmlAddChild(parent, ret);
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(ret, type);
+ }
+ return ret;
+}
+
+zval *to_zval_user(encodeTypePtr type, xmlNodePtr node TSRMLS_DC)
+{
+ zval *return_value;
+
+ if (type && type->map && type->map->to_zval) {
+ xmlBufferPtr buf;
+ zval *data;
+ xmlNodePtr copy;
+
+ copy = xmlCopyNode(node, 1);
+ buf = xmlBufferCreate();
+ xmlNodeDump(buf, NULL, copy, 0, 0);
+ MAKE_STD_ZVAL(data);
+ ZVAL_STRING(data, (char*)xmlBufferContent(buf), 1);
+ xmlBufferFree(buf);
+ xmlFreeNode(copy);
+
+ ALLOC_INIT_ZVAL(return_value);
+
+ if (call_user_function(EG(function_table), NULL, type->map->to_zval, return_value, 1, &data TSRMLS_CC) == FAILURE) {
+ soap_error0(E_ERROR, "Encoding: Error calling from_xml callback");
+ }
+ zval_ptr_dtor(&data);
+ } else {
+ ALLOC_INIT_ZVAL(return_value);
+ }
+ return return_value;
+}
+
+/* TODO: get rid of "bogus".. ither by passing in the already created xmlnode or passing in the node name */
+/* String encode/decode */
+static zval *to_zval_string(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ zval *ret;
+ MAKE_STD_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+ if (data && data->children) {
+ if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
+ if (SOAP_GLOBAL(encoding) != NULL) {
+ xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, xmlStrlen(data->children->content));
+ xmlBufferPtr out = xmlBufferCreate();
+ int n = xmlCharEncOutFunc(SOAP_GLOBAL(encoding), out, in);
+
+ if (n >= 0) {
+ ZVAL_STRING(ret, (char*)xmlBufferContent(out), 1);
+ } else {
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
+ }
+ xmlBufferFree(out);
+ xmlBufferFree(in);
+ } else {
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
+ }
+ } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
+ } else {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ } else {
+ ZVAL_EMPTY_STRING(ret);
+ }
+ return ret;
+}
+
+static zval *to_zval_stringr(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ zval *ret;
+ MAKE_STD_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+ if (data && data->children) {
+ if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
+ whiteSpace_replace(data->children->content);
+ if (SOAP_GLOBAL(encoding) != NULL) {
+ xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, xmlStrlen(data->children->content));
+ xmlBufferPtr out = xmlBufferCreate();
+ int n = xmlCharEncOutFunc(SOAP_GLOBAL(encoding), out, in);
+
+ if (n >= 0) {
+ ZVAL_STRING(ret, (char*)xmlBufferContent(out), 1);
+ } else {
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
+ }
+ xmlBufferFree(out);
+ xmlBufferFree(in);
+ } else {
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
+ }
+ } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
+ } else {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ } else {
+ ZVAL_EMPTY_STRING(ret);
+ }
+ return ret;
+}
+
+static zval *to_zval_stringc(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ zval *ret;
+ MAKE_STD_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+ if (data && data->children) {
+ if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
+ whiteSpace_collapse(data->children->content);
+ if (SOAP_GLOBAL(encoding) != NULL) {
+ xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, xmlStrlen(data->children->content));
+ xmlBufferPtr out = xmlBufferCreate();
+ int n = xmlCharEncOutFunc(SOAP_GLOBAL(encoding), out, in);
+
+ if (n >= 0) {
+ ZVAL_STRING(ret, (char*)xmlBufferContent(out), 1);
+ } else {
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
+ }
+ xmlBufferFree(out);
+ xmlBufferFree(in);
+ } else {
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
+ }
+ } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
+ } else {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ } else {
+ ZVAL_EMPTY_STRING(ret);
+ }
+ return ret;
+}
+
+static zval *to_zval_base64(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ zval *ret;
+ char *str;
+ int str_len;
+
+ MAKE_STD_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+ if (data && data->children) {
+ if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
+ whiteSpace_collapse(data->children->content);
+ str = (char*)php_base64_decode(data->children->content, strlen((char*)data->children->content), &str_len);
+ if (!str) {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ ZVAL_STRINGL(ret, str, str_len, 0);
+ } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
+ str = (char*)php_base64_decode(data->children->content, strlen((char*)data->children->content), &str_len);
+ if (!str) {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ ZVAL_STRINGL(ret, str, str_len, 0);
+ } else {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ } else {
+ ZVAL_EMPTY_STRING(ret);
+ }
+ return ret;
+}
+
+static zval *to_zval_hexbin(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ zval *ret;
+ unsigned char *str;
+ int str_len, i, j;
+ unsigned char c;
+
+ MAKE_STD_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+ if (data && data->children) {
+ if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
+ whiteSpace_collapse(data->children->content);
+ } else if (data->children->type != XML_CDATA_SECTION_NODE || data->children->next != NULL) {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ return ret;
+ }
+ str_len = strlen((char*)data->children->content) / 2;
+ str = emalloc(str_len+1);
+ for (i = j = 0; i < str_len; i++) {
+ c = data->children->content[j++];
+ if (c >= '0' && c <= '9') {
+ str[i] = (c - '0') << 4;
+ } else if (c >= 'a' && c <= 'f') {
+ str[i] = (c - 'a' + 10) << 4;
+ } else if (c >= 'A' && c <= 'F') {
+ str[i] = (c - 'A' + 10) << 4;
+ } else {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ c = data->children->content[j++];
+ if (c >= '0' && c <= '9') {
+ str[i] |= c - '0';
+ } else if (c >= 'a' && c <= 'f') {
+ str[i] |= c - 'a' + 10;
+ } else if (c >= 'A' && c <= 'F') {
+ str[i] |= c - 'A' + 10;
+ } else {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ }
+ str[str_len] = '\0';
+ ZVAL_STRINGL(ret, (char*)str, str_len, 0);
+ } else {
+ ZVAL_EMPTY_STRING(ret);
+ }
+ return ret;
+}
+
+static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ xmlNodePtr ret, text;
+ char *str;
+ int new_len;
+
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, ret);
+ FIND_ZVAL_NULL(data, ret, style);
+
+ if (Z_TYPE_P(data) == IS_STRING) {
+ str = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data));
+ new_len = Z_STRLEN_P(data);
+ } else {
+ zval tmp = *data;
+
+ zval_copy_ctor(&tmp);
+ convert_to_string(&tmp);
+ str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
+ new_len = Z_STRLEN(tmp);
+ zval_dtor(&tmp);
+ }
+
+ if (SOAP_GLOBAL(encoding) != NULL) {
+ xmlBufferPtr in = xmlBufferCreateStatic(str, new_len);
+ xmlBufferPtr out = xmlBufferCreate();
+ int n = xmlCharEncInFunc(SOAP_GLOBAL(encoding), out, in);
+
+ if (n >= 0) {
+ efree(str);
+ str = estrdup((char*)xmlBufferContent(out));
+ new_len = n;
+ }
+ xmlBufferFree(out);
+ xmlBufferFree(in);
+ }
+
+ if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) {
+ char *err = emalloc(new_len + 8);
+ char c;
+ int i;
+
+ memcpy(err, str, new_len+1);
+ for (i = 0; (c = err[i++]);) {
+ if ((c & 0x80) == 0) {
+ } else if ((c & 0xe0) == 0xc0) {
+ if ((err[i] & 0xc0) != 0x80) {
+ break;
+ }
+ i++;
+ } else if ((c & 0xf0) == 0xe0) {
+ if ((err[i] & 0xc0) != 0x80 || (err[i+1] & 0xc0) != 0x80) {
+ break;
+ }
+ i += 2;
+ } else if ((c & 0xf8) == 0xf0) {
+ if ((err[i] & 0xc0) != 0x80 || (err[i+1] & 0xc0) != 0x80 || (err[i+2] & 0xc0) != 0x80) {
+ break;
+ }
+ i += 3;
+ } else {
+ break;
+ }
+ }
+ if (c) {
+ err[i-1] = '\\';
+ err[i++] = 'x';
+ err[i++] = ((unsigned char)c >> 4) + ((((unsigned char)c >> 4) > 9) ? ('a' - 10) : '0');
+ err[i++] = (c & 15) + (((c & 15) > 9) ? ('a' - 10) : '0');
+ err[i++] = '.';
+ err[i++] = '.';
+ err[i++] = '.';
+ err[i++] = 0;
+ }
+
+ soap_error1(E_ERROR, "Encoding: string '%s' is not a valid utf-8 string", err);
+ }
+
+ text = xmlNewTextLen(BAD_CAST(str), new_len);
+ xmlAddChild(ret, text);
+ efree(str);
+
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(ret, type);
+ }
+ return ret;
+}
+
+static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ xmlNodePtr ret, text;
+ unsigned char *str;
+ int str_len;
+
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, ret);
+ FIND_ZVAL_NULL(data, ret, style);
+
+ if (Z_TYPE_P(data) == IS_STRING) {
+ str = php_base64_encode((unsigned char*)Z_STRVAL_P(data), Z_STRLEN_P(data), &str_len);
+ text = xmlNewTextLen(str, str_len);
+ xmlAddChild(ret, text);
+ efree(str);
+ } else {
+ zval tmp = *data;
+
+ zval_copy_ctor(&tmp);
+ convert_to_string(&tmp);
+ str = php_base64_encode((unsigned char*)Z_STRVAL(tmp), Z_STRLEN(tmp), &str_len);
+ text = xmlNewTextLen(str, str_len);
+ xmlAddChild(ret, text);
+ efree(str);
+ zval_dtor(&tmp);
+ }
+
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(ret, type);
+ }
+ return ret;
+}
+
+static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ static char hexconvtab[] = "0123456789ABCDEF";
+ xmlNodePtr ret, text;
+ unsigned char *str;
+ zval tmp;
+ int i, j;
+
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, ret);
+ FIND_ZVAL_NULL(data, ret, style);
+
+ if (Z_TYPE_P(data) != IS_STRING) {
+ tmp = *data;
+ zval_copy_ctor(&tmp);
+ convert_to_string(&tmp);
+ data = &tmp;
+ }
+ str = (unsigned char *) safe_emalloc(Z_STRLEN_P(data) * 2, sizeof(char), 1);
+
+ for (i = j = 0; i < Z_STRLEN_P(data); i++) {
+ str[j++] = hexconvtab[((unsigned char)Z_STRVAL_P(data)[i]) >> 4];
+ str[j++] = hexconvtab[((unsigned char)Z_STRVAL_P(data)[i]) & 15];
+ }
+ str[j] = '\0';
+
+ text = xmlNewTextLen(str, Z_STRLEN_P(data) * 2 * sizeof(char));
+ xmlAddChild(ret, text);
+ efree(str);
+ if (data == &tmp) {
+ zval_dtor(&tmp);
+ }
+
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(ret, type);
+ }
+ return ret;
+}
+
+static zval *to_zval_double(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ zval *ret;
+ MAKE_STD_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+
+ if (data && data->children) {
+ if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
+ long lval;
+ double dval;
+
+ whiteSpace_collapse(data->children->content);
+ switch (is_numeric_string((char*)data->children->content, strlen((char*)data->children->content), &lval, &dval, 0)) {
+ case IS_LONG:
+ Z_TYPE_P(ret) = IS_DOUBLE;
+ Z_DVAL_P(ret) = lval;
+ break;
+ case IS_DOUBLE:
+ Z_TYPE_P(ret) = IS_DOUBLE;
+ Z_DVAL_P(ret) = dval;
+ break;
+ default:
+ if (strncasecmp((char*)data->children->content, "NaN", sizeof("NaN")-1) == 0) {
+ ZVAL_DOUBLE(ret, php_get_nan());
+ } else if (strncasecmp((char*)data->children->content, "INF", sizeof("INF")-1) == 0) {
+ ZVAL_DOUBLE(ret, php_get_inf());
+ } else if (strncasecmp((char*)data->children->content, "-INF", sizeof("-INF")-1) == 0) {
+ ZVAL_DOUBLE(ret, -php_get_inf());
+ } else {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ }
+ } else {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ } else {
+ ZVAL_NULL(ret);
+ }
+ return ret;
+}
+
+static zval *to_zval_long(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ zval *ret;
+ MAKE_STD_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+
+ if (data && data->children) {
+ if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
+ long lval;
+ double dval;
+
+ whiteSpace_collapse(data->children->content);
+ errno = 0;
+
+ switch ((Z_TYPE_P(ret) = is_numeric_string((char*)data->children->content, strlen((char*)data->children->content), &lval, &dval, 0))) {
+ case IS_LONG:
+ Z_LVAL_P(ret) = lval;
+ break;
+ case IS_DOUBLE:
+ Z_DVAL_P(ret) = dval;
+ break;
+ default:
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ } else {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ } else {
+ ZVAL_NULL(ret);
+ }
+ return ret;
+}
+
+static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ xmlNodePtr ret;
+
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, ret);
+ FIND_ZVAL_NULL(data, ret, style);
+
+ if (Z_TYPE_P(data) == IS_DOUBLE) {
+ char s[256];
+
+ snprintf(s, sizeof(s), "%0.0F",floor(Z_DVAL_P(data)));
+ xmlNodeSetContent(ret, BAD_CAST(s));
+ } else {
+ zval tmp = *data;
+
+ zval_copy_ctor(&tmp);
+ if (Z_TYPE(tmp) != IS_LONG) {
+ convert_to_long(&tmp);
+ }
+ convert_to_string(&tmp);
+ xmlNodeSetContentLen(ret, BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp));
+ zval_dtor(&tmp);
+ }
+
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(ret, type);
+ }
+ return ret;
+}
+
+static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ xmlNodePtr ret;
+ zval tmp;
+ char *str;
+
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, ret);
+ FIND_ZVAL_NULL(data, ret, style);
+
+ tmp = *data;
+ if (Z_TYPE(tmp) != IS_DOUBLE) {
+ zval_copy_ctor(&tmp);
+ convert_to_double(&tmp);
+ }
+
+ str = (char *) safe_emalloc(EG(precision), 1, MAX_LENGTH_OF_DOUBLE + 1);
+ php_gcvt(Z_DVAL(tmp), EG(precision), '.', 'E', str);
+ xmlNodeSetContentLen(ret, BAD_CAST(str), strlen(str));
+ efree(str);
+
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(ret, type);
+ }
+ return ret;
+}
+
+static zval *to_zval_bool(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ zval *ret;
+ MAKE_STD_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+
+ if (data && data->children) {
+ if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
+ whiteSpace_collapse(data->children->content);
+ if (stricmp((char*)data->children->content, "true") == 0 ||
+ stricmp((char*)data->children->content, "t") == 0 ||
+ strcmp((char*)data->children->content, "1") == 0) {
+ ZVAL_BOOL(ret, 1);
+ } else if (stricmp((char*)data->children->content, "false") == 0 ||
+ stricmp((char*)data->children->content, "f") == 0 ||
+ strcmp((char*)data->children->content, "0") == 0) {
+ ZVAL_BOOL(ret, 0);
+ } else {
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
+ convert_to_boolean(ret);
+ }
+ } else {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ } else {
+ ZVAL_NULL(ret);
+ }
+ return ret;
+}
+
+static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ xmlNodePtr ret;
+
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, ret);
+ FIND_ZVAL_NULL(data, ret, style);
+
+ if (zend_is_true(data)) {
+ xmlNodeSetContent(ret, BAD_CAST("true"));
+ } else {
+ xmlNodeSetContent(ret, BAD_CAST("false"));
+ }
+
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(ret, type);
+ }
+ return ret;
+}
+
+/* Null encode/decode */
+static zval *to_zval_null(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ zval *ret;
+ MAKE_STD_ZVAL(ret);
+ ZVAL_NULL(ret);
+ return ret;
+}
+
+static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ xmlNodePtr ret;
+
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, ret);
+ if (style == SOAP_ENCODED) {
+ set_xsi_nil(ret);
+ }
+ return ret;
+}
+
+static void set_zval_property(zval* object, char* name, zval* val TSRMLS_DC)
+{
+ zend_class_entry *old_scope;
+
+ old_scope = EG(scope);
+ EG(scope) = Z_OBJCE_P(object);
+ Z_DELREF_P(val);
+ add_property_zval(object, name, val);
+ EG(scope) = old_scope;
+}
+
+static zval* get_zval_property(zval* object, char* name TSRMLS_DC)
+{
+ if (Z_TYPE_P(object) == IS_OBJECT) {
+ zval member;
+ zval *data;
+ zend_class_entry *old_scope;
+
+ INIT_PZVAL(&member);
+ ZVAL_STRING(&member, name, 0);
+ old_scope = EG(scope);
+ EG(scope) = Z_OBJCE_P(object);
+ data = Z_OBJ_HT_P(object)->read_property(object, &member, BP_VAR_IS, 0 TSRMLS_CC);
+ if (data == EG(uninitialized_zval_ptr)) {
+ /* Hack for bug #32455 */
+ zend_property_info *property_info;
+
+ property_info = zend_get_property_info(Z_OBJCE_P(object), &member, 1 TSRMLS_CC);
+ EG(scope) = old_scope;
+ if (property_info && zend_hash_quick_exists(Z_OBJPROP_P(object), property_info->name, property_info->name_length+1, property_info->h)) {
+ return data;
+ }
+ return NULL;
+ }
+ EG(scope) = old_scope;
+ return data;
+ } else if (Z_TYPE_P(object) == IS_ARRAY) {
+ zval **data_ptr;
+
+ if (zend_hash_find(Z_ARRVAL_P(object), name, strlen(name)+1, (void**)&data_ptr) == SUCCESS) {
+ return *data_ptr;
+ }
+ }
+ return NULL;
+}
+
+static void unset_zval_property(zval* object, char* name TSRMLS_DC)
+{
+ if (Z_TYPE_P(object) == IS_OBJECT) {
+ zval member;
+ zend_class_entry *old_scope;
+
+ INIT_PZVAL(&member);
+ ZVAL_STRING(&member, name, 0);
+ old_scope = EG(scope);
+ EG(scope) = Z_OBJCE_P(object);
+ Z_OBJ_HT_P(object)->unset_property(object, &member, 0 TSRMLS_CC);
+ EG(scope) = old_scope;
+ } else if (Z_TYPE_P(object) == IS_ARRAY) {
+ zend_hash_del(Z_ARRVAL_P(object), name, strlen(name)+1);
+ }
+}
+
+static void model_to_zval_any(zval *ret, xmlNodePtr node TSRMLS_DC)
+{
+ zval* any = NULL;
+ char* name = NULL;
+
+ while (node != NULL) {
+ if (get_zval_property(ret, (char*)node->name TSRMLS_CC) == NULL) {
+ zval* val = master_to_zval(get_conversion(XSD_ANYXML), node TSRMLS_CC);
+
+ if (any && Z_TYPE_P(any) != IS_ARRAY) {
+ /* Convert into array */
+ zval *arr;
+
+ MAKE_STD_ZVAL(arr);
+ array_init(arr);
+ if (name) {
+ add_assoc_zval(arr, name, any);
+ } else {
+ add_next_index_zval(arr, any);
+ }
+ any = arr;
+ }
+
+ if (Z_TYPE_P(val) == IS_STRING && *Z_STRVAL_P(val) == '<') {
+ name = NULL;
+ while (node->next != NULL) {
+ zval* val2 = master_to_zval(get_conversion(XSD_ANYXML), node->next TSRMLS_CC);
+ if (Z_TYPE_P(val2) != IS_STRING || *Z_STRVAL_P(val) != '<') {
+ break;
+ }
+ add_string_to_string(val, val, val2);
+ zval_ptr_dtor(&val2);
+ node = node->next;
+ }
+ } else {
+ name = (char*)node->name;
+ }
+
+ if (any == NULL) {
+ if (name) {
+ /* Convert into array */
+ zval *arr;
+
+ MAKE_STD_ZVAL(arr);
+ array_init(arr);
+ add_assoc_zval(arr, name, val);
+ any = arr;
+ name = NULL;
+ } else {
+ any = val;
+ }
+ } else {
+ /* Add array element */
+ if (name) {
+ zval **el;
+ if (zend_hash_find(Z_ARRVAL_P(any), name, strlen(name)+1, (void**)&el) == SUCCESS) {
+ if (Z_TYPE_PP(el) != IS_ARRAY) {
+ /* Convert into array */
+ zval *arr;
+
+ MAKE_STD_ZVAL(arr);
+ array_init(arr);
+ add_next_index_zval(arr, *el);
+ *el = arr;
+ }
+ add_next_index_zval(*el, val);
+ } else {
+ add_assoc_zval(any, name, val);
+ }
+ } else {
+ add_next_index_zval(any, val);
+ }
+ name = NULL;
+ }
+ }
+ node = node->next;
+ }
+ if (any) {
+ set_zval_property(ret, name ? name : "any", any TSRMLS_CC);
+ }
+}
+
+static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr data, sdlPtr sdl TSRMLS_DC)
+{
+ switch (model->kind) {
+ case XSD_CONTENT_ELEMENT:
+ if (model->u.element->name) {
+ xmlNodePtr node = get_node(data->children, model->u.element->name);
+
+ if (node) {
+ zval *val;
+ xmlNodePtr r_node;
+
+ r_node = check_and_resolve_href(node);
+ if (r_node && r_node->children && r_node->children->content) {
+ if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)r_node->children->content) != 0) {
+ soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, r_node->children->content);
+ }
+ val = master_to_zval(model->u.element->encode, r_node TSRMLS_CC);
+ } else if (model->u.element->fixed) {
+ xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlNodeSetContent(dummy, BAD_CAST(model->u.element->fixed));
+ val = master_to_zval(model->u.element->encode, dummy TSRMLS_CC);
+ xmlFreeNode(dummy);
+ } else if (model->u.element->def && !model->u.element->nillable) {
+ xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlNodeSetContent(dummy, BAD_CAST(model->u.element->def));
+ val = master_to_zval(model->u.element->encode, dummy TSRMLS_CC);
+ xmlFreeNode(dummy);
+ } else {
+ val = master_to_zval(model->u.element->encode, r_node TSRMLS_CC);
+ }
+ if ((node = get_node(node->next, model->u.element->name)) != NULL) {
+ zval *array;
+
+ MAKE_STD_ZVAL(array);
+ array_init(array);
+ add_next_index_zval(array, val);
+ do {
+ if (node && node->children && node->children->content) {
+ if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)node->children->content) != 0) {
+ soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, node->children->content);
+ }
+ val = master_to_zval(model->u.element->encode, node TSRMLS_CC);
+ } else if (model->u.element->fixed) {
+ xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlNodeSetContent(dummy, BAD_CAST(model->u.element->fixed));
+ val = master_to_zval(model->u.element->encode, dummy TSRMLS_CC);
+ xmlFreeNode(dummy);
+ } else if (model->u.element->def && !model->u.element->nillable) {
+ xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlNodeSetContent(dummy, BAD_CAST(model->u.element->def));
+ val = master_to_zval(model->u.element->encode, dummy TSRMLS_CC);
+ xmlFreeNode(dummy);
+ } else {
+ val = master_to_zval(model->u.element->encode, node TSRMLS_CC);
+ }
+ add_next_index_zval(array, val);
+ } while ((node = get_node(node->next, model->u.element->name)) != NULL);
+ val = array;
+ } else if ((Z_TYPE_P(val) != IS_NULL || !model->u.element->nillable) &&
+ (SOAP_GLOBAL(features) & SOAP_SINGLE_ELEMENT_ARRAYS) &&
+ (model->max_occurs == -1 || model->max_occurs > 1)) {
+ zval *array;
+
+ MAKE_STD_ZVAL(array);
+ array_init(array);
+ add_next_index_zval(array, val);
+ val = array;
+ }
+ set_zval_property(ret, model->u.element->name, val TSRMLS_CC);
+ }
+ }
+ break;
+ case XSD_CONTENT_ALL:
+ case XSD_CONTENT_SEQUENCE:
+ case XSD_CONTENT_CHOICE: {
+ sdlContentModelPtr *tmp;
+ HashPosition pos;
+ sdlContentModelPtr any = NULL;
+
+ zend_hash_internal_pointer_reset_ex(model->u.content, &pos);
+ while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) {
+ if ((*tmp)->kind == XSD_CONTENT_ANY) {
+ any = *tmp;
+ } else {
+ model_to_zval_object(ret, *tmp, data, sdl TSRMLS_CC);
+ }
+ zend_hash_move_forward_ex(model->u.content, &pos);
+ }
+ if (any) {
+ model_to_zval_any(ret, data->children TSRMLS_CC);
+ }
+ break;
+ }
+ case XSD_CONTENT_GROUP:
+ model_to_zval_object(ret, model->u.group->model, data, sdl TSRMLS_CC);
+ break;
+ default:
+ break;
+ }
+}
+
+/* Struct encode/decode */
+static zval *to_zval_object_ex(encodeTypePtr type, xmlNodePtr data, zend_class_entry *pce TSRMLS_DC)
+{
+ zval *ret;
+ xmlNodePtr trav;
+ sdlPtr sdl;
+ sdlTypePtr sdlType = type->sdl_type;
+ zend_class_entry *ce = ZEND_STANDARD_CLASS_DEF_PTR;
+ zval *redo_any = NULL;
+
+ if (pce) {
+ ce = pce;
+ } else if (SOAP_GLOBAL(class_map) && type->type_str) {
+ zval **classname;
+ zend_class_entry *tmp;
+
+ if (zend_hash_find(SOAP_GLOBAL(class_map), type->type_str, strlen(type->type_str)+1, (void**)&classname) == SUCCESS &&
+ Z_TYPE_PP(classname) == IS_STRING &&
+ (tmp = zend_fetch_class(Z_STRVAL_PP(classname), Z_STRLEN_PP(classname), ZEND_FETCH_CLASS_AUTO TSRMLS_CC)) != NULL) {
+ ce = tmp;
+ }
+ }
+ sdl = SOAP_GLOBAL(sdl);
+ if (sdlType) {
+ if (sdlType->kind == XSD_TYPEKIND_RESTRICTION &&
+ sdlType->encode && type != &sdlType->encode->details) {
+ encodePtr enc;
+
+ enc = sdlType->encode;
+ while (enc && enc->details.sdl_type &&
+ enc->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE &&
+ enc->details.sdl_type->kind != XSD_TYPEKIND_LIST &&
+ enc->details.sdl_type->kind != XSD_TYPEKIND_UNION) {
+ enc = enc->details.sdl_type->encode;
+ }
+ if (enc) {
+ zval *base;
+
+ ALLOC_INIT_ZVAL(ret);
+ if (soap_check_xml_ref(&ret, data TSRMLS_CC)) {
+ return ret;
+ }
+
+ object_init_ex(ret, ce);
+ base = master_to_zval_int(enc, data TSRMLS_CC);
+ set_zval_property(ret, "_", base TSRMLS_CC);
+ } else {
+ ALLOC_INIT_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+ if (soap_check_xml_ref(&ret, data TSRMLS_CC)) {
+ return ret;
+ }
+ object_init_ex(ret, ce);
+ }
+ } else if (sdlType->kind == XSD_TYPEKIND_EXTENSION &&
+ sdlType->encode &&
+ type != &sdlType->encode->details) {
+ if (sdlType->encode->details.sdl_type &&
+ sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE &&
+ sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_LIST &&
+ sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_UNION) {
+
+ CHECK_XML_NULL(data);
+ if ((ret = soap_find_xml_ref(data TSRMLS_CC)) != NULL) {
+ return ret;
+ }
+
+ if (ce != ZEND_STANDARD_CLASS_DEF_PTR &&
+ sdlType->encode->to_zval == sdl_guess_convert_zval &&
+ sdlType->encode->details.sdl_type != NULL &&
+ (sdlType->encode->details.sdl_type->kind == XSD_TYPEKIND_COMPLEX ||
+ sdlType->encode->details.sdl_type->kind == XSD_TYPEKIND_RESTRICTION ||
+ sdlType->encode->details.sdl_type->kind == XSD_TYPEKIND_EXTENSION) &&
+ (sdlType->encode->details.sdl_type->encode == NULL ||
+ (sdlType->encode->details.sdl_type->encode->details.type != IS_ARRAY &&
+ sdlType->encode->details.sdl_type->encode->details.type != SOAP_ENC_ARRAY))) {
+ ret = to_zval_object_ex(&sdlType->encode->details, data, ce TSRMLS_CC);
+ } else {
+ ret = master_to_zval_int(sdlType->encode, data TSRMLS_CC);
+ }
+ if (soap_check_xml_ref(&ret, data TSRMLS_CC)) {
+ return ret;
+ }
+ redo_any = get_zval_property(ret, "any" TSRMLS_CC);
+ if (Z_TYPE_P(ret) == IS_OBJECT && ce != ZEND_STANDARD_CLASS_DEF_PTR) {
+ zend_object *zobj = zend_objects_get_address(ret TSRMLS_CC);
+ zobj->ce = ce;
+ }
+ } else {
+ zval *base;
+
+ ALLOC_INIT_ZVAL(ret);
+ if (soap_check_xml_ref(&ret, data TSRMLS_CC)) {
+ return ret;
+ }
+
+ object_init_ex(ret, ce);
+ base = master_to_zval_int(sdlType->encode, data TSRMLS_CC);
+ set_zval_property(ret, "_", base TSRMLS_CC);
+ }
+ } else {
+ ALLOC_INIT_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+ if (soap_check_xml_ref(&ret, data TSRMLS_CC)) {
+ return ret;
+ }
+ object_init_ex(ret, ce);
+ }
+ if (sdlType->model) {
+ if (redo_any) {
+ Z_ADDREF_P(redo_any);
+ unset_zval_property(ret, "any" TSRMLS_CC);
+ }
+ model_to_zval_object(ret, sdlType->model, data, sdl TSRMLS_CC);
+ if (redo_any) {
+ zval *tmp = get_zval_property(ret, "any" TSRMLS_CC);
+
+ if (tmp == NULL) {
+ model_to_zval_any(ret, data->children TSRMLS_CC);
+ } else if (Z_REFCOUNT_P(tmp) == 0) {
+ zval_dtor(tmp);
+ efree(tmp);
+ }
+ zval_ptr_dtor(&redo_any);
+ }
+ }
+ if (sdlType->attributes) {
+ sdlAttributePtr *attr;
+ HashPosition pos;
+
+ zend_hash_internal_pointer_reset_ex(sdlType->attributes, &pos);
+ while (zend_hash_get_current_data_ex(sdlType->attributes, (void**)&attr, &pos) == SUCCESS) {
+ if ((*attr)->name) {
+ xmlAttrPtr val = get_attribute(data->properties, (*attr)->name);
+ char *str_val = NULL;
+
+ if (val && val->children && val->children->content) {
+ str_val = (char*)val->children->content;
+ if ((*attr)->fixed && strcmp((*attr)->fixed, str_val) != 0) {
+ soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", (*attr)->name, (*attr)->fixed, str_val);
+ }
+ } else if ((*attr)->fixed) {
+ str_val = (*attr)->fixed;
+ } else if ((*attr)->def) {
+ str_val = (*attr)->def;
+ }
+ if (str_val) {
+ xmlNodePtr dummy, text;
+ zval *data;
+
+ dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ text = xmlNewText(BAD_CAST(str_val));
+ xmlAddChild(dummy, text);
+ data = master_to_zval((*attr)->encode, dummy TSRMLS_CC);
+ xmlFreeNode(dummy);
+ set_zval_property(ret, (*attr)->name, data TSRMLS_CC);
+ }
+ }
+ zend_hash_move_forward_ex(sdlType->attributes, &pos);
+ }
+ }
+ } else {
+
+ ALLOC_INIT_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+ if (soap_check_xml_ref(&ret, data TSRMLS_CC)) {
+ return ret;
+ }
+
+ object_init_ex(ret, ce);
+ trav = data->children;
+
+ while (trav != NULL) {
+ if (trav->type == XML_ELEMENT_NODE) {
+ zval *tmpVal;
+ zval *prop;
+
+ tmpVal = master_to_zval(NULL, trav TSRMLS_CC);
+
+ prop = get_zval_property(ret, (char*)trav->name TSRMLS_CC);
+ if (!prop) {
+ if (!trav->next || !get_node(trav->next, (char*)trav->name)) {
+ set_zval_property(ret, (char*)trav->name, tmpVal TSRMLS_CC);
+ } else {
+ zval *arr;
+
+ MAKE_STD_ZVAL(arr);
+ array_init(arr);
+ add_next_index_zval(arr, tmpVal);
+ set_zval_property(ret, (char*)trav->name, arr TSRMLS_CC);
+ }
+ } else {
+ /* Property already exist - make array */
+ if (Z_TYPE_P(prop) != IS_ARRAY) {
+ /* Convert into array */
+ zval *arr;
+
+ MAKE_STD_ZVAL(arr);
+ array_init(arr);
+ Z_ADDREF_P(prop);
+ add_next_index_zval(arr, prop);
+ set_zval_property(ret, (char*)trav->name, arr TSRMLS_CC);
+ prop = arr;
+ }
+ /* Add array element */
+ add_next_index_zval(prop, tmpVal);
+ }
+ }
+ trav = trav->next;
+ }
+ }
+ return ret;
+}
+
+static zval *to_zval_object(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ return to_zval_object_ex(type, data, NULL TSRMLS_CC);
+}
+
+
+static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *object, int style, int strict TSRMLS_DC)
+{
+ switch (model->kind) {
+ case XSD_CONTENT_ELEMENT: {
+ zval *data;
+ xmlNodePtr property;
+ encodePtr enc;
+
+ data = get_zval_property(object, model->u.element->name TSRMLS_CC);
+ if (data &&
+ Z_TYPE_P(data) == IS_NULL &&
+ !model->u.element->nillable &&
+ model->min_occurs > 0 &&
+ !strict) {
+ return 0;
+ }
+ if (data) {
+ enc = model->u.element->encode;
+ if ((model->max_occurs == -1 || model->max_occurs > 1) &&
+ Z_TYPE_P(data) == IS_ARRAY &&
+ !is_map(data)) {
+ HashTable *ht = Z_ARRVAL_P(data);
+ zval **val;
+
+ zend_hash_internal_pointer_reset(ht);
+ while (zend_hash_get_current_data(ht,(void**)&val) == SUCCESS) {
+ if (Z_TYPE_PP(val) == IS_NULL && model->u.element->nillable) {
+ property = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(node, property);
+ set_xsi_nil(property);
+ } else {
+ property = master_to_xml(enc, *val, style, node TSRMLS_CC);
+ if (property->children && property->children->content &&
+ model->u.element->fixed && strcmp(model->u.element->fixed, (char*)property->children->content) != 0) {
+ soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content);
+ }
+ }
+ xmlNodeSetName(property, BAD_CAST(model->u.element->name));
+ if (style == SOAP_LITERAL &&
+ model->u.element->namens &&
+ model->u.element->form == XSD_FORM_QUALIFIED) {
+ xmlNsPtr nsp = encode_add_ns(property, model->u.element->namens);
+ xmlSetNs(property, nsp);
+ }
+ zend_hash_move_forward(ht);
+ }
+ } else {
+ if (Z_TYPE_P(data) == IS_NULL && model->u.element->nillable) {
+ property = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(node, property);
+ set_xsi_nil(property);
+ } else if (Z_TYPE_P(data) == IS_NULL && model->min_occurs == 0) {
+ return 1;
+ } else {
+ property = master_to_xml(enc, data, style, node TSRMLS_CC);
+ if (property->children && property->children->content &&
+ model->u.element->fixed && strcmp(model->u.element->fixed, (char*)property->children->content) != 0) {
+ soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content);
+ }
+ }
+ xmlNodeSetName(property, BAD_CAST(model->u.element->name));
+ if (style == SOAP_LITERAL &&
+ model->u.element->namens &&
+ model->u.element->form == XSD_FORM_QUALIFIED) {
+ xmlNsPtr nsp = encode_add_ns(property, model->u.element->namens);
+ xmlSetNs(property, nsp);
+ }
+ }
+ return 1;
+ } else if (strict && model->u.element->nillable && model->min_occurs > 0) {
+ property = xmlNewNode(NULL, BAD_CAST(model->u.element->name));
+ xmlAddChild(node, property);
+ set_xsi_nil(property);
+ if (style == SOAP_LITERAL &&
+ model->u.element->namens &&
+ model->u.element->form == XSD_FORM_QUALIFIED) {
+ xmlNsPtr nsp = encode_add_ns(property, model->u.element->namens);
+ xmlSetNs(property, nsp);
+ }
+ return 1;
+ } else if (model->min_occurs == 0) {
+ return 2;
+ } else {
+ if (strict) {
+ soap_error1(E_ERROR, "Encoding: object has no '%s' property", model->u.element->name);
+ }
+ return 0;
+ }
+ break;
+ }
+ case XSD_CONTENT_ANY: {
+ zval *data;
+ xmlNodePtr property;
+ encodePtr enc;
+
+ data = get_zval_property(object, "any" TSRMLS_CC);
+ if (data) {
+ enc = get_conversion(XSD_ANYXML);
+ if ((model->max_occurs == -1 || model->max_occurs > 1) &&
+ Z_TYPE_P(data) == IS_ARRAY &&
+ !is_map(data)) {
+ HashTable *ht = Z_ARRVAL_P(data);
+ zval **val;
+
+ zend_hash_internal_pointer_reset(ht);
+ while (zend_hash_get_current_data(ht,(void**)&val) == SUCCESS) {
+ property = master_to_xml(enc, *val, style, node TSRMLS_CC);
+ zend_hash_move_forward(ht);
+ }
+ } else {
+ property = master_to_xml(enc, data, style, node TSRMLS_CC);
+ }
+ return 1;
+ } else if (model->min_occurs == 0) {
+ return 2;
+ } else {
+ if (strict) {
+ soap_error0(E_ERROR, "Encoding: object has no 'any' property");
+ }
+ return 0;
+ }
+ break;
+ }
+ case XSD_CONTENT_SEQUENCE:
+ case XSD_CONTENT_ALL: {
+ sdlContentModelPtr *tmp;
+ HashPosition pos;
+
+ zend_hash_internal_pointer_reset_ex(model->u.content, &pos);
+ while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) {
+ if (!model_to_xml_object(node, *tmp, object, style, strict && ((*tmp)->min_occurs > 0) TSRMLS_CC)) {
+ if (!strict || (*tmp)->min_occurs > 0) {
+ return 0;
+ }
+ }
+ strict = 1;
+ zend_hash_move_forward_ex(model->u.content, &pos);
+ }
+ return 1;
+ }
+ case XSD_CONTENT_CHOICE: {
+ sdlContentModelPtr *tmp;
+ HashPosition pos;
+ int ret = 0;
+
+ zend_hash_internal_pointer_reset_ex(model->u.content, &pos);
+ while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) {
+ int tmp_ret = model_to_xml_object(node, *tmp, object, style, 0 TSRMLS_CC);
+ if (tmp_ret == 1) {
+ return 1;
+ } else if (tmp_ret != 0) {
+ ret = 1;
+ }
+ zend_hash_move_forward_ex(model->u.content, &pos);
+ }
+ return ret;
+ }
+ case XSD_CONTENT_GROUP: {
+ return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0 TSRMLS_CC);
+ }
+ default:
+ break;
+ }
+ return 1;
+}
+
+static sdlTypePtr model_array_element(sdlContentModelPtr model)
+{
+ switch (model->kind) {
+ case XSD_CONTENT_ELEMENT: {
+ if (model->max_occurs == -1 || model->max_occurs > 1) {
+ return model->u.element;
+ } else {
+ return NULL;
+ }
+ }
+ case XSD_CONTENT_SEQUENCE:
+ case XSD_CONTENT_ALL:
+ case XSD_CONTENT_CHOICE: {
+ sdlContentModelPtr *tmp;
+ HashPosition pos;
+
+ if (zend_hash_num_elements(model->u.content) != 1) {
+ return NULL;
+ }
+ zend_hash_internal_pointer_reset_ex(model->u.content, &pos);
+ zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos);
+ return model_array_element(*tmp);
+ }
+ case XSD_CONTENT_GROUP: {
+ return model_array_element(model->u.group->model);
+ }
+ default:
+ break;
+ }
+ return NULL;
+}
+
+static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ xmlNodePtr xmlParam;
+ HashTable *prop = NULL;
+ int i;
+ sdlTypePtr sdlType = type->sdl_type;
+
+ if (!data || Z_TYPE_P(data) == IS_NULL) {
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, xmlParam);
+ if (style == SOAP_ENCODED) {
+ set_xsi_nil(xmlParam);
+ set_ns_and_type(xmlParam, type);
+ }
+ return xmlParam;
+ }
+
+ if (Z_TYPE_P(data) == IS_OBJECT) {
+ prop = Z_OBJPROP_P(data);
+ } else if (Z_TYPE_P(data) == IS_ARRAY) {
+ prop = Z_ARRVAL_P(data);
+ }
+
+ if (sdlType) {
+ if (sdlType->kind == XSD_TYPEKIND_RESTRICTION &&
+ sdlType->encode && type != &sdlType->encode->details) {
+ encodePtr enc;
+
+ enc = sdlType->encode;
+ while (enc && enc->details.sdl_type &&
+ enc->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE &&
+ enc->details.sdl_type->kind != XSD_TYPEKIND_LIST &&
+ enc->details.sdl_type->kind != XSD_TYPEKIND_UNION) {
+ enc = enc->details.sdl_type->encode;
+ }
+ if (enc) {
+ zval *tmp = get_zval_property(data, "_" TSRMLS_CC);
+ if (tmp) {
+ xmlParam = master_to_xml(enc, tmp, style, parent TSRMLS_CC);
+ } else if (prop == NULL) {
+ xmlParam = master_to_xml(enc, data, style, parent TSRMLS_CC);
+ } else {
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, xmlParam);
+ }
+ } else {
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, xmlParam);
+ }
+ } else if (sdlType->kind == XSD_TYPEKIND_EXTENSION &&
+ sdlType->encode && type != &sdlType->encode->details) {
+ if (sdlType->encode->details.sdl_type &&
+ sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE &&
+ sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_LIST &&
+ sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_UNION) {
+
+ if (prop) prop->nApplyCount++;
+ xmlParam = master_to_xml(sdlType->encode, data, style, parent TSRMLS_CC);
+ if (prop) prop->nApplyCount--;
+ } else {
+ zval *tmp = get_zval_property(data, "_" TSRMLS_CC);
+
+ if (tmp) {
+ xmlParam = master_to_xml(sdlType->encode, tmp, style, parent TSRMLS_CC);
+ } else if (prop == NULL) {
+ xmlParam = master_to_xml(sdlType->encode, data, style, parent TSRMLS_CC);
+ } else {
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, xmlParam);
+ }
+ }
+ } else {
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, xmlParam);
+ }
+
+ if (soap_check_zval_ref(data, xmlParam TSRMLS_CC)) {
+ return xmlParam;
+ }
+ if (prop != NULL) {
+ sdlTypePtr array_el;
+
+ if (Z_TYPE_P(data) == IS_ARRAY &&
+ !is_map(data) &&
+ sdlType->attributes == NULL &&
+ sdlType->model != NULL &&
+ (array_el = model_array_element(sdlType->model)) != NULL) {
+ zval **val;
+
+ zend_hash_internal_pointer_reset(prop);
+ while (zend_hash_get_current_data(prop,(void**)&val) == SUCCESS) {
+ xmlNodePtr property;
+ if (Z_TYPE_PP(val) == IS_NULL && array_el->nillable) {
+ property = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(xmlParam, property);
+ set_xsi_nil(property);
+ } else {
+ property = master_to_xml(array_el->encode, *val, style, xmlParam TSRMLS_CC);
+ }
+ xmlNodeSetName(property, BAD_CAST(array_el->name));
+ if (style == SOAP_LITERAL &&
+ array_el->namens &&
+ array_el->form == XSD_FORM_QUALIFIED) {
+ xmlNsPtr nsp = encode_add_ns(property, array_el->namens);
+ xmlSetNs(property, nsp);
+ }
+ zend_hash_move_forward(prop);
+ }
+ } else if (sdlType->model) {
+ model_to_xml_object(xmlParam, sdlType->model, data, style, 1 TSRMLS_CC);
+ }
+ if (sdlType->attributes) {
+ sdlAttributePtr *attr;
+ zval *zattr;
+ HashPosition pos;
+
+ zend_hash_internal_pointer_reset_ex(sdlType->attributes, &pos);
+ while (zend_hash_get_current_data_ex(sdlType->attributes, (void**)&attr, &pos) == SUCCESS) {
+ if ((*attr)->name) {
+ zattr = get_zval_property(data, (*attr)->name TSRMLS_CC);
+ if (zattr) {
+ xmlNodePtr dummy;
+
+ dummy = master_to_xml((*attr)->encode, zattr, SOAP_LITERAL, xmlParam TSRMLS_CC);
+ if (dummy->children && dummy->children->content) {
+ if ((*attr)->fixed && strcmp((*attr)->fixed, (char*)dummy->children->content) != 0) {
+ soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", (*attr)->name, (*attr)->fixed, dummy->children->content);
+ }
+ /* we need to handle xml: namespace specially, since it is
+ an implicit schema. Otherwise, use form.
+ */
+ if ((*attr)->namens &&
+ (!strncmp((*attr)->namens, XML_NAMESPACE, sizeof(XML_NAMESPACE)) ||
+ (*attr)->form == XSD_FORM_QUALIFIED)) {
+ xmlNsPtr nsp = encode_add_ns(xmlParam, (*attr)->namens);
+
+ xmlSetNsProp(xmlParam, nsp, BAD_CAST((*attr)->name), dummy->children->content);
+ } else {
+ xmlSetProp(xmlParam, BAD_CAST((*attr)->name), dummy->children->content);
+ }
+ }
+ xmlUnlinkNode(dummy);
+ xmlFreeNode(dummy);
+ }
+ }
+ zend_hash_move_forward_ex(sdlType->attributes, &pos);
+ }
+ }
+ }
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(xmlParam, type);
+ }
+ } else {
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, xmlParam);
+
+ if (soap_check_zval_ref(data, xmlParam TSRMLS_CC)) {
+ return xmlParam;
+ }
+ if (prop != NULL) {
+ i = zend_hash_num_elements(prop);
+ zend_hash_internal_pointer_reset(prop);
+
+ for (;i > 0;i--) {
+ xmlNodePtr property;
+ zval **zprop;
+ char *str_key;
+ ulong index;
+ int key_type;
+ unsigned int str_key_len;
+
+ key_type = zend_hash_get_current_key_ex(prop, &str_key, &str_key_len, &index, FALSE, NULL);
+ zend_hash_get_current_data(prop, (void **)&zprop);
+
+ property = master_to_xml(get_conversion((*zprop)->type), (*zprop), style, xmlParam TSRMLS_CC);
+
+ if (key_type == HASH_KEY_IS_STRING) {
+ const char *prop_name;
+
+ if (Z_TYPE_P(data) == IS_OBJECT) {
+ const char *class_name;
+
+ zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name);
+ } else {
+ prop_name = str_key;
+ }
+ if (prop_name) {
+ xmlNodeSetName(property, BAD_CAST(prop_name));
+ }
+ }
+ zend_hash_move_forward(prop);
+ }
+ }
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(xmlParam, type);
+ }
+ }
+ return xmlParam;
+}
+
+/* Array encode/decode */
+static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ encodePtr enc = NULL;
+
+ if (data && Z_TYPE_P(data) == IS_ARRAY) {
+ if (is_map(data)) {
+ enc = get_conversion(APACHE_MAP);
+ } else {
+ enc = get_conversion(SOAP_ENC_ARRAY);
+ }
+ }
+ if (!enc) {
+ enc = get_conversion(IS_NULL);
+ }
+
+ return master_to_xml(enc, data, style, parent TSRMLS_CC);
+}
+
+static int calc_dimension_12(const char* str)
+{
+ int i = 0, flag = 0;
+ while (*str != '\0' && (*str < '0' || *str > '9') && (*str != '*')) {
+ str++;
+ }
+ if (*str == '*') {
+ i++;
+ str++;
+ }
+ while (*str != '\0') {
+ if (*str >= '0' && *str <= '9') {
+ if (flag == 0) {
+ i++;
+ flag = 1;
+ }
+ } else if (*str == '*') {
+ soap_error0(E_ERROR, "Encoding: '*' may only be first arraySize value in list");
+ } else {
+ flag = 0;
+ }
+ str++;
+ }
+ return i;
+}
+
+static int* get_position_12(int dimension, const char* str)
+{
+ int *pos;
+ int i = -1, flag = 0;
+
+ pos = safe_emalloc(sizeof(int), dimension, 0);
+ memset(pos,0,sizeof(int)*dimension);
+ while (*str != '\0' && (*str < '0' || *str > '9') && (*str != '*')) {
+ str++;
+ }
+ if (*str == '*') {
+ str++;
+ i++;
+ }
+ while (*str != '\0') {
+ if (*str >= '0' && *str <= '9') {
+ if (flag == 0) {
+ i++;
+ flag = 1;
+ }
+ pos[i] = (pos[i]*10)+(*str-'0');
+ } else if (*str == '*') {
+ soap_error0(E_ERROR, "Encoding: '*' may only be first arraySize value in list");
+ } else {
+ flag = 0;
+ }
+ str++;
+ }
+ return pos;
+}
+
+static int calc_dimension(const char* str)
+{
+ int i = 1;
+ while (*str != ']' && *str != '\0') {
+ if (*str == ',') {
+ i++;
+ }
+ str++;
+ }
+ return i;
+}
+
+static void get_position_ex(int dimension, const char* str, int** pos)
+{
+ int i = 0;
+
+ memset(*pos,0,sizeof(int)*dimension);
+ while (*str != ']' && *str != '\0' && i < dimension) {
+ if (*str >= '0' && *str <= '9') {
+ (*pos)[i] = ((*pos)[i]*10)+(*str-'0');
+ } else if (*str == ',') {
+ i++;
+ }
+ str++;
+ }
+}
+
+static int* get_position(int dimension, const char* str)
+{
+ int *pos;
+
+ pos = safe_emalloc(sizeof(int), dimension, 0);
+ get_position_ex(dimension, str, &pos);
+ return pos;
+}
+
+static void add_xml_array_elements(xmlNodePtr xmlParam,
+ sdlTypePtr type,
+ encodePtr enc,
+ xmlNsPtr ns,
+ int dimension ,
+ int* dims,
+ zval* data,
+ int style
+ TSRMLS_DC)
+{
+ int j;
+
+ if (data && Z_TYPE_P(data) == IS_ARRAY) {
+ zend_hash_internal_pointer_reset(data->value.ht);
+ for (j=0; j<dims[0]; j++) {
+ zval **zdata;
+
+ if (zend_hash_get_current_data(data->value.ht, (void **)&zdata) != SUCCESS) {
+ zdata = NULL;
+ }
+ if (dimension == 1) {
+ xmlNodePtr xparam;
+
+ if (zdata) {
+ if (enc == NULL) {
+ xparam = master_to_xml(get_conversion((*zdata)->type), (*zdata), style, xmlParam TSRMLS_CC);
+ } else {
+ xparam = master_to_xml(enc, (*zdata), style, xmlParam TSRMLS_CC);
+ }
+ } else {
+ xparam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(xmlParam, xparam);
+ }
+
+ if (type) {
+ xmlNodeSetName(xparam, BAD_CAST(type->name));
+ } else if (style == SOAP_LITERAL && enc && enc->details.type_str) {
+ xmlNodeSetName(xparam, BAD_CAST(enc->details.type_str));
+ xmlSetNs(xparam, ns);
+ } else {
+ xmlNodeSetName(xparam, BAD_CAST("item"));
+ }
+ } else {
+ if (zdata) {
+ add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, *zdata, style TSRMLS_CC);
+ } else {
+ add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style TSRMLS_CC);
+ }
+ }
+ zend_hash_move_forward(data->value.ht);
+ }
+ } else {
+ for (j=0; j<dims[0]; j++) {
+ if (dimension == 1) {
+ xmlNodePtr xparam;
+
+ xparam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(xmlParam, xparam);
+ if (type) {
+ xmlNodeSetName(xparam, BAD_CAST(type->name));
+ } else if (style == SOAP_LITERAL && enc && enc->details.type_str) {
+ xmlNodeSetName(xparam, BAD_CAST(enc->details.type_str));
+ xmlSetNs(xparam, ns);
+ } else {
+ xmlNodeSetName(xparam, BAD_CAST("item"));
+ }
+ } else {
+ add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style TSRMLS_CC);
+ }
+ }
+ }
+}
+
+static inline int array_num_elements(HashTable* ht)
+{
+ if (ht->pListTail && ht->pListTail->nKeyLength == 0) {
+ return ht->pListTail->h-1;
+ }
+ return 0;
+}
+
+static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ sdlTypePtr sdl_type = type->sdl_type;
+ sdlTypePtr element_type = NULL;
+ smart_str array_type = {0}, array_size = {0};
+ int i;
+ xmlNodePtr xmlParam;
+ encodePtr enc = NULL;
+ int dimension = 1;
+ int* dims;
+ int soap_version;
+ zval *array_copy = NULL;
+
+ soap_version = SOAP_GLOBAL(soap_version);
+
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, xmlParam);
+
+ if (!data || Z_TYPE_P(data) == IS_NULL) {
+ if (style == SOAP_ENCODED) {
+ set_xsi_nil(xmlParam);
+ if (SOAP_GLOBAL(features) & SOAP_USE_XSI_ARRAY_TYPE) {
+ set_ns_and_type_ex(xmlParam, (soap_version == SOAP_1_1) ? SOAP_1_1_ENC_NAMESPACE : SOAP_1_2_ENC_NAMESPACE, "Array");
+ } else {
+ set_ns_and_type(xmlParam, type);
+ }
+ }
+ return xmlParam;
+ }
+
+ if (Z_TYPE_P(data) == IS_OBJECT && instanceof_function(Z_OBJCE_P(data), zend_ce_traversable TSRMLS_CC)) {
+ zend_object_iterator *iter;
+ zend_class_entry *ce = Z_OBJCE_P(data);
+ zval **val;
+ char *str_key;
+ uint str_key_len;
+ ulong int_key;
+ int key_type;
+
+ ALLOC_ZVAL(array_copy);
+ INIT_PZVAL(array_copy);
+ array_init(array_copy);
+
+ iter = ce->get_iterator(ce, data, 0 TSRMLS_CC);
+
+ if (EG(exception)) {
+ goto iterator_done;
+ }
+
+ if (iter->funcs->rewind) {
+ iter->funcs->rewind(iter TSRMLS_CC);
+ if (EG(exception)) {
+ goto iterator_done;
+ }
+ }
+
+ while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) {
+ if (EG(exception)) {
+ goto iterator_done;
+ }
+
+ iter->funcs->get_current_data(iter, &val TSRMLS_CC);
+ if (EG(exception)) {
+ goto iterator_done;
+ }
+ if (iter->funcs->get_current_key) {
+ key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
+ if (EG(exception)) {
+ goto iterator_done;
+ }
+ switch(key_type) {
+ case HASH_KEY_IS_STRING:
+ add_assoc_zval_ex(array_copy, str_key, str_key_len, *val);
+ efree(str_key);
+ break;
+ case HASH_KEY_IS_LONG:
+ add_index_zval(array_copy, int_key, *val);
+ break;
+ }
+ } else {
+ add_next_index_zval(array_copy, *val);
+ }
+ Z_ADDREF_PP(val);
+
+ iter->funcs->move_forward(iter TSRMLS_CC);
+ if (EG(exception)) {
+ goto iterator_done;
+ }
+ }
+iterator_done:
+ iter->funcs->dtor(iter TSRMLS_CC);
+ if (EG(exception)) {
+ zval_ptr_dtor(&array_copy);
+ array_copy = NULL;
+ } else {
+ data = array_copy;
+ }
+ }
+
+ if (Z_TYPE_P(data) == IS_ARRAY) {
+ sdlAttributePtr *arrayType;
+ sdlExtraAttributePtr *ext;
+ sdlTypePtr elementType;
+
+ i = zend_hash_num_elements(Z_ARRVAL_P(data));
+
+ if (sdl_type &&
+ sdl_type->attributes &&
+ zend_hash_find(sdl_type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType",
+ sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType"),
+ (void **)&arrayType) == SUCCESS &&
+ (*arrayType)->extraAttributes &&
+ zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) {
+
+ char *value, *end;
+ zval** el;
+
+ value = estrdup((*ext)->val);
+ end = strrchr(value,'[');
+ if (end) {
+ *end = '\0';
+ end++;
+ dimension = calc_dimension(end);
+ }
+ if ((*ext)->ns != NULL) {
+ enc = get_encoder(SOAP_GLOBAL(sdl), (*ext)->ns, value);
+ get_type_str(xmlParam, (*ext)->ns, value, &array_type);
+ } else {
+ smart_str_appends(&array_type, value);
+ }
+
+ dims = safe_emalloc(sizeof(int), dimension, 0);
+ dims[0] = i;
+ el = &data;
+ for (i = 1; i < dimension; i++) {
+ if (el != NULL && Z_TYPE_PP(el) == IS_ARRAY &&
+ zend_hash_num_elements(Z_ARRVAL_PP(el)) > 0) {
+ zend_hash_internal_pointer_reset(Z_ARRVAL_PP(el));
+ zend_hash_get_current_data(Z_ARRVAL_PP(el), (void**)&el);
+ if (Z_TYPE_PP(el) == IS_ARRAY) {
+ dims[i] = zend_hash_num_elements(Z_ARRVAL_PP(el));
+ } else {
+ dims[i] = 0;
+ }
+ }
+ }
+
+ smart_str_append_long(&array_size, dims[0]);
+ for (i=1; i<dimension; i++) {
+ smart_str_appendc(&array_size, ',');
+ smart_str_append_long(&array_size, dims[i]);
+ }
+
+ efree(value);
+
+ } else if (sdl_type &&
+ sdl_type->attributes &&
+ zend_hash_find(sdl_type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType",
+ sizeof(SOAP_1_2_ENC_NAMESPACE":itemType"),
+ (void **)&arrayType) == SUCCESS &&
+ (*arrayType)->extraAttributes &&
+ zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":itemType"), (void **)&ext) == SUCCESS) {
+ if ((*ext)->ns != NULL) {
+ enc = get_encoder(SOAP_GLOBAL(sdl), (*ext)->ns, (*ext)->val);
+ get_type_str(xmlParam, (*ext)->ns, (*ext)->val, &array_type);
+ } else {
+ smart_str_appends(&array_type, (*ext)->val);
+ }
+ if (zend_hash_find(sdl_type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize",
+ sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"),
+ (void **)&arrayType) == SUCCESS &&
+ (*arrayType)->extraAttributes &&
+ zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arraySize", sizeof(WSDL_NAMESPACE":arraysize"), (void **)&ext) == SUCCESS) {
+ dimension = calc_dimension_12((*ext)->val);
+ dims = get_position_12(dimension, (*ext)->val);
+ if (dims[0] == 0) {dims[0] = i;}
+
+ smart_str_append_long(&array_size, dims[0]);
+ for (i=1; i<dimension; i++) {
+ smart_str_appendc(&array_size, ',');
+ smart_str_append_long(&array_size, dims[i]);
+ }
+ } else {
+ dims = emalloc(sizeof(int));
+ *dims = 0;
+ smart_str_append_long(&array_size, i);
+ }
+ } else if (sdl_type &&
+ sdl_type->attributes &&
+ zend_hash_find(sdl_type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize",
+ sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"),
+ (void **)&arrayType) == SUCCESS &&
+ (*arrayType)->extraAttributes &&
+ zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arraySize", sizeof(WSDL_NAMESPACE":arraySize"), (void **)&ext) == SUCCESS) {
+ dimension = calc_dimension_12((*ext)->val);
+ dims = get_position_12(dimension, (*ext)->val);
+ if (dims[0] == 0) {dims[0] = i;}
+
+ smart_str_append_long(&array_size, dims[0]);
+ for (i=1; i<dimension; i++) {
+ smart_str_appendc(&array_size, ',');
+ smart_str_append_long(&array_size, dims[i]);
+ }
+
+ if (sdl_type && sdl_type->elements &&
+ zend_hash_num_elements(sdl_type->elements) == 1 &&
+ (zend_hash_internal_pointer_reset(sdl_type->elements),
+ zend_hash_get_current_data(sdl_type->elements, (void**)&elementType) == SUCCESS) &&
+ (elementType = *(sdlTypePtr*)elementType) != NULL &&
+ elementType->encode && elementType->encode->details.type_str) {
+ element_type = elementType;
+ enc = elementType->encode;
+ get_type_str(xmlParam, elementType->encode->details.ns, elementType->encode->details.type_str, &array_type);
+ } else {
+ enc = get_array_type(xmlParam, data, &array_type TSRMLS_CC);
+ }
+ } else if (sdl_type && sdl_type->elements &&
+ zend_hash_num_elements(sdl_type->elements) == 1 &&
+ (zend_hash_internal_pointer_reset(sdl_type->elements),
+ zend_hash_get_current_data(sdl_type->elements, (void**)&elementType) == SUCCESS) &&
+ (elementType = *(sdlTypePtr*)elementType) != NULL &&
+ elementType->encode && elementType->encode->details.type_str) {
+
+ element_type = elementType;
+ enc = elementType->encode;
+ get_type_str(xmlParam, elementType->encode->details.ns, elementType->encode->details.type_str, &array_type);
+
+ smart_str_append_long(&array_size, i);
+
+ dims = safe_emalloc(sizeof(int), dimension, 0);
+ dims[0] = i;
+ } else {
+
+ enc = get_array_type(xmlParam, data, &array_type TSRMLS_CC);
+ smart_str_append_long(&array_size, i);
+ dims = safe_emalloc(sizeof(int), dimension, 0);
+ dims[0] = i;
+ }
+
+ if (style == SOAP_ENCODED) {
+ if (soap_version == SOAP_1_1) {
+ smart_str_0(&array_type);
+ if (strcmp(array_type.c,"xsd:anyType") == 0) {
+ smart_str_free(&array_type);
+ smart_str_appendl(&array_type,"xsd:ur-type",sizeof("xsd:ur-type")-1);
+ }
+ smart_str_appendc(&array_type, '[');
+ smart_str_append(&array_type, &array_size);
+ smart_str_appendc(&array_type, ']');
+ smart_str_0(&array_type);
+ set_ns_prop(xmlParam, SOAP_1_1_ENC_NAMESPACE, "arrayType", array_type.c);
+ } else {
+ int i = 0;
+ while (i < array_size.len) {
+ if (array_size.c[i] == ',') {array_size.c[i] = ' ';}
+ ++i;
+ }
+ smart_str_0(&array_type);
+ smart_str_0(&array_size);
+ set_ns_prop(xmlParam, SOAP_1_2_ENC_NAMESPACE, "itemType", array_type.c);
+ set_ns_prop(xmlParam, SOAP_1_2_ENC_NAMESPACE, "arraySize", array_size.c);
+ }
+ }
+ smart_str_free(&array_type);
+ smart_str_free(&array_size);
+
+ add_xml_array_elements(xmlParam, element_type, enc, enc?encode_add_ns(xmlParam,enc->details.ns):NULL, dimension, dims, data, style TSRMLS_CC);
+ efree(dims);
+ }
+ if (style == SOAP_ENCODED) {
+ if (SOAP_GLOBAL(features) & SOAP_USE_XSI_ARRAY_TYPE) {
+ set_ns_and_type_ex(xmlParam, (soap_version == SOAP_1_1) ? SOAP_1_1_ENC_NAMESPACE : SOAP_1_2_ENC_NAMESPACE, "Array");
+ } else {
+ set_ns_and_type(xmlParam, type);
+ }
+ }
+
+ if (array_copy) {
+ zval_ptr_dtor(&array_copy);
+ }
+
+ return xmlParam;
+}
+
+static zval *to_zval_array(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ zval *ret;
+ xmlNodePtr trav;
+ encodePtr enc = NULL;
+ int dimension = 1;
+ int* dims = NULL;
+ int* pos = NULL;
+ xmlAttrPtr attr;
+ sdlPtr sdl;
+ sdlAttributePtr *arrayType;
+ sdlExtraAttributePtr *ext;
+ sdlTypePtr elementType;
+
+ MAKE_STD_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+ sdl = SOAP_GLOBAL(sdl);
+
+ if (data &&
+ (attr = get_attribute(data->properties,"arrayType")) &&
+ attr->children && attr->children->content) {
+ char *type, *end, *ns;
+ xmlNsPtr nsptr;
+
+ parse_namespace(attr->children->content, &type, &ns);
+ nsptr = xmlSearchNs(attr->doc, attr->parent, BAD_CAST(ns));
+
+ end = strrchr(type,'[');
+ if (end) {
+ *end = '\0';
+ dimension = calc_dimension(end+1);
+ dims = get_position(dimension, end+1);
+ }
+ if (nsptr != NULL) {
+ enc = get_encoder(SOAP_GLOBAL(sdl), (char*)nsptr->href, type);
+ }
+ efree(type);
+ if (ns) {efree(ns);}
+
+ } else if ((attr = get_attribute(data->properties,"itemType")) &&
+ attr->children &&
+ attr->children->content) {
+ char *type, *ns;
+ xmlNsPtr nsptr;
+
+ parse_namespace(attr->children->content, &type, &ns);
+ nsptr = xmlSearchNs(attr->doc, attr->parent, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ enc = get_encoder(SOAP_GLOBAL(sdl), (char*)nsptr->href, type);
+ }
+ efree(type);
+ if (ns) {efree(ns);}
+
+ if ((attr = get_attribute(data->properties,"arraySize")) &&
+ attr->children && attr->children->content) {
+ dimension = calc_dimension_12((char*)attr->children->content);
+ dims = get_position_12(dimension, (char*)attr->children->content);
+ } else {
+ dims = emalloc(sizeof(int));
+ *dims = 0;
+ }
+
+ } else if ((attr = get_attribute(data->properties,"arraySize")) &&
+ attr->children && attr->children->content) {
+
+ dimension = calc_dimension_12((char*)attr->children->content);
+ dims = get_position_12(dimension, (char*)attr->children->content);
+
+ } else if (type->sdl_type != NULL &&
+ type->sdl_type->attributes != NULL &&
+ zend_hash_find(type->sdl_type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType",
+ sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType"),
+ (void **)&arrayType) == SUCCESS &&
+ (*arrayType)->extraAttributes &&
+ zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) {
+ char *type, *end;
+
+ type = estrdup((*ext)->val);
+ end = strrchr(type,'[');
+ if (end) {
+ *end = '\0';
+ }
+ if ((*ext)->ns != NULL) {
+ enc = get_encoder(SOAP_GLOBAL(sdl), (*ext)->ns, type);
+ }
+ efree(type);
+
+ dims = emalloc(sizeof(int));
+ *dims = 0;
+
+ } else if (type->sdl_type != NULL &&
+ type->sdl_type->attributes != NULL &&
+ zend_hash_find(type->sdl_type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType",
+ sizeof(SOAP_1_2_ENC_NAMESPACE":itemType"),
+ (void **)&arrayType) == SUCCESS &&
+ (*arrayType)->extraAttributes &&
+ zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":itemType"), (void **)&ext) == SUCCESS) {
+
+ if ((*ext)->ns != NULL) {
+ enc = get_encoder(SOAP_GLOBAL(sdl), (*ext)->ns, (*ext)->val);
+ }
+
+ if (zend_hash_find(type->sdl_type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize",
+ sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"),
+ (void **)&arrayType) == SUCCESS &&
+ (*arrayType)->extraAttributes &&
+ zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arraySize", sizeof(WSDL_NAMESPACE":arraysize"), (void **)&ext) == SUCCESS) {
+ dimension = calc_dimension_12((*ext)->val);
+ dims = get_position_12(dimension, (*ext)->val);
+ } else {
+ dims = emalloc(sizeof(int));
+ *dims = 0;
+ }
+ } else if (type->sdl_type != NULL &&
+ type->sdl_type->attributes != NULL &&
+ zend_hash_find(type->sdl_type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize",
+ sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"),
+ (void **)&arrayType) == SUCCESS &&
+ (*arrayType)->extraAttributes &&
+ zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arraySize", sizeof(WSDL_NAMESPACE":arraysize"), (void **)&ext) == SUCCESS) {
+
+ dimension = calc_dimension_12((*ext)->val);
+ dims = get_position_12(dimension, (*ext)->val);
+ if (type->sdl_type && type->sdl_type->elements &&
+ zend_hash_num_elements(type->sdl_type->elements) == 1 &&
+ (zend_hash_internal_pointer_reset(type->sdl_type->elements),
+ zend_hash_get_current_data(type->sdl_type->elements, (void**)&elementType) == SUCCESS) &&
+ (elementType = *(sdlTypePtr*)elementType) != NULL &&
+ elementType->encode) {
+ enc = elementType->encode;
+ }
+ } else if (type->sdl_type && type->sdl_type->elements &&
+ zend_hash_num_elements(type->sdl_type->elements) == 1 &&
+ (zend_hash_internal_pointer_reset(type->sdl_type->elements),
+ zend_hash_get_current_data(type->sdl_type->elements, (void**)&elementType) == SUCCESS) &&
+ (elementType = *(sdlTypePtr*)elementType) != NULL &&
+ elementType->encode) {
+ enc = elementType->encode;
+ }
+ if (dims == NULL) {
+ dimension = 1;
+ dims = emalloc(sizeof(int));
+ *dims = 0;
+ }
+ pos = safe_emalloc(sizeof(int), dimension, 0);
+ memset(pos,0,sizeof(int)*dimension);
+ if (data &&
+ (attr = get_attribute(data->properties,"offset")) &&
+ attr->children && attr->children->content) {
+ char* tmp = strrchr((char*)attr->children->content,'[');
+
+ if (tmp == NULL) {
+ tmp = (char*)attr->children->content;
+ }
+ get_position_ex(dimension, tmp, &pos);
+ }
+
+ array_init(ret);
+ trav = data->children;
+ while (trav) {
+ if (trav->type == XML_ELEMENT_NODE) {
+ int i;
+ zval *tmpVal, *ar;
+ xmlAttrPtr position = get_attribute(trav->properties,"position");
+
+ tmpVal = master_to_zval(enc, trav TSRMLS_CC);
+ if (position != NULL && position->children && position->children->content) {
+ char* tmp = strrchr((char*)position->children->content, '[');
+ if (tmp == NULL) {
+ tmp = (char*)position->children->content;
+ }
+ get_position_ex(dimension, tmp, &pos);
+ }
+
+ /* Get/Create intermediate arrays for multidimensional arrays */
+ i = 0;
+ ar = ret;
+ while (i < dimension-1) {
+ zval** ar2;
+ if (zend_hash_index_find(Z_ARRVAL_P(ar), pos[i], (void**)&ar2) == SUCCESS) {
+ ar = *ar2;
+ } else {
+ zval *tmpAr;
+ MAKE_STD_ZVAL(tmpAr);
+ array_init(tmpAr);
+ zend_hash_index_update(Z_ARRVAL_P(ar), pos[i], &tmpAr, sizeof(zval*), (void**)&ar2);
+ ar = *ar2;
+ }
+ i++;
+ }
+ zend_hash_index_update(Z_ARRVAL_P(ar), pos[i], &tmpVal, sizeof(zval *), NULL);
+
+ /* Increment position */
+ i = dimension;
+ while (i > 0) {
+ i--;
+ pos[i]++;
+ if (pos[i] >= dims[i]) {
+ if (i > 0) {
+ pos[i] = 0;
+ } else {
+ /* TODO: Array index overflow */
+ }
+ } else {
+ break;
+ }
+ }
+ }
+ trav = trav->next;
+ }
+ efree(dims);
+ efree(pos);
+ return ret;
+}
+
+/* Map encode/decode */
+static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ xmlNodePtr xmlParam;
+ int i;
+
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, xmlParam);
+ FIND_ZVAL_NULL(data, xmlParam, style);
+
+ if (Z_TYPE_P(data) == IS_ARRAY) {
+ i = zend_hash_num_elements(Z_ARRVAL_P(data));
+ zend_hash_internal_pointer_reset(data->value.ht);
+ for (;i > 0;i--) {
+ xmlNodePtr xparam, item;
+ xmlNodePtr key;
+ zval **temp_data;
+ char *key_val;
+ ulong int_val;
+
+ zend_hash_get_current_data(data->value.ht, (void **)&temp_data);
+ item = xmlNewNode(NULL, BAD_CAST("item"));
+ xmlAddChild(xmlParam, item);
+ key = xmlNewNode(NULL, BAD_CAST("key"));
+ xmlAddChild(item,key);
+ if (zend_hash_get_current_key(data->value.ht, &key_val, &int_val, FALSE) == HASH_KEY_IS_STRING) {
+ if (style == SOAP_ENCODED) {
+ set_xsi_type(key, "xsd:string");
+ }
+ xmlNodeSetContent(key, BAD_CAST(key_val));
+ } else {
+ smart_str tmp = {0};
+ smart_str_append_long(&tmp, int_val);
+ smart_str_0(&tmp);
+
+ if (style == SOAP_ENCODED) {
+ set_xsi_type(key, "xsd:int");
+ }
+ xmlNodeSetContentLen(key, BAD_CAST(tmp.c), tmp.len);
+
+ smart_str_free(&tmp);
+ }
+
+ xparam = master_to_xml(get_conversion((*temp_data)->type), (*temp_data), style, item TSRMLS_CC);
+ xmlNodeSetName(xparam, BAD_CAST("value"));
+
+ zend_hash_move_forward(data->value.ht);
+ }
+ }
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(xmlParam, type);
+ }
+
+ return xmlParam;
+}
+
+static zval *to_zval_map(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ zval *ret, *key, *value;
+ xmlNodePtr trav, item, xmlKey, xmlValue;
+
+ MAKE_STD_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+
+ if (data && data->children) {
+ array_init(ret);
+ trav = data->children;
+
+ trav = data->children;
+ FOREACHNODE(trav, "item", item) {
+ xmlKey = get_node(item->children, "key");
+ if (!xmlKey) {
+ soap_error0(E_ERROR, "Encoding: Can't decode apache map, missing key");
+ }
+
+ xmlValue = get_node(item->children, "value");
+ if (!xmlKey) {
+ soap_error0(E_ERROR, "Encoding: Can't decode apache map, missing value");
+ }
+
+ key = master_to_zval(NULL, xmlKey TSRMLS_CC);
+ value = master_to_zval(NULL, xmlValue TSRMLS_CC);
+
+ if (Z_TYPE_P(key) == IS_STRING) {
+ zend_symtable_update(Z_ARRVAL_P(ret), Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &value, sizeof(zval *), NULL);
+ } else if (Z_TYPE_P(key) == IS_LONG) {
+ zend_hash_index_update(Z_ARRVAL_P(ret), Z_LVAL_P(key), &value, sizeof(zval *), NULL);
+ } else {
+ soap_error0(E_ERROR, "Encoding: Can't decode apache map, only Strings or Longs are allowd as keys");
+ }
+ zval_ptr_dtor(&key);
+ }
+ ENDFOREACH(trav);
+ } else {
+ ZVAL_NULL(ret);
+ }
+ return ret;
+}
+
+/* Unknown encode/decode */
+static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ encodePtr enc;
+ xmlNodePtr ret;
+
+ if (data) {
+ enc = get_conversion(data->type);
+ } else {
+ enc = get_conversion(IS_NULL);
+ }
+ ret = master_to_xml_int(enc, data, style, parent, 0 TSRMLS_CC);
+/*
+ if (style == SOAP_LITERAL && SOAP_GLOBAL(sdl)) {
+ set_ns_and_type(ret, &enc->details);
+ }
+*/
+ return ret;
+}
+
+static zval *guess_zval_convert(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ encodePtr enc = NULL;
+ xmlAttrPtr tmpattr;
+ xmlChar *type_name = NULL;
+ zval *ret;
+
+ data = check_and_resolve_href(data);
+
+ if (data == NULL) {
+ enc = get_conversion(IS_NULL);
+ } else if (data->properties && get_attribute_ex(data->properties, "nil", XSI_NAMESPACE)) {
+ enc = get_conversion(IS_NULL);
+ } else {
+ tmpattr = get_attribute_ex(data->properties,"type", XSI_NAMESPACE);
+ if (tmpattr != NULL) {
+ type_name = tmpattr->children->content;
+ enc = get_encoder_from_prefix(SOAP_GLOBAL(sdl), data, tmpattr->children->content);
+ if (enc && type == &enc->details) {
+ enc = NULL;
+ }
+ if (enc != NULL) {
+ encodePtr tmp = enc;
+ while (tmp &&
+ tmp->details.sdl_type != NULL &&
+ tmp->details.sdl_type->kind != XSD_TYPEKIND_COMPLEX) {
+ if (enc == tmp->details.sdl_type->encode ||
+ tmp == tmp->details.sdl_type->encode) {
+ enc = NULL;
+ break;
+ }
+ tmp = tmp->details.sdl_type->encode;
+ }
+ }
+ }
+
+ if (enc == NULL) {
+ /* Didn't have a type, totally guess here */
+ /* Logic: has children = IS_OBJECT else IS_STRING */
+ xmlNodePtr trav;
+
+ if (get_attribute(data->properties, "arrayType") ||
+ get_attribute(data->properties, "itemType") ||
+ get_attribute(data->properties, "arraySize")) {
+ enc = get_conversion(SOAP_ENC_ARRAY);
+ } else {
+ enc = get_conversion(XSD_STRING);
+ trav = data->children;
+ while (trav != NULL) {
+ if (trav->type == XML_ELEMENT_NODE) {
+ enc = get_conversion(SOAP_ENC_OBJECT);
+ break;
+ }
+ trav = trav->next;
+ }
+ }
+ }
+ }
+ ret = master_to_zval_int(enc, data TSRMLS_CC);
+ if (SOAP_GLOBAL(sdl) && type_name && enc->details.sdl_type) {
+ zval* soapvar;
+ char *ns, *cptype;
+ xmlNsPtr nsptr;
+
+ MAKE_STD_ZVAL(soapvar);
+ object_init_ex(soapvar, soap_var_class_entry);
+ add_property_long(soapvar, "enc_type", enc->details.type);
+ Z_DELREF_P(ret);
+ add_property_zval(soapvar, "enc_value", ret);
+ parse_namespace(type_name, &cptype, &ns);
+ nsptr = xmlSearchNs(data->doc, data, BAD_CAST(ns));
+ add_property_string(soapvar, "enc_stype", cptype, 1);
+ if (nsptr) {
+ add_property_string(soapvar, "enc_ns", (char*)nsptr->href, 1);
+ }
+ efree(cptype);
+ if (ns) {efree(ns);}
+ ret = soapvar;
+ }
+ return ret;
+}
+
+/* Time encode/decode */
+static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *format, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ /* logic hacked from ext/standard/datetime.c */
+ struct tm *ta, tmbuf;
+ time_t timestamp;
+ int max_reallocs = 5;
+ size_t buf_len=64, real_len;
+ char *buf;
+ char tzbuf[8];
+
+ xmlNodePtr xmlParam;
+
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, xmlParam);
+ FIND_ZVAL_NULL(data, xmlParam, style);
+
+ if (Z_TYPE_P(data) == IS_LONG) {
+ timestamp = Z_LVAL_P(data);
+ ta = php_localtime_r(&timestamp, &tmbuf);
+ /*ta = php_gmtime_r(&timestamp, &tmbuf);*/
+ if (!ta) {
+ soap_error1(E_ERROR, "Encoding: Invalid timestamp %ld", Z_LVAL_P(data));
+ }
+
+ buf = (char *) emalloc(buf_len);
+ while ((real_len = strftime(buf, buf_len, format, ta)) == buf_len || real_len == 0) {
+ buf_len *= 2;
+ buf = (char *) erealloc(buf, buf_len);
+ if (!--max_reallocs) break;
+ }
+
+ /* Time zone support */
+#ifdef HAVE_TM_GMTOFF
+ snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", (ta->tm_gmtoff < 0) ? '-' : '+', abs(ta->tm_gmtoff / 3600), abs( (ta->tm_gmtoff % 3600) / 60 ));
+#else
+# if defined(__CYGWIN__) || defined(NETWARE)
+ snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", ((ta->tm_isdst ? _timezone - 3600:_timezone)>0)?'-':'+', abs((ta->tm_isdst ? _timezone - 3600 : _timezone) / 3600), abs(((ta->tm_isdst ? _timezone - 3600 : _timezone) % 3600) / 60));
+# else
+ snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+', abs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), abs(((ta->tm_isdst ? timezone - 3600 : timezone) % 3600) / 60));
+# endif
+#endif
+ if (strcmp(tzbuf,"+00:00") == 0) {
+ strcpy(tzbuf,"Z");
+ real_len++;
+ } else {
+ real_len += 6;
+ }
+ if (real_len >= buf_len) {
+ buf = (char *) erealloc(buf, real_len+1);
+ }
+ strcat(buf, tzbuf);
+
+ xmlNodeSetContent(xmlParam, BAD_CAST(buf));
+ efree(buf);
+ } else if (Z_TYPE_P(data) == IS_STRING) {
+ xmlNodeSetContentLen(xmlParam, BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data));
+ }
+
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(xmlParam, type);
+ }
+ return xmlParam;
+}
+
+static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ /* TODO: '-'?P([0-9]+Y)?([0-9]+M)?([0-9]+D)?T([0-9]+H)?([0-9]+M)?([0-9]+S)? */
+ return to_xml_string(type, data, style, parent TSRMLS_CC);
+}
+
+static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ return to_xml_datetime_ex(type, data, "%Y-%m-%dT%H:%M:%S", style, parent TSRMLS_CC);
+}
+
+static xmlNodePtr to_xml_time(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ /* TODO: microsecconds */
+ return to_xml_datetime_ex(type, data, "%H:%M:%S", style, parent TSRMLS_CC);
+}
+
+static xmlNodePtr to_xml_date(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ return to_xml_datetime_ex(type, data, "%Y-%m-%d", style, parent TSRMLS_CC);
+}
+
+static xmlNodePtr to_xml_gyearmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ return to_xml_datetime_ex(type, data, "%Y-%m", style, parent TSRMLS_CC);
+}
+
+static xmlNodePtr to_xml_gyear(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ return to_xml_datetime_ex(type, data, "%Y", style, parent TSRMLS_CC);
+}
+
+static xmlNodePtr to_xml_gmonthday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ return to_xml_datetime_ex(type, data, "--%m-%d", style, parent TSRMLS_CC);
+}
+
+static xmlNodePtr to_xml_gday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ return to_xml_datetime_ex(type, data, "---%d", style, parent TSRMLS_CC);
+}
+
+static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ return to_xml_datetime_ex(type, data, "--%m--", style, parent TSRMLS_CC);
+}
+
+static zval* to_zval_list(encodeTypePtr enc, xmlNodePtr data TSRMLS_DC) {
+ /*FIXME*/
+ return to_zval_stringc(enc, data TSRMLS_CC);
+}
+
+static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC) {
+ xmlNodePtr ret;
+ encodePtr list_enc = NULL;
+
+ if (enc->sdl_type && enc->sdl_type->kind == XSD_TYPEKIND_LIST && enc->sdl_type->elements) {
+ sdlTypePtr *type;
+
+ zend_hash_internal_pointer_reset(enc->sdl_type->elements);
+ if (zend_hash_get_current_data(enc->sdl_type->elements, (void**)&type) == SUCCESS) {
+ list_enc = (*type)->encode;
+ }
+ }
+
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlAddChild(parent, ret);
+ FIND_ZVAL_NULL(data, ret, style);
+ if (Z_TYPE_P(data) == IS_ARRAY) {
+ zval **tmp;
+ smart_str list = {0};
+ HashTable *ht = Z_ARRVAL_P(data);
+
+ zend_hash_internal_pointer_reset(ht);
+ while (zend_hash_get_current_data(ht, (void**)&tmp) == SUCCESS) {
+ xmlNodePtr dummy = master_to_xml(list_enc, *tmp, SOAP_LITERAL, ret TSRMLS_CC);
+ if (dummy && dummy->children && dummy->children->content) {
+ if (list.len != 0) {
+ smart_str_appendc(&list, ' ');
+ }
+ smart_str_appends(&list, (char*)dummy->children->content);
+ } else {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ xmlUnlinkNode(dummy);
+ xmlFreeNode(dummy);
+ zend_hash_move_forward(ht);
+ }
+ smart_str_0(&list);
+ xmlNodeSetContentLen(ret, BAD_CAST(list.c), list.len);
+ smart_str_free(&list);
+ } else {
+ zval tmp = *data;
+ char *str, *start, *next;
+ smart_str list = {0};
+
+ if (Z_TYPE_P(data) != IS_STRING) {
+ zval_copy_ctor(&tmp);
+ convert_to_string(&tmp);
+ data = &tmp;
+ }
+ str = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data));
+ whiteSpace_collapse(BAD_CAST(str));
+ start = str;
+ while (start != NULL && *start != '\0') {
+ xmlNodePtr dummy;
+ zval dummy_zval;
+
+ next = strchr(start,' ');
+ if (next != NULL) {
+ *next = '\0';
+ next++;
+ }
+ ZVAL_STRING(&dummy_zval, start, 0);
+ dummy = master_to_xml(list_enc, &dummy_zval, SOAP_LITERAL, ret TSRMLS_CC);
+ if (dummy && dummy->children && dummy->children->content) {
+ if (list.len != 0) {
+ smart_str_appendc(&list, ' ');
+ }
+ smart_str_appends(&list, (char*)dummy->children->content);
+ } else {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ }
+ xmlUnlinkNode(dummy);
+ xmlFreeNode(dummy);
+
+ start = next;
+ }
+ smart_str_0(&list);
+ xmlNodeSetContentLen(ret, BAD_CAST(list.c), list.len);
+ smart_str_free(&list);
+ efree(str);
+ if (data == &tmp) {zval_dtor(&tmp);}
+ }
+ return ret;
+}
+
+static xmlNodePtr to_xml_list1(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC) {
+ /*FIXME: minLength=1 */
+ return to_xml_list(enc,data,style, parent TSRMLS_CC);
+}
+
+static zval* to_zval_union(encodeTypePtr enc, xmlNodePtr data TSRMLS_DC) {
+ /*FIXME*/
+ return to_zval_list(enc, data TSRMLS_CC);
+}
+
+static xmlNodePtr to_xml_union(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC) {
+ /*FIXME*/
+ return to_xml_list(enc,data,style, parent TSRMLS_CC);
+}
+
+static zval *to_zval_any(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+{
+ xmlBufferPtr buf;
+ zval *ret;
+
+ if (SOAP_GLOBAL(sdl) && SOAP_GLOBAL(sdl)->elements && data->name) {
+ smart_str nscat = {0};
+ sdlTypePtr *sdl_type;
+
+ if (data->ns && data->ns->href) {
+ smart_str_appends(&nscat, (char*)data->ns->href);
+ smart_str_appendc(&nscat, ':');
+ }
+ smart_str_appends(&nscat, (char*)data->name);
+ smart_str_0(&nscat);
+
+ if (zend_hash_find(SOAP_GLOBAL(sdl)->elements, nscat.c, nscat.len+1, (void **)&sdl_type) == SUCCESS &&
+ (*sdl_type)->encode) {
+ smart_str_free(&nscat);
+ return master_to_zval_int((*sdl_type)->encode, data TSRMLS_CC);
+ }
+ smart_str_free(&nscat);
+ }
+
+ buf = xmlBufferCreate();
+ xmlNodeDump(buf, NULL, data, 0, 0);
+ MAKE_STD_ZVAL(ret);
+ ZVAL_STRING(ret, (char*)xmlBufferContent(buf), 1);
+ xmlBufferFree(buf);
+ return ret;
+}
+
+static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ xmlNodePtr ret = NULL;
+
+ if (Z_TYPE_P(data) == IS_ARRAY) {
+ HashPosition pos;
+ zval **el;
+ encodePtr enc = get_conversion(XSD_ANYXML);
+ char *name;
+ uint name_len;
+ ulong idx;
+
+ for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(data), &pos);
+ zend_hash_get_current_data_ex(Z_ARRVAL_P(data), (void **) &el, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(Z_ARRVAL_P(data), &pos)) {
+ ret = master_to_xml(enc, *el, style, parent TSRMLS_CC);
+ if (ret &&
+ ret->name != xmlStringTextNoenc &&
+ zend_hash_get_current_key_ex(Z_ARRVAL_P(data), &name, &name_len, &idx, 0, &pos) == HASH_KEY_IS_STRING) {
+ xmlNodeSetName(ret, BAD_CAST(name));
+ }
+ }
+ return ret;
+ }
+ if (Z_TYPE_P(data) == IS_STRING) {
+ ret = xmlNewTextLen(BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data));
+ } else {
+ zval tmp = *data;
+
+ zval_copy_ctor(&tmp);
+ convert_to_string(&tmp);
+ ret = xmlNewTextLen(BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp));
+ zval_dtor(&tmp);
+ }
+
+ ret->name = xmlStringTextNoenc;
+ ret->parent = parent;
+ ret->doc = parent->doc;
+ ret->prev = parent->last;
+ ret->next = NULL;
+ if (parent->last) {
+ parent->last->next = ret;
+ } else {
+ parent->children = ret;
+ }
+ parent->last = ret;
+
+ return ret;
+}
+
+zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data TSRMLS_DC)
+{
+ sdlTypePtr type;
+
+ type = enc->sdl_type;
+ if (type == NULL) {
+ return guess_zval_convert(enc, data TSRMLS_CC);
+ }
+/*FIXME: restriction support
+ if (type && type->restrictions &&
+ data && data->children && data->children->content) {
+ if (type->restrictions->whiteSpace && type->restrictions->whiteSpace->value) {
+ if (strcmp(type->restrictions->whiteSpace->value,"replace") == 0) {
+ whiteSpace_replace(data->children->content);
+ } else if (strcmp(type->restrictions->whiteSpace->value,"collapse") == 0) {
+ whiteSpace_collapse(data->children->content);
+ }
+ }
+ if (type->restrictions->enumeration) {
+ if (!zend_hash_exists(type->restrictions->enumeration,data->children->content,strlen(data->children->content)+1)) {
+ soap_error1(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\"", data->children->content);
+ }
+ }
+ if (type->restrictions->minLength &&
+ strlen(data->children->content) < type->restrictions->minLength->value) {
+ soap_error0(E_WARNING, "Encoding: Restriction: length less than 'minLength'");
+ }
+ if (type->restrictions->maxLength &&
+ strlen(data->children->content) > type->restrictions->maxLength->value) {
+ soap_error0(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'");
+ }
+ if (type->restrictions->length &&
+ strlen(data->children->content) != type->restrictions->length->value) {
+ soap_error0(E_WARNING, "Encoding: Restriction: length is not equal to 'length'");
+ }
+ }
+*/
+ switch (type->kind) {
+ case XSD_TYPEKIND_SIMPLE:
+ if (type->encode && enc != &type->encode->details) {
+ return master_to_zval_int(type->encode, data TSRMLS_CC);
+ } else {
+ return guess_zval_convert(enc, data TSRMLS_CC);
+ }
+ break;
+ case XSD_TYPEKIND_LIST:
+ return to_zval_list(enc, data TSRMLS_CC);
+ case XSD_TYPEKIND_UNION:
+ return to_zval_union(enc, data TSRMLS_CC);
+ case XSD_TYPEKIND_COMPLEX:
+ case XSD_TYPEKIND_RESTRICTION:
+ case XSD_TYPEKIND_EXTENSION:
+ if (type->encode &&
+ (type->encode->details.type == IS_ARRAY ||
+ type->encode->details.type == SOAP_ENC_ARRAY)) {
+ return to_zval_array(enc, data TSRMLS_CC);
+ }
+ return to_zval_object(enc, data TSRMLS_CC);
+ default:
+ soap_error0(E_ERROR, "Encoding: Internal Error");
+ return guess_zval_convert(enc, data TSRMLS_CC);
+ }
+}
+
+xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ sdlTypePtr type;
+ xmlNodePtr ret = NULL;
+
+ type = enc->sdl_type;
+
+ if (type == NULL) {
+ ret = guess_xml_convert(enc, data, style, parent TSRMLS_CC);
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(ret, enc);
+ }
+ return ret;
+ }
+/*FIXME: restriction support
+ if (type) {
+ if (type->restrictions && Z_TYPE_P(data) == IS_STRING) {
+ if (type->restrictions->enumeration) {
+ if (!zend_hash_exists(type->restrictions->enumeration,Z_STRVAL_P(data),Z_STRLEN_P(data)+1)) {
+ soap_error1(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\".", Z_STRVAL_P(data));
+ }
+ }
+ if (type->restrictions->minLength &&
+ Z_STRLEN_P(data) < type->restrictions->minLength->value) {
+ soap_error0(E_WARNING, "Encoding: Restriction: length less than 'minLength'");
+ }
+ if (type->restrictions->maxLength &&
+ Z_STRLEN_P(data) > type->restrictions->maxLength->value) {
+ soap_error0(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'");
+ }
+ if (type->restrictions->length &&
+ Z_STRLEN_P(data) != type->restrictions->length->value) {
+ soap_error0(E_WARNING, "Encoding: Restriction: length is not equal to 'length'");
+ }
+ }
+ }
+*/
+ switch(type->kind) {
+ case XSD_TYPEKIND_SIMPLE:
+ if (type->encode && enc != &type->encode->details) {
+ ret = master_to_xml(type->encode, data, style, parent TSRMLS_CC);
+ } else {
+ ret = guess_xml_convert(enc, data, style, parent TSRMLS_CC);
+ }
+ break;
+ case XSD_TYPEKIND_LIST:
+ ret = to_xml_list(enc, data, style, parent TSRMLS_CC);
+ break;
+ case XSD_TYPEKIND_UNION:
+ ret = to_xml_union(enc, data, style, parent TSRMLS_CC);
+ break;
+ case XSD_TYPEKIND_COMPLEX:
+ case XSD_TYPEKIND_RESTRICTION:
+ case XSD_TYPEKIND_EXTENSION:
+ if (type->encode &&
+ (type->encode->details.type == IS_ARRAY ||
+ type->encode->details.type == SOAP_ENC_ARRAY)) {
+ return to_xml_array(enc, data, style, parent TSRMLS_CC);
+ } else {
+ return to_xml_object(enc, data, style, parent TSRMLS_CC);
+ }
+ break;
+ default:
+ soap_error0(E_ERROR, "Encoding: Internal Error");
+ break;
+ }
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(ret, enc);
+ }
+ return ret;
+}
+
+static xmlNodePtr check_and_resolve_href(xmlNodePtr data)
+{
+ if (data && data->properties) {
+ xmlAttrPtr href;
+
+ href = data->properties;
+ while (1) {
+ href = get_attribute(href, "href");
+ if (href == NULL || href->ns == NULL) {break;}
+ href = href->next;
+ }
+ if (href) {
+ /* Internal href try and find node */
+ if (href->children->content[0] == '#') {
+ xmlNodePtr ret = get_node_with_attribute_recursive(data->doc->children, NULL, "id", (char*)&href->children->content[1]);
+ if (!ret) {
+ soap_error1(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content);
+ }
+ return ret;
+ } else {
+ /* TODO: External href....? */
+ soap_error1(E_ERROR, "Encoding: External reference '%s'", href->children->content);
+ }
+ }
+ /* SOAP 1.2 enc:id enc:ref */
+ href = get_attribute_ex(data->properties, "ref", SOAP_1_2_ENC_NAMESPACE);
+ if (href) {
+ xmlChar* id;
+ xmlNodePtr ret;
+
+ if (href->children->content[0] == '#') {
+ id = href->children->content+1;
+ } else {
+ id = href->children->content;
+ }
+ ret = get_node_with_attribute_recursive_ex(data->doc->children, NULL, NULL, "id", (char*)id, SOAP_1_2_ENC_NAMESPACE);
+ if (!ret) {
+ soap_error1(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content);
+ } else if (ret == data) {
+ soap_error1(E_ERROR, "Encoding: Violation of id and ref information items '%s'", href->children->content);
+ }
+ return ret;
+ }
+ }
+ return data;
+}
+
+static void set_ns_and_type(xmlNodePtr node, encodeTypePtr type)
+{
+ set_ns_and_type_ex(node, type->ns, type->type_str);
+}
+
+static void set_ns_and_type_ex(xmlNodePtr node, char *ns, char *type)
+{
+ smart_str nstype = {0};
+ get_type_str(node, ns, type, &nstype);
+ set_xsi_type(node, nstype.c);
+ smart_str_free(&nstype);
+}
+
+static xmlNsPtr xmlSearchNsPrefixByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href)
+{
+ xmlNsPtr cur;
+ xmlNodePtr orig = node;
+
+ while (node) {
+ if (node->type == XML_ENTITY_REF_NODE ||
+ node->type == XML_ENTITY_NODE ||
+ node->type == XML_ENTITY_DECL) {
+ return NULL;
+ }
+ if (node->type == XML_ELEMENT_NODE) {
+ cur = node->nsDef;
+ while (cur != NULL) {
+ if (cur->prefix && cur->href && xmlStrEqual(cur->href, href)) {
+ if (xmlSearchNs(doc, node, cur->prefix) == cur) {
+ return cur;
+ }
+ }
+ cur = cur->next;
+ }
+ if (orig != node) {
+ cur = node->ns;
+ if (cur != NULL) {
+ if (cur->prefix && cur->href && xmlStrEqual(cur->href, href)) {
+ if (xmlSearchNs(doc, node, cur->prefix) == cur) {
+ return cur;
+ }
+ }
+ }
+ }
+ }
+ node = node->parent;
+ }
+ return NULL;
+}
+
+xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns)
+{
+ xmlNsPtr xmlns;
+
+ if (ns == NULL) {
+ return NULL;
+ }
+
+ xmlns = xmlSearchNsByHref(node->doc, node, BAD_CAST(ns));
+ if (xmlns != NULL && xmlns->prefix == NULL) {
+ xmlns = xmlSearchNsPrefixByHref(node->doc, node, BAD_CAST(ns));
+ }
+ if (xmlns == NULL) {
+ xmlChar* prefix;
+ TSRMLS_FETCH();
+
+ if (zend_hash_find(&SOAP_GLOBAL(defEncNs), (char*)ns, strlen(ns) + 1, (void **)&prefix) == SUCCESS) {
+ xmlns = xmlNewNs(node->doc->children, BAD_CAST(ns), prefix);
+ } else {
+ smart_str prefix = {0};
+ int num = ++SOAP_GLOBAL(cur_uniq_ns);
+
+ while (1) {
+ smart_str_appendl(&prefix, "ns", 2);
+ smart_str_append_long(&prefix, num);
+ smart_str_0(&prefix);
+ if (xmlSearchNs(node->doc, node, BAD_CAST(prefix.c)) == NULL) {
+ break;
+ }
+ smart_str_free(&prefix);
+ prefix.c = NULL;
+ prefix.len = 0;
+ num = ++SOAP_GLOBAL(cur_uniq_ns);
+ }
+
+ xmlns = xmlNewNs(node->doc->children, BAD_CAST(ns), BAD_CAST(prefix.c));
+ smart_str_free(&prefix);
+ }
+ }
+ return xmlns;
+}
+
+static void set_ns_prop(xmlNodePtr node, char *ns, char *name, char *val)
+{
+ xmlSetNsProp(node, encode_add_ns(node, ns), BAD_CAST(name), BAD_CAST(val));
+}
+
+static void set_xsi_nil(xmlNodePtr node)
+{
+ set_ns_prop(node, XSI_NAMESPACE, "nil", "true");
+}
+
+static void set_xsi_type(xmlNodePtr node, char *type)
+{
+ set_ns_prop(node, XSI_NAMESPACE, "type", type);
+}
+
+void encode_reset_ns()
+{
+ TSRMLS_FETCH();
+ SOAP_GLOBAL(cur_uniq_ns) = 0;
+ SOAP_GLOBAL(cur_uniq_ref) = 0;
+ if (SOAP_GLOBAL(ref_map)) {
+ zend_hash_destroy(SOAP_GLOBAL(ref_map));
+ } else {
+ SOAP_GLOBAL(ref_map) = emalloc(sizeof(HashTable));
+ }
+ zend_hash_init(SOAP_GLOBAL(ref_map), 0, NULL, NULL, 0);
+}
+
+void encode_finish()
+{
+ TSRMLS_FETCH();
+ SOAP_GLOBAL(cur_uniq_ns) = 0;
+ SOAP_GLOBAL(cur_uniq_ref) = 0;
+ if (SOAP_GLOBAL(ref_map)) {
+ zend_hash_destroy(SOAP_GLOBAL(ref_map));
+ efree(SOAP_GLOBAL(ref_map));
+ SOAP_GLOBAL(ref_map) = NULL;
+ }
+}
+
+encodePtr get_conversion(int encode)
+{
+ encodePtr *enc = NULL;
+ TSRMLS_FETCH();
+
+ if (zend_hash_index_find(&SOAP_GLOBAL(defEncIndex), encode, (void **)&enc) == FAILURE) {
+ soap_error0(E_ERROR, "Encoding: Cannot find encoding");
+ return NULL;
+ } else {
+ return *enc;
+ }
+}
+
+static int is_map(zval *array)
+{
+ int i, count = zend_hash_num_elements(Z_ARRVAL_P(array));
+
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(array));
+ for (i = 0; i < count; i++) {
+ char *str_index;
+ ulong num_index;
+
+ if (zend_hash_get_current_key(Z_ARRVAL_P(array), &str_index, &num_index, 0) == HASH_KEY_IS_STRING ||
+ num_index != i) {
+ return TRUE;
+ }
+ zend_hash_move_forward(Z_ARRVAL_P(array));
+ }
+ return FALSE;
+}
+
+static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type TSRMLS_DC)
+{
+ HashTable *ht;
+ int i, count, cur_type, prev_type, different;
+ zval **tmp;
+ char *prev_stype = NULL, *cur_stype = NULL, *prev_ns = NULL, *cur_ns = NULL;
+
+ if (!array || Z_TYPE_P(array) != IS_ARRAY) {
+ smart_str_appendl(type, "xsd:anyType", sizeof("xsd:anyType")-1);
+ return get_conversion(XSD_ANYTYPE);
+ }
+
+ different = FALSE;
+ cur_type = prev_type = 0;
+ ht = HASH_OF(array);
+ count = zend_hash_num_elements(ht);
+
+ zend_hash_internal_pointer_reset(ht);
+ for (i = 0;i < count;i++) {
+ zend_hash_get_current_data(ht, (void **)&tmp);
+
+ if (Z_TYPE_PP(tmp) == IS_OBJECT &&
+ Z_OBJCE_PP(tmp) == soap_var_class_entry) {
+ zval **ztype;
+
+ if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_type", sizeof("enc_type"), (void **)&ztype) == FAILURE) {
+ soap_error0(E_ERROR, "Encoding: SoapVar has no 'enc_type' property");
+ }
+ cur_type = Z_LVAL_PP(ztype);
+
+ if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_stype", sizeof("enc_stype"), (void **)&ztype) == SUCCESS) {
+ cur_stype = Z_STRVAL_PP(ztype);
+ } else {
+ cur_stype = NULL;
+ }
+
+ if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_ns", sizeof("enc_ns"), (void **)&ztype) == SUCCESS) {
+ cur_ns = Z_STRVAL_PP(ztype);
+ } else {
+ cur_ns = NULL;
+ }
+
+ } else if (Z_TYPE_PP(tmp) == IS_ARRAY && is_map(*tmp)) {
+ cur_type = APACHE_MAP;
+ cur_stype = NULL;
+ cur_ns = NULL;
+ } else {
+ cur_type = Z_TYPE_PP(tmp);
+ cur_stype = NULL;
+ cur_ns = NULL;
+ }
+
+ if (i > 0) {
+ if ((cur_type != prev_type) ||
+ (cur_stype != NULL && prev_stype != NULL && strcmp(cur_stype,prev_stype) != 0) ||
+ (cur_stype == NULL && cur_stype != prev_stype) ||
+ (cur_ns != NULL && prev_ns != NULL && strcmp(cur_ns,prev_ns) != 0) ||
+ (cur_ns == NULL && cur_ns != prev_ns)) {
+ different = TRUE;
+ break;
+ }
+ }
+
+ prev_type = cur_type;
+ prev_stype = cur_stype;
+ prev_ns = cur_ns;
+ zend_hash_move_forward(ht);
+ }
+
+ if (different || count == 0) {
+ smart_str_appendl(type, "xsd:anyType", sizeof("xsd:anyType")-1);
+ return get_conversion(XSD_ANYTYPE);
+ } else {
+ encodePtr enc;
+
+ if (cur_stype != NULL) {
+ smart_str array_type = {0};
+
+ if (cur_ns) {
+ xmlNsPtr ns = encode_add_ns(node, cur_ns);
+
+ smart_str_appends(type, (char*)ns->prefix);
+ smart_str_appendc(type, ':');
+ smart_str_appends(&array_type, cur_ns);
+ smart_str_appendc(&array_type, ':');
+ }
+ smart_str_appends(type, cur_stype);
+ smart_str_0(type);
+ smart_str_appends(&array_type, cur_stype);
+ smart_str_0(&array_type);
+
+ enc = get_encoder_ex(SOAP_GLOBAL(sdl), array_type.c, array_type.len);
+ smart_str_free(&array_type);
+ return enc;
+ } else {
+ enc = get_conversion(cur_type);
+ get_type_str(node, enc->details.ns, enc->details.type_str, type);
+ return enc;
+ }
+ }
+}
+
+static void get_type_str(xmlNodePtr node, const char* ns, const char* type, smart_str* ret)
+{
+ TSRMLS_FETCH();
+
+ if (ns) {
+ xmlNsPtr xmlns;
+ if (SOAP_GLOBAL(soap_version) == SOAP_1_2 &&
+ strcmp(ns,SOAP_1_1_ENC_NAMESPACE) == 0) {
+ ns = SOAP_1_2_ENC_NAMESPACE;
+ } else if (SOAP_GLOBAL(soap_version) == SOAP_1_1 &&
+ strcmp(ns,SOAP_1_2_ENC_NAMESPACE) == 0) {
+ ns = SOAP_1_1_ENC_NAMESPACE;
+ }
+ xmlns = encode_add_ns(node, ns);
+ smart_str_appends(ret, (char*)xmlns->prefix);
+ smart_str_appendc(ret, ':');
+ }
+ smart_str_appendl(ret, type, strlen(type));
+ smart_str_0(ret);
+}
+
+static void delete_mapping(void *data)
+{
+ soapMappingPtr map = (soapMappingPtr)data;
+
+ if (map->to_xml) {
+ zval_ptr_dtor(&map->to_xml);
+ }
+ if (map->to_zval) {
+ zval_ptr_dtor(&map->to_zval);
+ }
+ efree(map);
+}
+
+void delete_encoder(void *encode)
+{
+ encodePtr t = *((encodePtr*)encode);
+ if (t->details.ns) {
+ efree(t->details.ns);
+ }
+ if (t->details.type_str) {
+ efree(t->details.type_str);
+ }
+ if (t->details.map) {
+ delete_mapping(t->details.map);
+ }
+ efree(t);
+}
+
+void delete_encoder_persistent(void *encode)
+{
+ encodePtr t = *((encodePtr*)encode);
+ if (t->details.ns) {
+ free(t->details.ns);
+ }
+ if (t->details.type_str) {
+ free(t->details.type_str);
+ }
+ /* we should never have mapping in persistent encoder */
+ assert(t->details.map == NULL);
+ free(t);
+}
diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h
new file mode 100644
index 0000000..31a8469
--- /dev/null
+++ b/ext/soap/php_encoding.h
@@ -0,0 +1,216 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#ifndef PHP_ENCODING_H
+#define PHP_ENCODING_H
+
+#define XSD_1999_NAMESPACE "http://www.w3.org/1999/XMLSchema"
+#define XSD_1999_TIMEINSTANT 401
+#define XSD_1999_TIMEINSTANT_STRING "timeInstant"
+
+#define SOAP_1_1_ENV_NAMESPACE "http://schemas.xmlsoap.org/soap/envelope/"
+#define SOAP_1_1_ENV_NS_PREFIX "SOAP-ENV"
+
+#define SOAP_1_2_ENV_NAMESPACE "http://www.w3.org/2003/05/soap-envelope"
+#define SOAP_1_2_ENV_NS_PREFIX "env"
+
+#define SOAP_1_1_ENC_NAMESPACE "http://schemas.xmlsoap.org/soap/encoding/"
+#define SOAP_1_1_ENC_NS_PREFIX "SOAP-ENC"
+
+#define SOAP_1_2_ENC_NAMESPACE "http://www.w3.org/2003/05/soap-encoding"
+#define SOAP_1_2_ENC_NS_PREFIX "enc"
+
+#define SCHEMA_NAMESPACE "http://www.w3.org/2001/XMLSchema"
+#define XSD_NAMESPACE "http://www.w3.org/2001/XMLSchema"
+#define XSD_NS_PREFIX "xsd"
+#define XSI_NAMESPACE "http://www.w3.org/2001/XMLSchema-instance"
+#define XSI_NS_PREFIX "xsi"
+#define XML_NAMESPACE "http://www.w3.org/XML/1998/namespace"
+#define XML_NS_PREFIX "xml"
+
+#define XSD_STRING 101
+#define XSD_STRING_STRING "string"
+#define XSD_BOOLEAN 102
+#define XSD_BOOLEAN_STRING "boolean"
+#define XSD_DECIMAL 103
+#define XSD_DECIMAL_STRING "decimal"
+#define XSD_FLOAT 104
+#define XSD_FLOAT_STRING "float"
+#define XSD_DOUBLE 105
+#define XSD_DOUBLE_STRING "double"
+#define XSD_DURATION 106
+#define XSD_DURATION_STRING "duration"
+#define XSD_DATETIME 107
+#define XSD_DATETIME_STRING "dateTime"
+#define XSD_TIME 108
+#define XSD_TIME_STRING "time"
+#define XSD_DATE 109
+#define XSD_DATE_STRING "date"
+#define XSD_GYEARMONTH 110
+#define XSD_GYEARMONTH_STRING "gYearMonth"
+#define XSD_GYEAR 111
+#define XSD_GYEAR_STRING "gYear"
+#define XSD_GMONTHDAY 112
+#define XSD_GMONTHDAY_STRING "gMonthDay"
+#define XSD_GDAY 113
+#define XSD_GDAY_STRING "gDay"
+#define XSD_GMONTH 114
+#define XSD_GMONTH_STRING "gMonth"
+#define XSD_HEXBINARY 115
+#define XSD_HEXBINARY_STRING "hexBinary"
+#define XSD_BASE64BINARY 116
+#define XSD_BASE64BINARY_STRING "base64Binary"
+#define XSD_ANYURI 117
+#define XSD_ANYURI_STRING "anyURI"
+#define XSD_QNAME 118
+#define XSD_QNAME_STRING "QName"
+#define XSD_NOTATION 119
+#define XSD_NOTATION_STRING "NOTATION"
+#define XSD_NORMALIZEDSTRING 120
+#define XSD_NORMALIZEDSTRING_STRING "normalizedString"
+#define XSD_TOKEN 121
+#define XSD_TOKEN_STRING "token"
+#define XSD_LANGUAGE 122
+#define XSD_LANGUAGE_STRING "language"
+#define XSD_NMTOKEN 123
+#define XSD_NMTOKEN_STRING "NMTOKEN"
+#define XSD_NAME 124
+#define XSD_NAME_STRING "Name"
+#define XSD_NCNAME 125
+#define XSD_NCNAME_STRING "NCName"
+#define XSD_ID 126
+#define XSD_ID_STRING "ID"
+#define XSD_IDREF 127
+#define XSD_IDREF_STRING "IDREF"
+#define XSD_IDREFS 128
+#define XSD_IDREFS_STRING "IDREFS"
+#define XSD_ENTITY 129
+#define XSD_ENTITY_STRING "ENTITY"
+#define XSD_ENTITIES 130
+#define XSD_ENTITIES_STRING "ENTITIES"
+#define XSD_INTEGER 131
+#define XSD_INTEGER_STRING "integer"
+#define XSD_NONPOSITIVEINTEGER 132
+#define XSD_NONPOSITIVEINTEGER_STRING "nonPositiveInteger"
+#define XSD_NEGATIVEINTEGER 133
+#define XSD_NEGATIVEINTEGER_STRING "negativeInteger"
+#define XSD_LONG 134
+#define XSD_LONG_STRING "long"
+#define XSD_INT 135
+#define XSD_INT_STRING "int"
+#define XSD_SHORT 136
+#define XSD_SHORT_STRING "short"
+#define XSD_BYTE 137
+#define XSD_BYTE_STRING "byte"
+#define XSD_NONNEGATIVEINTEGER 138
+#define XSD_NONNEGATIVEINTEGER_STRING "nonNegativeInteger"
+#define XSD_UNSIGNEDLONG 139
+#define XSD_UNSIGNEDLONG_STRING "unsignedLong"
+#define XSD_UNSIGNEDINT 140
+#define XSD_UNSIGNEDINT_STRING "unsignedInt"
+#define XSD_UNSIGNEDSHORT 141
+#define XSD_UNSIGNEDSHORT_STRING "unsignedShort"
+#define XSD_UNSIGNEDBYTE 142
+#define XSD_UNSIGNEDBYTE_STRING "unsignedByte"
+#define XSD_POSITIVEINTEGER 143
+#define XSD_POSITIVEINTEGER_STRING "positiveInteger"
+#define XSD_NMTOKENS 144
+#define XSD_NMTOKENS_STRING "NMTOKENS"
+#define XSD_ANYTYPE 145
+#define XSD_ANYTYPE_STRING "anyType"
+#define XSD_UR_TYPE 146
+#define XSD_UR_TYPE_STRING "ur-type"
+
+#define XSD_ANYXML 147
+
+#define APACHE_NAMESPACE "http://xml.apache.org/xml-soap"
+#define APACHE_MAP 200
+#define APACHE_MAP_STRING "Map"
+
+#define SOAP_ENC_ARRAY 300
+#define SOAP_ENC_ARRAY_STRING "Array"
+#define SOAP_ENC_OBJECT 301
+#define SOAP_ENC_OBJECT_STRING "Struct"
+
+#define WSDL_NAMESPACE "http://schemas.xmlsoap.org/wsdl/"
+#define WSDL_NS_PREFIX "wsdl"
+
+#define WSDL_SOAP11_NAMESPACE "http://schemas.xmlsoap.org/wsdl/soap/"
+#define WSDL_SOAP12_NAMESPACE "http://schemas.xmlsoap.org/wsdl/soap12/"
+#define RPC_SOAP12_NAMESPACE "http://www.w3.org/2003/05/soap-rpc"
+#define RPC_SOAP12_NS_PREFIX "rpc"
+
+#define WSDL_HTTP11_NAMESPACE "http://schemas.xmlsoap.org/wsdl/http/"
+#define WSDL_HTTP12_NAMESPACE "http://www.w3.org/2003/05/soap/bindings/HTTP/"
+#define WSDL_HTTP_NS_PREFIX "http"
+
+#define WSDL_HTTP_TRANSPORT "http://schemas.xmlsoap.org/soap/http"
+
+#define WSDL_MIME_NAMESPACE "http://schemas.xmlsoap.org/wsdl/mime/"
+
+#define WSDL_DIME_NAMESPACE "http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
+#define WSDL_DIME_OPEN "http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout"
+#define WSDL_DIME_CLOSED "http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout"
+
+#define UNKNOWN_TYPE 999998
+#define END_KNOWN_TYPES 999999
+
+struct _encodeType {
+ int type;
+ char *type_str;
+ char *ns;
+ sdlTypePtr sdl_type;
+ soapMappingPtr map;
+};
+
+struct _encode {
+ encodeType details;
+ zval *(*to_zval)(encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
+ xmlNodePtr (*to_xml)(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+};
+
+/* Master functions all encode/decode should be called thur these functions */
+xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+zval *master_to_zval(encodePtr encode, xmlNodePtr data TSRMLS_DC);
+
+/* user defined mapping */
+xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+zval *to_zval_user(encodeTypePtr type, xmlNodePtr node TSRMLS_DC);
+
+void whiteSpace_replace(xmlChar* str);
+void whiteSpace_collapse(xmlChar* str);
+
+xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval* data, int style, xmlNodePtr parent TSRMLS_DC);
+zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data TSRMLS_DC);
+
+void encode_finish();
+void encode_reset_ns();
+xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns);
+
+encodePtr get_conversion(int encode);
+
+void delete_encoder(void *handle);
+void delete_encoder_persistent(void *handle);
+
+extern encode defaultEncoding[];
+extern int numDefaultEncodings;
+
+#endif
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
new file mode 100644
index 0000000..d83b85e
--- /dev/null
+++ b/ext/soap/php_http.c
@@ -0,0 +1,1466 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#include "php_soap.h"
+#include "ext/standard/base64.h"
+#include "ext/standard/md5.h"
+#include "ext/standard/php_rand.h"
+
+static char *get_http_header_value(char *headers, char *type);
+static int get_http_body(php_stream *socketd, int close, char *headers, char **response, int *out_size TSRMLS_DC);
+static int get_http_headers(php_stream *socketd,char **response, int *out_size TSRMLS_DC);
+
+#define smart_str_append_const(str, const) \
+ smart_str_appendl(str,const,sizeof(const)-1)
+
+/* Proxy HTTP Authentication */
+int proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC)
+{
+ zval **login, **password;
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_login", sizeof("_proxy_login"), (void **)&login) == SUCCESS) {
+ unsigned char* buf;
+ int len;
+ smart_str auth = {0};
+
+ smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login));
+ smart_str_appendc(&auth, ':');
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_password", sizeof("_proxy_password"), (void **)&password) == SUCCESS) {
+ smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password));
+ }
+ smart_str_0(&auth);
+ buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len);
+ smart_str_append_const(soap_headers, "Proxy-Authorization: Basic ");
+ smart_str_appendl(soap_headers, (char*)buf, len);
+ smart_str_append_const(soap_headers, "\r\n");
+ efree(buf);
+ smart_str_free(&auth);
+ return 1;
+ }
+ return 0;
+}
+
+/* HTTP Authentication */
+int basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC)
+{
+ zval **login, **password;
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_login", sizeof("_login"), (void **)&login) == SUCCESS &&
+ !zend_hash_exists(Z_OBJPROP_P(this_ptr), "_digest", sizeof("_digest"))) {
+ unsigned char* buf;
+ int len;
+ smart_str auth = {0};
+
+ smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login));
+ smart_str_appendc(&auth, ':');
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS) {
+ smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password));
+ }
+ smart_str_0(&auth);
+ buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len);
+ smart_str_append_const(soap_headers, "Authorization: Basic ");
+ smart_str_appendl(soap_headers, (char*)buf, len);
+ smart_str_append_const(soap_headers, "\r\n");
+ efree(buf);
+ smart_str_free(&auth);
+ return 1;
+ }
+ return 0;
+}
+
+/* Additional HTTP headers */
+void http_context_headers(php_stream_context* context,
+ zend_bool has_authorization,
+ zend_bool has_proxy_authorization,
+ zend_bool has_cookies,
+ smart_str* soap_headers TSRMLS_DC)
+{
+ zval **tmp;
+
+ if (context &&
+ php_stream_context_get_option(context, "http", "header", &tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING && Z_STRLEN_PP(tmp)) {
+ char *s = Z_STRVAL_PP(tmp);
+ char *p;
+ int name_len;
+
+ while (*s) {
+ /* skip leading newlines and spaces */
+ while (*s == ' ' || *s == '\t' || *s == '\r' || *s == '\n') {
+ s++;
+ }
+ /* extract header name */
+ p = s;
+ name_len = -1;
+ while (*p) {
+ if (*p == ':') {
+ if (name_len < 0) name_len = p - s;
+ break;
+ } else if (*p == ' ' || *p == '\t') {
+ if (name_len < 0) name_len = p - s;
+ } else if (*p == '\r' || *p == '\n') {
+ break;
+ }
+ p++;
+ }
+ if (*p == ':') {
+ /* extract header value */
+ while (*p && *p != '\r' && *p != '\n') {
+ p++;
+ }
+ /* skip some predefined headers */
+ if ((name_len != sizeof("host")-1 ||
+ strncasecmp(s, "host", sizeof("host")-1) != 0) &&
+ (name_len != sizeof("connection")-1 ||
+ strncasecmp(s, "connection", sizeof("connection")-1) != 0) &&
+ (name_len != sizeof("user-agent")-1 ||
+ strncasecmp(s, "user-agent", sizeof("user-agent")-1) != 0) &&
+ (name_len != sizeof("content-length")-1 ||
+ strncasecmp(s, "content-length", sizeof("content-length")-1) != 0) &&
+ (name_len != sizeof("content-type")-1 ||
+ strncasecmp(s, "content-type", sizeof("content-type")-1) != 0) &&
+ (!has_cookies ||
+ name_len != sizeof("cookie")-1 ||
+ strncasecmp(s, "cookie", sizeof("cookie")-1) != 0) &&
+ (!has_authorization ||
+ name_len != sizeof("authorization")-1 ||
+ strncasecmp(s, "authorization", sizeof("authorization")-1) != 0) &&
+ (!has_proxy_authorization ||
+ name_len != sizeof("proxy-authorization")-1 ||
+ strncasecmp(s, "proxy-authorization", sizeof("proxy-authorization")-1) != 0)) {
+ /* add header */
+ smart_str_appendl(soap_headers, s, p-s);
+ smart_str_append_const(soap_headers, "\r\n");
+ }
+ }
+ s = (*p) ? (p + 1) : p;
+ }
+ }
+}
+
+static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, php_stream_context *context, int *use_proxy TSRMLS_DC)
+{
+ php_stream *stream;
+ zval **proxy_host, **proxy_port, **tmp;
+ char *host;
+ char *name;
+ long namelen;
+ int port;
+ int old_error_reporting;
+ struct timeval tv;
+ struct timeval *timeout = NULL;
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_host", sizeof("_proxy_host"), (void **) &proxy_host) == SUCCESS &&
+ Z_TYPE_PP(proxy_host) == IS_STRING &&
+ zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_port", sizeof("_proxy_port"), (void **) &proxy_port) == SUCCESS &&
+ Z_TYPE_PP(proxy_port) == IS_LONG) {
+ host = Z_STRVAL_PP(proxy_host);
+ port = Z_LVAL_PP(proxy_port);
+ *use_proxy = 1;
+ } else {
+ host = phpurl->host;
+ port = phpurl->port;
+ }
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_connection_timeout", sizeof("_connection_timeout"), (void **) &tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_LONG && Z_LVAL_PP(tmp) > 0) {
+ tv.tv_sec = Z_LVAL_PP(tmp);
+ tv.tv_usec = 0;
+ timeout = &tv;
+ }
+
+ old_error_reporting = EG(error_reporting);
+ EG(error_reporting) &= ~(E_WARNING|E_NOTICE|E_USER_WARNING|E_USER_NOTICE);
+
+ namelen = spprintf(&name, 0, "%s://%s:%d", (use_ssl && !*use_proxy)? "ssl" : "tcp", host, port);
+
+ stream = php_stream_xport_create(name, namelen,
+ REPORT_ERRORS,
+ STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT,
+ NULL /*persistent_id*/,
+ timeout,
+ context,
+ NULL, NULL);
+ efree(name);
+
+ /* SSL & proxy */
+ if (stream && *use_proxy && use_ssl) {
+ smart_str soap_headers = {0};
+ char *http_headers;
+ int http_header_size;
+
+ smart_str_append_const(&soap_headers, "CONNECT ");
+ smart_str_appends(&soap_headers, phpurl->host);
+ smart_str_appendc(&soap_headers, ':');
+ smart_str_append_unsigned(&soap_headers, phpurl->port);
+ smart_str_append_const(&soap_headers, " HTTP/1.1\r\n");
+ smart_str_append_const(&soap_headers, "Host: ");
+ smart_str_appends(&soap_headers, phpurl->host);
+ if (phpurl->port != 80) {
+ smart_str_appendc(&soap_headers, ':');
+ smart_str_append_unsigned(&soap_headers, phpurl->port);
+ }
+ smart_str_append_const(&soap_headers, "\r\n");
+ proxy_authentication(this_ptr, &soap_headers TSRMLS_CC);
+ smart_str_append_const(&soap_headers, "\r\n");
+ if (php_stream_write(stream, soap_headers.c, soap_headers.len) != soap_headers.len) {
+ php_stream_close(stream);
+ stream = NULL;
+ }
+ smart_str_free(&soap_headers);
+
+ if (stream) {
+ if (!get_http_headers(stream, &http_headers, &http_header_size TSRMLS_CC) || http_headers == NULL) {
+ php_stream_close(stream);
+ stream = NULL;
+ }
+ if (http_headers) {
+ efree(http_headers);
+ }
+ }
+ /* enable SSL transport layer */
+ if (stream) {
+ if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 ||
+ php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) {
+ php_stream_close(stream);
+ stream = NULL;
+ }
+ }
+ }
+
+ EG(error_reporting) = old_error_reporting;
+ return stream;
+}
+
+static int in_domain(const char *host, const char *domain)
+{
+ if (domain[0] == '.') {
+ int l1 = strlen(host);
+ int l2 = strlen(domain);
+ if (l1 > l2) {
+ return strcmp(host+l1-l2,domain) == 0;
+ } else {
+ return 0;
+ }
+ } else {
+ return strcmp(host,domain) == 0;
+ }
+}
+
+int make_http_soap_request(zval *this_ptr,
+ char *buf,
+ int buf_size,
+ char *location,
+ char *soapaction,
+ int soap_version,
+ char **buffer,
+ int *buffer_len TSRMLS_DC)
+{
+ char *request;
+ smart_str soap_headers = {0};
+ smart_str soap_headers_z = {0};
+ int request_size, err;
+ php_url *phpurl = NULL;
+ php_stream *stream;
+ zval **trace, **tmp;
+ int use_proxy = 0;
+ int use_ssl;
+ char *http_headers, *http_body, *content_type, *http_version, *cookie_itt;
+ int http_header_size, http_body_size, http_close;
+ char *connection;
+ int http_1_1;
+ int http_status;
+ int content_type_xml = 0;
+ long redirect_max = 20;
+ char *content_encoding;
+ char *http_msg = NULL;
+ zend_bool old_allow_url_fopen;
+ php_stream_context *context = NULL;
+ zend_bool has_authorization = 0;
+ zend_bool has_proxy_authorization = 0;
+ zend_bool has_cookies = 0;
+
+ if (this_ptr == NULL || Z_TYPE_P(this_ptr) != IS_OBJECT) {
+ return FALSE;
+ }
+
+ request = buf;
+ request_size = buf_size;
+ /* Compress request */
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "compression", sizeof("compression"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG) {
+ int level = Z_LVAL_PP(tmp) & 0x0f;
+ int kind = Z_LVAL_PP(tmp) & SOAP_COMPRESSION_DEFLATE;
+
+ if (level > 9) {level = 9;}
+
+ if ((Z_LVAL_PP(tmp) & SOAP_COMPRESSION_ACCEPT) != 0) {
+ smart_str_append_const(&soap_headers_z,"Accept-Encoding: gzip, deflate\r\n");
+ }
+ if (level > 0) {
+ zval func;
+ zval retval;
+ zval param1, param2, param3;
+ zval *params[3];
+ int n;
+
+ params[0] = &param1;
+ INIT_PZVAL(params[0]);
+ params[1] = &param2;
+ INIT_PZVAL(params[1]);
+ params[2] = &param3;
+ INIT_PZVAL(params[2]);
+ ZVAL_STRINGL(params[0], buf, buf_size, 0);
+ ZVAL_LONG(params[1], level);
+ if (kind == SOAP_COMPRESSION_DEFLATE) {
+ n = 2;
+ ZVAL_STRING(&func, "gzcompress", 0);
+ smart_str_append_const(&soap_headers_z,"Content-Encoding: deflate\r\n");
+ } else {
+ n = 3;
+ ZVAL_STRING(&func, "gzencode", 0);
+ smart_str_append_const(&soap_headers_z,"Content-Encoding: gzip\r\n");
+ ZVAL_LONG(params[2], 0x1f);
+ }
+ if (call_user_function(CG(function_table), (zval**)NULL, &func, &retval, n, params TSRMLS_CC) == SUCCESS &&
+ Z_TYPE(retval) == IS_STRING) {
+ request = Z_STRVAL(retval);
+ request_size = Z_STRLEN(retval);
+ } else {
+ if (request != buf) {efree(request);}
+ smart_str_free(&soap_headers_z);
+ return FALSE;
+ }
+ }
+ }
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket"), (void **)&tmp) == SUCCESS) {
+ php_stream_from_zval_no_verify(stream,tmp);
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG) {
+ use_proxy = Z_LVAL_PP(tmp);
+ }
+ } else {
+ stream = NULL;
+ }
+
+ if (location != NULL && location[0] != '\000') {
+ phpurl = php_url_parse(location);
+ }
+
+ if (SUCCESS == zend_hash_find(Z_OBJPROP_P(this_ptr),
+ "_stream_context", sizeof("_stream_context"), (void**)&tmp)) {
+ context = php_stream_context_from_zval(*tmp, 0);
+ }
+
+ if (context &&
+ php_stream_context_get_option(context, "http", "max_redirects", &tmp) == SUCCESS) {
+ if (Z_TYPE_PP(tmp) != IS_STRING || !is_numeric_string(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &redirect_max, NULL, 1)) {
+ if (Z_TYPE_PP(tmp) == IS_LONG)
+ redirect_max = Z_LVAL_PP(tmp);
+ }
+ }
+
+try_again:
+ if (phpurl == NULL || phpurl->host == NULL) {
+ if (phpurl != NULL) {php_url_free(phpurl);}
+ if (request != buf) {efree(request);}
+ add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL TSRMLS_CC);
+ smart_str_free(&soap_headers_z);
+ return FALSE;
+ }
+
+ use_ssl = 0;
+ if (phpurl->scheme != NULL && strcmp(phpurl->scheme, "https") == 0) {
+ use_ssl = 1;
+ } else if (phpurl->scheme == NULL || strcmp(phpurl->scheme, "http") != 0) {
+ php_url_free(phpurl);
+ if (request != buf) {efree(request);}
+ add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL TSRMLS_CC);
+ smart_str_free(&soap_headers_z);
+ return FALSE;
+ }
+
+ old_allow_url_fopen = PG(allow_url_fopen);
+ PG(allow_url_fopen) = 1;
+ if (use_ssl && php_stream_locate_url_wrapper("https://", NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) == NULL) {
+ php_url_free(phpurl);
+ if (request != buf) {efree(request);}
+ add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL TSRMLS_CC);
+ PG(allow_url_fopen) = old_allow_url_fopen;
+ smart_str_free(&soap_headers_z);
+ return FALSE;
+ }
+
+ if (phpurl->port == 0) {
+ phpurl->port = use_ssl ? 443 : 80;
+ }
+
+ /* Check if request to the same host */
+ if (stream != NULL) {
+ php_url *orig;
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl"), (void **)&tmp) == SUCCESS &&
+ (orig = (php_url *) zend_fetch_resource(tmp TSRMLS_CC, -1, "httpurl", NULL, 1, le_url)) != NULL &&
+ ((use_proxy && !use_ssl) ||
+ (((use_ssl && orig->scheme != NULL && strcmp(orig->scheme, "https") == 0) ||
+ (!use_ssl && orig->scheme == NULL) ||
+ (!use_ssl && strcmp(orig->scheme, "https") != 0)) &&
+ strcmp(orig->host, phpurl->host) == 0 &&
+ orig->port == phpurl->port))) {
+ } else {
+ php_stream_close(stream);
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl"));
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket"));
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy"));
+ stream = NULL;
+ use_proxy = 0;
+ }
+ }
+
+ /* Check if keep-alive connection is still opened */
+ if (stream != NULL && php_stream_eof(stream)) {
+ php_stream_close(stream);
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl"));
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket"));
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy"));
+ stream = NULL;
+ use_proxy = 0;
+ }
+
+ if (!stream) {
+ stream = http_connect(this_ptr, phpurl, use_ssl, context, &use_proxy TSRMLS_CC);
+ if (stream) {
+ php_stream_auto_cleanup(stream);
+ add_property_resource(this_ptr, "httpsocket", php_stream_get_resource_id(stream));
+ add_property_long(this_ptr, "_use_proxy", use_proxy);
+ } else {
+ php_url_free(phpurl);
+ if (request != buf) {efree(request);}
+ add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL TSRMLS_CC);
+ PG(allow_url_fopen) = old_allow_url_fopen;
+ smart_str_free(&soap_headers_z);
+ return FALSE;
+ }
+ }
+ PG(allow_url_fopen) = old_allow_url_fopen;
+
+ if (stream) {
+ zval **cookies, **login, **password;
+ int ret = zend_list_insert(phpurl, le_url TSRMLS_CC);
+
+ add_property_resource(this_ptr, "httpurl", ret);
+ /*zend_list_addref(ret);*/
+
+ if (context &&
+ php_stream_context_get_option(context, "http", "protocol_version", &tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_DOUBLE &&
+ Z_DVAL_PP(tmp) == 1.0) {
+ http_1_1 = 0;
+ } else {
+ http_1_1 = 1;
+ }
+
+ smart_str_append_const(&soap_headers, "POST ");
+ if (use_proxy && !use_ssl) {
+ smart_str_appends(&soap_headers, phpurl->scheme);
+ smart_str_append_const(&soap_headers, "://");
+ smart_str_appends(&soap_headers, phpurl->host);
+ smart_str_appendc(&soap_headers, ':');
+ smart_str_append_unsigned(&soap_headers, phpurl->port);
+ }
+ if (phpurl->path) {
+ smart_str_appends(&soap_headers, phpurl->path);
+ } else {
+ smart_str_appendc(&soap_headers, '/');
+ }
+ if (phpurl->query) {
+ smart_str_appendc(&soap_headers, '?');
+ smart_str_appends(&soap_headers, phpurl->query);
+ }
+ if (phpurl->fragment) {
+ smart_str_appendc(&soap_headers, '#');
+ smart_str_appends(&soap_headers, phpurl->fragment);
+ }
+ if (http_1_1) {
+ smart_str_append_const(&soap_headers, " HTTP/1.1\r\n");
+ } else {
+ smart_str_append_const(&soap_headers, " HTTP/1.0\r\n");
+ }
+ smart_str_append_const(&soap_headers, "Host: ");
+ smart_str_appends(&soap_headers, phpurl->host);
+ if (phpurl->port != (use_ssl?443:80)) {
+ smart_str_appendc(&soap_headers, ':');
+ smart_str_append_unsigned(&soap_headers, phpurl->port);
+ }
+ if (!http_1_1 ||
+ (zend_hash_find(Z_OBJPROP_P(this_ptr), "_keep_alive", sizeof("_keep_alive"), (void **)&tmp) == SUCCESS &&
+ Z_LVAL_PP(tmp) == 0)) {
+ smart_str_append_const(&soap_headers, "\r\n"
+ "Connection: close\r\n");
+ } else {
+ smart_str_append_const(&soap_headers, "\r\n"
+ "Connection: Keep-Alive\r\n");
+ }
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", sizeof("_user_agent"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ if (Z_STRLEN_PP(tmp) > 0) {
+ smart_str_append_const(&soap_headers, "User-Agent: ");
+ smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ smart_str_append_const(&soap_headers, "\r\n");
+ }
+ } else if (context &&
+ php_stream_context_get_option(context, "http", "user_agent", &tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ if (Z_STRLEN_PP(tmp) > 0) {
+ smart_str_append_const(&soap_headers, "User-Agent: ");
+ smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ smart_str_append_const(&soap_headers, "\r\n");
+ }
+ } else if (FG(user_agent)) {
+ smart_str_append_const(&soap_headers, "User-Agent: ");
+ smart_str_appends(&soap_headers, FG(user_agent));
+ smart_str_append_const(&soap_headers, "\r\n");
+ } else {
+ smart_str_append_const(&soap_headers, "User-Agent: PHP-SOAP/"PHP_VERSION"\r\n");
+ }
+
+ smart_str_append(&soap_headers, &soap_headers_z);
+
+ if (soap_version == SOAP_1_2) {
+ smart_str_append_const(&soap_headers,"Content-Type: application/soap+xml; charset=utf-8");
+ if (soapaction) {
+ smart_str_append_const(&soap_headers,"; action=\"");
+ smart_str_appends(&soap_headers, soapaction);
+ smart_str_append_const(&soap_headers,"\"");
+ }
+ smart_str_append_const(&soap_headers,"\r\n");
+ } else {
+ smart_str_append_const(&soap_headers,"Content-Type: text/xml; charset=utf-8\r\n");
+ if (soapaction) {
+ smart_str_append_const(&soap_headers, "SOAPAction: \"");
+ smart_str_appends(&soap_headers, soapaction);
+ smart_str_append_const(&soap_headers, "\"\r\n");
+ }
+ }
+ smart_str_append_const(&soap_headers,"Content-Length: ");
+ smart_str_append_long(&soap_headers, request_size);
+ smart_str_append_const(&soap_headers, "\r\n");
+
+ /* HTTP Authentication */
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_login", sizeof("_login"), (void **)&login) == SUCCESS &&
+ Z_TYPE_PP(login) == IS_STRING) {
+ zval **digest;
+
+ has_authorization = 1;
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_digest", sizeof("_digest"), (void **)&digest) == SUCCESS) {
+ if (Z_TYPE_PP(digest) == IS_ARRAY) {
+ char HA1[33], HA2[33], response[33], cnonce[33], nc[9];
+ PHP_MD5_CTX md5ctx;
+ unsigned char hash[16];
+
+ PHP_MD5Init(&md5ctx);
+ snprintf(cnonce, sizeof(cnonce), "%ld", php_rand(TSRMLS_C));
+ PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, strlen(cnonce));
+ PHP_MD5Final(hash, &md5ctx);
+ make_digest(cnonce, hash);
+
+ if (zend_hash_find(Z_ARRVAL_PP(digest), "nc", sizeof("nc"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_LONG) {
+ Z_LVAL_PP(tmp)++;
+ snprintf(nc, sizeof(nc), "%08ld", Z_LVAL_PP(tmp));
+ } else {
+ add_assoc_long(*digest, "nc", 1);
+ strcpy(nc, "00000001");
+ }
+
+ PHP_MD5Init(&md5ctx);
+ PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(login), Z_STRLEN_PP(login));
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ if (zend_hash_find(Z_ARRVAL_PP(digest), "realm", sizeof("realm"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ }
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS &&
+ Z_TYPE_PP(password) == IS_STRING) {
+ PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(password), Z_STRLEN_PP(password));
+ }
+ PHP_MD5Final(hash, &md5ctx);
+ make_digest(HA1, hash);
+ if (zend_hash_find(Z_ARRVAL_PP(digest), "algorithm", sizeof("algorithm"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING &&
+ Z_STRLEN_PP(tmp) == sizeof("md5-sess")-1 &&
+ stricmp(Z_STRVAL_PP(tmp), "md5-sess") == 0) {
+ PHP_MD5Init(&md5ctx);
+ PHP_MD5Update(&md5ctx, (unsigned char*)HA1, 32);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ if (zend_hash_find(Z_ARRVAL_PP(digest), "nonce", sizeof("nonce"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ }
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, 8);
+ PHP_MD5Final(hash, &md5ctx);
+ make_digest(HA1, hash);
+ }
+
+ PHP_MD5Init(&md5ctx);
+ PHP_MD5Update(&md5ctx, (unsigned char*)"POST:", sizeof("POST:")-1);
+ if (phpurl->path) {
+ PHP_MD5Update(&md5ctx, (unsigned char*)phpurl->path, strlen(phpurl->path));
+ } else {
+ PHP_MD5Update(&md5ctx, (unsigned char*)"/", 1);
+ }
+ if (phpurl->query) {
+ PHP_MD5Update(&md5ctx, (unsigned char*)"?", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)phpurl->query, strlen(phpurl->query));
+ }
+
+ /* TODO: Support for qop="auth-int" */
+/*
+ if (zend_hash_find(Z_ARRVAL_PP(digest), "qop", sizeof("qop"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING &&
+ Z_STRLEN_PP(tmp) == sizeof("auth-int")-1 &&
+ stricmp(Z_STRVAL_PP(tmp), "auth-int") == 0) {
+ PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, HEntity, HASHHEXLEN);
+ }
+*/
+ PHP_MD5Final(hash, &md5ctx);
+ make_digest(HA2, hash);
+
+ PHP_MD5Init(&md5ctx);
+ PHP_MD5Update(&md5ctx, (unsigned char*)HA1, 32);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ if (zend_hash_find(Z_ARRVAL_PP(digest), "nonce", sizeof("nonce"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ }
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ if (zend_hash_find(Z_ARRVAL_PP(digest), "qop", sizeof("qop"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ PHP_MD5Update(&md5ctx, (unsigned char*)nc, 8);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, 8);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ /* TODO: Support for qop="auth-int" */
+ PHP_MD5Update(&md5ctx, (unsigned char*)"auth", sizeof("auth")-1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ }
+ PHP_MD5Update(&md5ctx, (unsigned char*)HA2, 32);
+ PHP_MD5Final(hash, &md5ctx);
+ make_digest(response, hash);
+
+ smart_str_append_const(&soap_headers, "Authorization: Digest username=\"");
+ smart_str_appendl(&soap_headers, Z_STRVAL_PP(login), Z_STRLEN_PP(login));
+ if (zend_hash_find(Z_ARRVAL_PP(digest), "realm", sizeof("realm"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ smart_str_append_const(&soap_headers, "\", realm=\"");
+ smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ }
+ if (zend_hash_find(Z_ARRVAL_PP(digest), "nonce", sizeof("nonce"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ smart_str_append_const(&soap_headers, "\", nonce=\"");
+ smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ }
+ smart_str_append_const(&soap_headers, "\", uri=\"");
+ if (phpurl->path) {
+ smart_str_appends(&soap_headers, phpurl->path);
+ } else {
+ smart_str_appendc(&soap_headers, '/');
+ }
+ if (phpurl->query) {
+ smart_str_appendc(&soap_headers, '?');
+ smart_str_appends(&soap_headers, phpurl->query);
+ }
+ if (phpurl->fragment) {
+ smart_str_appendc(&soap_headers, '#');
+ smart_str_appends(&soap_headers, phpurl->fragment);
+ }
+ if (zend_hash_find(Z_ARRVAL_PP(digest), "qop", sizeof("qop"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ /* TODO: Support for qop="auth-int" */
+ smart_str_append_const(&soap_headers, "\", qop=\"auth");
+ smart_str_append_const(&soap_headers, "\", nc=\"");
+ smart_str_appendl(&soap_headers, nc, 8);
+ smart_str_append_const(&soap_headers, "\", cnonce=\"");
+ smart_str_appendl(&soap_headers, cnonce, 8);
+ }
+ smart_str_append_const(&soap_headers, "\", response=\"");
+ smart_str_appendl(&soap_headers, response, 32);
+ if (zend_hash_find(Z_ARRVAL_PP(digest), "opaque", sizeof("opaque"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ smart_str_append_const(&soap_headers, "\", opaque=\"");
+ smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ }
+ if (zend_hash_find(Z_ARRVAL_PP(digest), "algorithm", sizeof("algorithm"), (void **)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ smart_str_append_const(&soap_headers, "\", algorithm=\"");
+ smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ }
+ smart_str_append_const(&soap_headers, "\"\r\n");
+ }
+ } else {
+ unsigned char* buf;
+ int len;
+
+ smart_str auth = {0};
+ smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login));
+ smart_str_appendc(&auth, ':');
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS &&
+ Z_TYPE_PP(password) == IS_STRING) {
+ smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password));
+ }
+ smart_str_0(&auth);
+ buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len);
+ smart_str_append_const(&soap_headers, "Authorization: Basic ");
+ smart_str_appendl(&soap_headers, (char*)buf, len);
+ smart_str_append_const(&soap_headers, "\r\n");
+ efree(buf);
+ smart_str_free(&auth);
+ }
+ }
+
+ /* Proxy HTTP Authentication */
+ if (use_proxy && !use_ssl) {
+ has_proxy_authorization = proxy_authentication(this_ptr, &soap_headers TSRMLS_CC);
+ }
+
+ /* Send cookies along with request */
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == SUCCESS) {
+ zval **data;
+ char *key;
+ int i, n;
+
+ has_cookies = 1;
+ n = zend_hash_num_elements(Z_ARRVAL_PP(cookies));
+ if (n > 0) {
+ zend_hash_internal_pointer_reset(Z_ARRVAL_PP(cookies));
+ smart_str_append_const(&soap_headers, "Cookie: ");
+ for (i = 0; i < n; i++) {
+ zend_hash_get_current_data(Z_ARRVAL_PP(cookies), (void **)&data);
+ zend_hash_get_current_key(Z_ARRVAL_PP(cookies), &key, NULL, FALSE);
+
+ if (Z_TYPE_PP(data) == IS_ARRAY) {
+ zval** value;
+
+ if (zend_hash_index_find(Z_ARRVAL_PP(data), 0, (void**)&value) == SUCCESS &&
+ Z_TYPE_PP(value) == IS_STRING) {
+ zval **tmp;
+ if ((zend_hash_index_find(Z_ARRVAL_PP(data), 1, (void**)&tmp) == FAILURE ||
+ strncmp(phpurl->path?phpurl->path:"/",Z_STRVAL_PP(tmp),Z_STRLEN_PP(tmp)) == 0) &&
+ (zend_hash_index_find(Z_ARRVAL_PP(data), 2, (void**)&tmp) == FAILURE ||
+ in_domain(phpurl->host,Z_STRVAL_PP(tmp))) &&
+ (use_ssl || zend_hash_index_find(Z_ARRVAL_PP(data), 3, (void**)&tmp) == FAILURE)) {
+ smart_str_appendl(&soap_headers, key, strlen(key));
+ smart_str_appendc(&soap_headers, '=');
+ smart_str_appendl(&soap_headers, Z_STRVAL_PP(value), Z_STRLEN_PP(value));
+ smart_str_appendc(&soap_headers, ';');
+ }
+ }
+ }
+ zend_hash_move_forward(Z_ARRVAL_PP(cookies));
+ }
+ smart_str_append_const(&soap_headers, "\r\n");
+ }
+ }
+
+ http_context_headers(context, has_authorization, has_proxy_authorization, has_cookies, &soap_headers TSRMLS_CC);
+
+ smart_str_append_const(&soap_headers, "\r\n");
+ smart_str_0(&soap_headers);
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS &&
+ Z_LVAL_PP(trace) > 0) {
+ add_property_stringl(this_ptr, "__last_request_headers", soap_headers.c, soap_headers.len, 1);
+ }
+ smart_str_appendl(&soap_headers, request, request_size);
+ smart_str_0(&soap_headers);
+
+ err = php_stream_write(stream, soap_headers.c, soap_headers.len);
+ if (err != soap_headers.len) {
+ if (request != buf) {efree(request);}
+ php_stream_close(stream);
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl"));
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket"));
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy"));
+ add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL TSRMLS_CC);
+ smart_str_free(&soap_headers_z);
+ return FALSE;
+ }
+ smart_str_free(&soap_headers);
+ } else {
+ add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL TSRMLS_CC);
+ smart_str_free(&soap_headers_z);
+ return FALSE;
+ }
+
+ if (!buffer) {
+ php_stream_close(stream);
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket"));
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy"));
+ smart_str_free(&soap_headers_z);
+ return TRUE;
+ }
+
+ do {
+ if (!get_http_headers(stream, &http_headers, &http_header_size TSRMLS_CC)) {
+ if (http_headers) {efree(http_headers);}
+ if (request != buf) {efree(request);}
+ php_stream_close(stream);
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket"));
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy"));
+ add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL TSRMLS_CC);
+ smart_str_free(&soap_headers_z);
+ return FALSE;
+ }
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS &&
+ Z_LVAL_PP(trace) > 0) {
+ add_property_stringl(this_ptr, "__last_response_headers", http_headers, http_header_size, 1);
+ }
+
+ /* Check to see what HTTP status was sent */
+ http_1_1 = 0;
+ http_status = 0;
+ http_version = get_http_header_value(http_headers,"HTTP/");
+ if (http_version) {
+ char *tmp;
+
+ if (!strncmp(http_version,"1.1", 3)) {
+ http_1_1 = 1;
+ }
+
+ tmp = strstr(http_version," ");
+ if (tmp != NULL) {
+ tmp++;
+ http_status = atoi(tmp);
+ }
+ tmp = strstr(tmp," ");
+ if (tmp != NULL) {
+ tmp++;
+ if (http_msg) {
+ efree(http_msg);
+ }
+ http_msg = estrdup(tmp);
+ }
+ efree(http_version);
+
+ /* Try and get headers again */
+ if (http_status == 100) {
+ efree(http_headers);
+ }
+ }
+ } while (http_status == 100);
+
+ /* Grab and send back every cookie */
+
+ /* Not going to worry about Path: because
+ we shouldn't be changing urls so path dont
+ matter too much
+ */
+ cookie_itt = strstr(http_headers,"Set-Cookie: ");
+ while (cookie_itt) {
+ char *end_pos, *cookie;
+ char *eqpos, *sempos;
+ zval **cookies;
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == FAILURE) {
+ zval *tmp_cookies;
+ MAKE_STD_ZVAL(tmp_cookies);
+ array_init(tmp_cookies);
+ zend_hash_update(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), &tmp_cookies, sizeof(zval *), (void **)&cookies);
+ }
+
+ end_pos = strstr(cookie_itt,"\r\n");
+ cookie = get_http_header_value(cookie_itt,"Set-Cookie: ");
+
+ eqpos = strstr(cookie, "=");
+ sempos = strstr(cookie, ";");
+ if (eqpos != NULL && (sempos == NULL || sempos > eqpos)) {
+ smart_str name = {0};
+ int cookie_len;
+ zval *zcookie;
+
+ if (sempos != NULL) {
+ cookie_len = sempos-(eqpos+1);
+ } else {
+ cookie_len = strlen(cookie)-(eqpos-cookie)-1;
+ }
+
+ smart_str_appendl(&name, cookie, eqpos - cookie);
+ smart_str_0(&name);
+
+ ALLOC_INIT_ZVAL(zcookie);
+ array_init(zcookie);
+ add_index_stringl(zcookie, 0, eqpos + 1, cookie_len, 1);
+
+ if (sempos != NULL) {
+ char *options = cookie + cookie_len+1;
+ while (*options) {
+ while (*options == ' ') {options++;}
+ sempos = strstr(options, ";");
+ if (strstr(options,"path=") == options) {
+ eqpos = options + sizeof("path=")-1;
+ add_index_stringl(zcookie, 1, eqpos, sempos?(sempos-eqpos):strlen(eqpos), 1);
+ } else if (strstr(options,"domain=") == options) {
+ eqpos = options + sizeof("domain=")-1;
+ add_index_stringl(zcookie, 2, eqpos, sempos?(sempos-eqpos):strlen(eqpos), 1);
+ } else if (strstr(options,"secure") == options) {
+ add_index_bool(zcookie, 3, 1);
+ }
+ if (sempos != NULL) {
+ options = sempos+1;
+ } else {
+ break;
+ }
+ }
+ }
+ if (!zend_hash_index_exists(Z_ARRVAL_P(zcookie), 1)) {
+ char *t = phpurl->path?phpurl->path:"/";
+ char *c = strrchr(t, '/');
+ if (c) {
+ add_index_stringl(zcookie, 1, t, c-t, 1);
+ }
+ }
+ if (!zend_hash_index_exists(Z_ARRVAL_P(zcookie), 2)) {
+ add_index_string(zcookie, 2, phpurl->host, 1);
+ }
+
+ add_assoc_zval_ex(*cookies, name.c, name.len+1, zcookie);
+ smart_str_free(&name);
+ }
+
+ cookie_itt = strstr(cookie_itt + sizeof("Set-Cookie: "), "Set-Cookie: ");
+ efree(cookie);
+ }
+
+ /* See if the server requested a close */
+ if (http_1_1) {
+ http_close = FALSE;
+ if (use_proxy && !use_ssl) {
+ connection = get_http_header_value(http_headers,"Proxy-Connection: ");
+ if (connection) {
+ if (strncasecmp(connection, "close", sizeof("close")-1) == 0) {
+ http_close = TRUE;
+ }
+ efree(connection);
+ }
+ }
+ if (http_close == FALSE) {
+ connection = get_http_header_value(http_headers,"Connection: ");
+ if (connection) {
+ if (strncasecmp(connection, "close", sizeof("close")-1) == 0) {
+ http_close = TRUE;
+ }
+ efree(connection);
+ }
+ }
+ } else {
+ http_close = TRUE;
+ if (use_proxy && !use_ssl) {
+ connection = get_http_header_value(http_headers,"Proxy-Connection: ");
+ if (connection) {
+ if (strncasecmp(connection, "Keep-Alive", sizeof("Keep-Alive")-1) == 0) {
+ http_close = FALSE;
+ }
+ efree(connection);
+ }
+ }
+ if (http_close == TRUE) {
+ connection = get_http_header_value(http_headers,"Connection: ");
+ if (connection) {
+ if (strncasecmp(connection, "Keep-Alive", sizeof("Keep-Alive")-1) == 0) {
+ http_close = FALSE;
+ }
+ efree(connection);
+ }
+ }
+ }
+
+ if (!get_http_body(stream, http_close, http_headers, &http_body, &http_body_size TSRMLS_CC)) {
+ if (request != buf) {efree(request);}
+ php_stream_close(stream);
+ efree(http_headers);
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket"));
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy"));
+ add_soap_fault(this_ptr, "HTTP", "Error Fetching http body, No Content-Length, connection closed or chunked data", NULL, NULL TSRMLS_CC);
+ if (http_msg) {
+ efree(http_msg);
+ }
+ smart_str_free(&soap_headers_z);
+ return FALSE;
+ }
+
+ if (request != buf) {efree(request);}
+
+ if (http_close) {
+ php_stream_close(stream);
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket"));
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy"));
+ stream = NULL;
+ }
+
+ /* Process HTTP status codes */
+ if (http_status >= 300 && http_status < 400) {
+ char *loc;
+
+ if ((loc = get_http_header_value(http_headers,"Location: ")) != NULL) {
+ php_url *new_url = php_url_parse(loc);
+
+ if (new_url != NULL) {
+ efree(http_headers);
+ efree(http_body);
+ efree(loc);
+ if (new_url->scheme == NULL && new_url->path != NULL) {
+ new_url->scheme = phpurl->scheme ? estrdup(phpurl->scheme) : NULL;
+ new_url->host = phpurl->host ? estrdup(phpurl->host) : NULL;
+ new_url->port = phpurl->port;
+ if (new_url->path && new_url->path[0] != '/') {
+ if (phpurl->path) {
+ char *t = phpurl->path;
+ char *p = strrchr(t, '/');
+ if (p) {
+ char *s = emalloc((p - t) + strlen(new_url->path) + 2);
+ strncpy(s, t, (p - t) + 1);
+ s[(p - t) + 1] = 0;
+ strcat(s, new_url->path);
+ efree(new_url->path);
+ new_url->path = s;
+ }
+ } else {
+ char *s = emalloc(strlen(new_url->path) + 2);
+ s[0] = '/'; s[1] = 0;
+ strcat(s, new_url->path);
+ efree(new_url->path);
+ new_url->path = s;
+ }
+ }
+ }
+ phpurl = new_url;
+
+ if (--redirect_max < 1) {
+ add_soap_fault(this_ptr, "HTTP", "Redirection limit reached, aborting", NULL, NULL TSRMLS_CC);
+ smart_str_free(&soap_headers_z);
+ return FALSE;
+ }
+
+ goto try_again;
+ }
+ }
+ } else if (http_status == 401) {
+ /* Digest authentication */
+ zval **digest, **login, **password;
+ char *auth = get_http_header_value(http_headers, "WWW-Authenticate: ");
+
+ if (auth &&
+ strstr(auth, "Digest") == auth &&
+ (zend_hash_find(Z_OBJPROP_P(this_ptr), "_digest", sizeof("_digest"), (void **)&digest) == FAILURE ||
+ Z_TYPE_PP(digest) != IS_ARRAY) &&
+ zend_hash_find(Z_OBJPROP_P(this_ptr), "_login", sizeof("_login"), (void **)&login) == SUCCESS &&
+ Z_TYPE_PP(login) == IS_STRING &&
+ zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS &&
+ Z_TYPE_PP(password) == IS_STRING) {
+ char *s;
+ zval *digest = NULL;
+
+ s = auth + sizeof("Digest")-1;
+ while (*s != '\0') {
+ char *name, *val;
+ while (*s == ' ') ++s;
+ name = s;
+ while (*s != '\0' && *s != '=') ++s;
+ if (*s == '=') {
+ *s = '\0';
+ ++s;
+ if (*s == '"') {
+ ++s;
+ val = s;
+ while (*s != '\0' && *s != '"') ++s;
+ } else {
+ val = s;
+ while (*s != '\0' && *s != ' ' && *s != ',') ++s;
+ }
+ if (*s != '\0') {
+ if (*s != ',') {
+ *s = '\0';
+ ++s;
+ while (*s != '\0' && *s != ',') ++s;
+ if (*s != '\0') ++s;
+ } else {
+ *s = '\0';
+ ++s;
+ }
+ }
+ if (digest == NULL) {
+ ALLOC_INIT_ZVAL(digest);
+ array_init(digest);
+ }
+ add_assoc_string(digest, name, val ,1);
+ }
+ }
+
+ if (digest != NULL) {
+ php_url *new_url = emalloc(sizeof(php_url));
+
+ Z_DELREF_P(digest);
+ add_property_zval_ex(this_ptr, "_digest", sizeof("_digest"), digest TSRMLS_CC);
+
+ *new_url = *phpurl;
+ if (phpurl->scheme) phpurl->scheme = estrdup(phpurl->scheme);
+ if (phpurl->user) phpurl->user = estrdup(phpurl->user);
+ if (phpurl->pass) phpurl->pass = estrdup(phpurl->pass);
+ if (phpurl->host) phpurl->host = estrdup(phpurl->host);
+ if (phpurl->path) phpurl->path = estrdup(phpurl->path);
+ if (phpurl->query) phpurl->query = estrdup(phpurl->query);
+ if (phpurl->fragment) phpurl->fragment = estrdup(phpurl->fragment);
+ phpurl = new_url;
+
+ efree(auth);
+ efree(http_headers);
+ efree(http_body);
+
+ goto try_again;
+ }
+ }
+ if (auth) efree(auth);
+ }
+ smart_str_free(&soap_headers_z);
+
+ /* Check and see if the server even sent a xml document */
+ content_type = get_http_header_value(http_headers,"Content-Type: ");
+ if (content_type) {
+ char *pos = NULL;
+ int cmplen;
+ pos = strstr(content_type,";");
+ if (pos != NULL) {
+ cmplen = pos - content_type;
+ } else {
+ cmplen = strlen(content_type);
+ }
+ if (strncmp(content_type, "text/xml", cmplen) == 0 ||
+ strncmp(content_type, "application/soap+xml", cmplen) == 0) {
+ content_type_xml = 1;
+/*
+ if (strncmp(http_body, "<?xml", 5)) {
+ zval *err;
+ MAKE_STD_ZVAL(err);
+ ZVAL_STRINGL(err, http_body, http_body_size, 1);
+ add_soap_fault(this_ptr, "HTTP", "Didn't recieve an xml document", NULL, err TSRMLS_CC);
+ efree(content_type);
+ efree(http_headers);
+ efree(http_body);
+ return FALSE;
+ }
+*/
+ }
+ efree(content_type);
+ }
+
+ /* Decompress response */
+ content_encoding = get_http_header_value(http_headers,"Content-Encoding: ");
+ if (content_encoding) {
+ zval func;
+ zval retval;
+ zval param;
+ zval *params[1];
+
+ if ((strcmp(content_encoding,"gzip") == 0 ||
+ strcmp(content_encoding,"x-gzip") == 0) &&
+ zend_hash_exists(EG(function_table), "gzinflate", sizeof("gzinflate"))) {
+ ZVAL_STRING(&func, "gzinflate", 0);
+ params[0] = &param;
+ ZVAL_STRINGL(params[0], http_body+10, http_body_size-10, 0);
+ INIT_PZVAL(params[0]);
+ } else if (strcmp(content_encoding,"deflate") == 0 &&
+ zend_hash_exists(EG(function_table), "gzuncompress", sizeof("gzuncompress"))) {
+ ZVAL_STRING(&func, "gzuncompress", 0);
+ params[0] = &param;
+ ZVAL_STRINGL(params[0], http_body, http_body_size, 0);
+ INIT_PZVAL(params[0]);
+ } else {
+ efree(content_encoding);
+ efree(http_headers);
+ efree(http_body);
+ if (http_msg) {
+ efree(http_msg);
+ }
+ add_soap_fault(this_ptr, "HTTP", "Unknown Content-Encoding", NULL, NULL TSRMLS_CC);
+ return FALSE;
+ }
+ if (call_user_function(CG(function_table), (zval**)NULL, &func, &retval, 1, params TSRMLS_CC) == SUCCESS &&
+ Z_TYPE(retval) == IS_STRING) {
+ efree(http_body);
+ *buffer = Z_STRVAL(retval);
+ *buffer_len = Z_STRLEN(retval);
+ } else {
+ efree(content_encoding);
+ efree(http_headers);
+ efree(http_body);
+ add_soap_fault(this_ptr, "HTTP", "Can't uncompress compressed response", NULL, NULL TSRMLS_CC);
+ if (http_msg) {
+ efree(http_msg);
+ }
+ return FALSE;
+ }
+ efree(content_encoding);
+ } else {
+ *buffer = http_body;
+ *buffer_len = http_body_size;
+ }
+
+ efree(http_headers);
+
+ if (http_status >= 400) {
+ int error = 0;
+
+ if (*buffer_len == 0) {
+ error = 1;
+ } else if (*buffer_len > 0) {
+ if (!content_type_xml) {
+ char *s = *buffer;
+
+ while (*s != '\0' && *s < ' ') {
+ s++;
+ }
+ if (strncmp(s, "<?xml", 5)) {
+ error = 1;
+ }
+ }
+ }
+
+ if (error) {
+ efree(*buffer);
+ add_soap_fault(this_ptr, "HTTP", http_msg, NULL, NULL TSRMLS_CC);
+ efree(http_msg);
+ return FALSE;
+ }
+ }
+
+ if (http_msg) {
+ efree(http_msg);
+ }
+
+ return TRUE;
+}
+
+static char *get_http_header_value(char *headers, char *type)
+{
+ char *pos, *tmp = NULL;
+ int typelen, headerslen;
+
+ typelen = strlen(type);
+ headerslen = strlen(headers);
+
+ /* header `titles' can be lower case, or any case combination, according
+ * to the various RFC's. */
+ pos = headers;
+ do {
+ /* start of buffer or start of line */
+ if (strncasecmp(pos, type, typelen) == 0) {
+ char *eol;
+
+ /* match */
+ tmp = pos + typelen;
+ eol = strchr(tmp, '\n');
+ if (eol == NULL) {
+ eol = headers + headerslen;
+ } else if (eol > tmp && *(eol-1) == '\r') {
+ eol--;
+ }
+ return estrndup(tmp, eol - tmp);
+ }
+
+ /* find next line */
+ pos = strchr(pos, '\n');
+ if (pos) {
+ pos++;
+ }
+
+ } while (pos);
+
+ return NULL;
+}
+
+static int get_http_body(php_stream *stream, int close, char *headers, char **response, int *out_size TSRMLS_DC)
+{
+ char *header, *http_buf = NULL;
+ int header_close = close, header_chunked = 0, header_length = 0, http_buf_size = 0;
+
+ if (!close) {
+ header = get_http_header_value(headers, "Connection: ");
+ if (header) {
+ if(!strncasecmp(header, "close", sizeof("close")-1)) header_close = 1;
+ efree(header);
+ }
+ }
+ header = get_http_header_value(headers, "Transfer-Encoding: ");
+ if (header) {
+ if(!strncasecmp(header, "chunked", sizeof("chunked")-1)) header_chunked = 1;
+ efree(header);
+ }
+ header = get_http_header_value(headers, "Content-Length: ");
+ if (header) {
+ header_length = atoi(header);
+ efree(header);
+ if (!header_length && !header_chunked) {
+ /* Empty response */
+ http_buf = emalloc(1);
+ http_buf[0] = '\0';
+ (*response) = http_buf;
+ (*out_size) = 0;
+ return TRUE;
+ }
+ }
+
+ if (header_chunked) {
+ char ch, done, headerbuf[8192];
+
+ done = FALSE;
+
+ while (!done) {
+ int buf_size = 0;
+
+ php_stream_gets(stream, headerbuf, sizeof(headerbuf));
+ if (sscanf(headerbuf, "%x", &buf_size) > 0 ) {
+ if (buf_size > 0) {
+ int len_size = 0;
+
+ if (http_buf_size + buf_size + 1 < 0) {
+ efree(http_buf);
+ return FALSE;
+ }
+ http_buf = erealloc(http_buf, http_buf_size + buf_size + 1);
+
+ while (len_size < buf_size) {
+ int len_read = php_stream_read(stream, http_buf + http_buf_size, buf_size - len_size);
+ if (len_read <= 0) {
+ /* Error or EOF */
+ done = TRUE;
+ break;
+ }
+ len_size += len_read;
+ http_buf_size += len_read;
+ }
+
+ /* Eat up '\r' '\n' */
+ ch = php_stream_getc(stream);
+ if (ch == '\r') {
+ ch = php_stream_getc(stream);
+ }
+ if (ch != '\n') {
+ /* Somthing wrong in chunked encoding */
+ if (http_buf) {
+ efree(http_buf);
+ }
+ return FALSE;
+ }
+ }
+ } else {
+ /* Somthing wrong in chunked encoding */
+ if (http_buf) {
+ efree(http_buf);
+ }
+ return FALSE;
+ }
+ if (buf_size == 0) {
+ done = TRUE;
+ }
+ }
+
+ /* Ignore trailer headers */
+ while (1) {
+ if (!php_stream_gets(stream, headerbuf, sizeof(headerbuf))) {
+ break;
+ }
+
+ if ((headerbuf[0] == '\r' && headerbuf[1] == '\n') ||
+ (headerbuf[0] == '\n')) {
+ /* empty line marks end of headers */
+ break;
+ }
+ }
+
+ if (http_buf == NULL) {
+ http_buf = emalloc(1);
+ }
+
+ } else if (header_length) {
+ if (header_length < 0 || header_length >= INT_MAX) {
+ return FALSE;
+ }
+ http_buf = safe_emalloc(1, header_length, 1);
+ while (http_buf_size < header_length) {
+ int len_read = php_stream_read(stream, http_buf + http_buf_size, header_length - http_buf_size);
+ if (len_read <= 0) {
+ break;
+ }
+ http_buf_size += len_read;
+ }
+ } else if (header_close) {
+ do {
+ int len_read;
+ http_buf = erealloc(http_buf, http_buf_size + 4096 + 1);
+ len_read = php_stream_read(stream, http_buf + http_buf_size, 4096);
+ if (len_read > 0) {
+ http_buf_size += len_read;
+ }
+ } while(!php_stream_eof(stream));
+ } else {
+ return FALSE;
+ }
+
+ http_buf[http_buf_size] = '\0';
+ (*response) = http_buf;
+ (*out_size) = http_buf_size;
+ return TRUE;
+}
+
+static int get_http_headers(php_stream *stream, char **response, int *out_size TSRMLS_DC)
+{
+ int done = FALSE;
+ smart_str tmp_response = {0};
+ char headerbuf[8192];
+
+ while (!done) {
+ if (!php_stream_gets(stream, headerbuf, sizeof(headerbuf))) {
+ break;
+ }
+
+ if ((headerbuf[0] == '\r' && headerbuf[1] == '\n') ||
+ (headerbuf[0] == '\n')) {
+ /* empty line marks end of headers */
+ done = TRUE;
+ break;
+ }
+
+ /* add header to collection */
+ smart_str_appends(&tmp_response, headerbuf);
+ }
+ smart_str_0(&tmp_response);
+ (*response) = tmp_response.c;
+ (*out_size) = tmp_response.len;
+ return done;
+}
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: sw=4 ts=4 fdm=marker
+ * vim<600: sw=4 ts=4
+ */
diff --git a/ext/soap/php_http.h b/ext/soap/php_http.h
new file mode 100644
index 0000000..70d2cfd
--- /dev/null
+++ b/ext/soap/php_http.h
@@ -0,0 +1,41 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#ifndef PHP_HTTP_H
+#define PHP_HTTP_H
+
+int make_http_soap_request(zval *this_ptr,
+ char *request,
+ int request_size,
+ char *location,
+ char *soapaction,
+ int soap_version,
+ char **response,
+ int *response_len TSRMLS_DC);
+
+int proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC);
+int basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC);
+void http_context_headers(php_stream_context* context,
+ zend_bool has_authorization,
+ zend_bool has_proxy_authorization,
+ zend_bool has_cookies,
+ smart_str* soap_headers TSRMLS_DC);
+#endif
diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c
new file mode 100644
index 0000000..f4d249c
--- /dev/null
+++ b/ext/soap/php_packet_soap.c
@@ -0,0 +1,426 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#include "php_soap.h"
+
+/* SOAP client calls this function to parse response from SOAP server */
+int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers TSRMLS_DC)
+{
+ char* envelope_ns = NULL;
+ xmlDocPtr response;
+ xmlNodePtr trav, env, head, body, resp, cur, fault;
+ xmlAttrPtr attr;
+ int param_count = 0;
+ int soap_version = SOAP_1_1;
+ HashTable *hdrs = NULL;
+
+ ZVAL_NULL(return_value);
+
+ /* Response for one-way opearation */
+ if (buffer_size == 0) {
+ return TRUE;
+ }
+
+ /* Parse XML packet */
+ response = soap_xmlParseMemory(buffer, buffer_size);
+
+ if (!response) {
+ add_soap_fault(this_ptr, "Client", "looks like we got no XML document", NULL, NULL TSRMLS_CC);
+ return FALSE;
+ }
+ if (xmlGetIntSubset(response) != NULL) {
+ add_soap_fault(this_ptr, "Client", "DTD are not supported by SOAP", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ }
+
+ /* Get <Envelope> element */
+ env = NULL;
+ trav = response->children;
+ while (trav != NULL) {
+ if (trav->type == XML_ELEMENT_NODE) {
+ if (env == NULL && node_is_equal_ex(trav,"Envelope",SOAP_1_1_ENV_NAMESPACE)) {
+ env = trav;
+ envelope_ns = SOAP_1_1_ENV_NAMESPACE;
+ soap_version = SOAP_1_1;
+ } else if (env == NULL && node_is_equal_ex(trav,"Envelope",SOAP_1_2_ENV_NAMESPACE)) {
+ env = trav;
+ envelope_ns = SOAP_1_2_ENV_NAMESPACE;
+ soap_version = SOAP_1_2;
+ } else {
+ add_soap_fault(this_ptr, "VersionMismatch", "Wrong Version", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ }
+ }
+ trav = trav->next;
+ }
+ if (env == NULL) {
+ add_soap_fault(this_ptr, "Client", "looks like we got XML without \"Envelope\" element", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ }
+
+ attr = env->properties;
+ while (attr != NULL) {
+ if (attr->ns == NULL) {
+ add_soap_fault(this_ptr, "Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ } else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
+ if (soap_version == SOAP_1_2) {
+ add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ } else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
+ add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ }
+ }
+ attr = attr->next;
+ }
+
+ /* Get <Header> element */
+ head = NULL;
+ trav = env->children;
+ while (trav != NULL && trav->type != XML_ELEMENT_NODE) {
+ trav = trav->next;
+ }
+ if (trav != NULL && node_is_equal_ex(trav,"Header",envelope_ns)) {
+ head = trav;
+ trav = trav->next;
+ }
+
+ /* Get <Body> element */
+ body = NULL;
+ while (trav != NULL && trav->type != XML_ELEMENT_NODE) {
+ trav = trav->next;
+ }
+ if (trav != NULL && node_is_equal_ex(trav,"Body",envelope_ns)) {
+ body = trav;
+ trav = trav->next;
+ }
+ while (trav != NULL && trav->type != XML_ELEMENT_NODE) {
+ trav = trav->next;
+ }
+ if (body == NULL) {
+ add_soap_fault(this_ptr, "Client", "Body must be present in a SOAP envelope", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ }
+ attr = body->properties;
+ while (attr != NULL) {
+ if (attr->ns == NULL) {
+ if (soap_version == SOAP_1_2) {
+ add_soap_fault(this_ptr, "Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ }
+ } else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
+ if (soap_version == SOAP_1_2) {
+ add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Body", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ } else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
+ add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ }
+ }
+ attr = attr->next;
+ }
+ if (trav != NULL && soap_version == SOAP_1_2) {
+ add_soap_fault(this_ptr, "Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ }
+
+ if (head != NULL) {
+ attr = head->properties;
+ while (attr != NULL) {
+ if (attr->ns == NULL) {
+ add_soap_fault(this_ptr, "Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ } else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
+ if (soap_version == SOAP_1_2) {
+ add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Header", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ } else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
+ add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+ }
+ }
+ attr = attr->next;
+ }
+ }
+
+ /* Check if <Body> contains <Fault> element */
+ fault = get_node_ex(body->children,"Fault",envelope_ns);
+ if (fault != NULL) {
+ char *faultcode = NULL, *faultstring = NULL, *faultactor = NULL;
+ zval *details = NULL;
+ xmlNodePtr tmp;
+
+ if (soap_version == SOAP_1_1) {
+ tmp = get_node(fault->children, "faultcode");
+ if (tmp != NULL && tmp->children != NULL) {
+ faultcode = (char*)tmp->children->content;
+ }
+
+ tmp = get_node(fault->children, "faultstring");
+ if (tmp != NULL && tmp->children != NULL) {
+ zval *zv = master_to_zval(get_conversion(IS_STRING), tmp TSRMLS_CC);
+ faultstring = Z_STRVAL_P(zv);
+ FREE_ZVAL(zv);
+ }
+
+ tmp = get_node(fault->children, "faultactor");
+ if (tmp != NULL && tmp->children != NULL) {
+ zval *zv = master_to_zval(get_conversion(IS_STRING), tmp TSRMLS_CC);
+ faultactor = Z_STRVAL_P(zv);
+ FREE_ZVAL(zv);
+ }
+
+ tmp = get_node(fault->children, "detail");
+ if (tmp != NULL) {
+ details = master_to_zval(NULL, tmp TSRMLS_CC);
+ }
+ } else {
+ tmp = get_node(fault->children, "Code");
+ if (tmp != NULL && tmp->children != NULL) {
+ tmp = get_node(tmp->children, "Value");
+ if (tmp != NULL && tmp->children != NULL) {
+ faultcode = (char*)tmp->children->content;
+ }
+ }
+
+ tmp = get_node(fault->children,"Reason");
+ if (tmp != NULL && tmp->children != NULL) {
+ /* TODO: lang attribute */
+ tmp = get_node(tmp->children,"Text");
+ if (tmp != NULL && tmp->children != NULL) {
+ zval *zv = master_to_zval(get_conversion(IS_STRING), tmp TSRMLS_CC);
+ faultstring = Z_STRVAL_P(zv);
+ FREE_ZVAL(zv);
+ }
+ }
+
+ tmp = get_node(fault->children,"Detail");
+ if (tmp != NULL) {
+ details = master_to_zval(NULL, tmp TSRMLS_CC);
+ }
+ }
+ add_soap_fault(this_ptr, faultcode, faultstring, faultactor, details TSRMLS_CC);
+ if (faultstring) {
+ efree(faultstring);
+ }
+ if (faultactor) {
+ efree(faultactor);
+ }
+ if (details) {
+ Z_DELREF_P(details);
+ }
+ xmlFreeDoc(response);
+ return FALSE;
+ }
+
+ /* Parse content of <Body> element */
+ array_init(return_value);
+ resp = body->children;
+ while (resp != NULL && resp->type != XML_ELEMENT_NODE) {
+ resp = resp->next;
+ }
+ if (resp != NULL) {
+ if (fn != NULL && fn->binding && fn->binding->bindingType == BINDING_SOAP) {
+ /* Function has WSDL description */
+ sdlParamPtr *h_param, param = NULL;
+ xmlNodePtr val = NULL;
+ char *name, *ns = NULL;
+ zval* tmp;
+ sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes;
+ int res_count;
+
+ hdrs = fnb->output.headers;
+
+ if (fn->responseParameters) {
+ res_count = zend_hash_num_elements(fn->responseParameters);
+ zend_hash_internal_pointer_reset(fn->responseParameters);
+ while (zend_hash_get_current_data(fn->responseParameters, (void **)&h_param) == SUCCESS) {
+ param = (*h_param);
+ if (fnb->style == SOAP_DOCUMENT) {
+ if (param->element) {
+ name = param->element->name;
+ ns = param->element->namens;
+/*
+ name = param->encode->details.type_str;
+ ns = param->encode->details.ns;
+*/
+ } else {
+ name = param->paramName;
+ }
+ } else {
+ name = fn->responseName;
+ /* ns = ? */
+ }
+
+ /* Get value of parameter */
+ cur = get_node_ex(resp, name, ns);
+ if (!cur) {
+ cur = get_node(resp, name);
+ /* TODO: produce warning invalid ns */
+ }
+ if (!cur && fnb->style == SOAP_RPC) {
+ cur = resp;
+ }
+ if (cur) {
+ if (fnb->style == SOAP_DOCUMENT) {
+ val = cur;
+ } else {
+ val = get_node(cur->children, param->paramName);
+ if (res_count == 1) {
+ if (val == NULL) {
+ val = get_node(cur->children, "return");
+ }
+ if (val == NULL) {
+ val = get_node(cur->children, "result");
+ }
+ if (val == NULL && cur->children && cur->children->next == NULL) {
+ val = cur->children;
+ }
+ }
+ }
+ }
+
+ if (!val) {
+ /* TODO: may be "nil" is not OK? */
+ MAKE_STD_ZVAL(tmp);
+ ZVAL_NULL(tmp);
+/*
+ add_soap_fault(this_ptr, "Client", "Can't find response data", NULL, NULL TSRMLS_CC);
+ xmlFreeDoc(response);
+ return FALSE;
+*/
+ } else {
+ /* Decoding value of parameter */
+ if (param != NULL) {
+ tmp = master_to_zval(param->encode, val TSRMLS_CC);
+ } else {
+ tmp = master_to_zval(NULL, val TSRMLS_CC);
+ }
+ }
+ add_assoc_zval(return_value, param->paramName, tmp);
+
+ param_count++;
+
+ zend_hash_move_forward(fn->responseParameters);
+ }
+ }
+ } else {
+ /* Function has no WSDL description */
+ xmlNodePtr val;
+ val = resp->children;
+ while (val != NULL) {
+ while (val && val->type != XML_ELEMENT_NODE) {
+ val = val->next;
+ }
+ if (val != NULL) {
+ if (!node_is_equal_ex(val,"result",RPC_SOAP12_NAMESPACE)) {
+ zval *tmp;
+ zval **arr;
+
+ tmp = master_to_zval(NULL, val TSRMLS_CC);
+ if (val->name) {
+ if (zend_hash_find(Z_ARRVAL_P(return_value), (char*)val->name, strlen((char*)val->name)+1, (void**)&arr) == SUCCESS) {
+ add_next_index_zval(*arr, tmp);
+ } else if (val->next && get_node(val->next, (char*)val->name)) {
+ zval *arr;
+
+ MAKE_STD_ZVAL(arr);
+ array_init(arr);
+ add_next_index_zval(arr, tmp);
+ add_assoc_zval(return_value, (char*)val->name, arr);
+ } else {
+ add_assoc_zval(return_value, (char*)val->name, tmp);
+ }
+ } else {
+ add_next_index_zval(return_value, tmp);
+ }
+ ++param_count;
+ }
+ val = val->next;
+ }
+ }
+ }
+ }
+
+ if (Z_TYPE_P(return_value) == IS_ARRAY) {
+ if (param_count == 0) {
+ zval_dtor(return_value);
+ ZVAL_NULL(return_value);
+ } else if (param_count == 1) {
+ zval *tmp;
+
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(return_value));
+ zend_hash_get_current_data(Z_ARRVAL_P(return_value), (void**)&tmp);
+ tmp = *(zval**)tmp;
+ Z_ADDREF_P(tmp);
+ zval_dtor(return_value);
+ *return_value = *tmp;
+ FREE_ZVAL(tmp);
+ }
+ }
+
+ if (soap_headers && head) {
+ trav = head->children;
+ while (trav != NULL) {
+ if (trav->type == XML_ELEMENT_NODE) {
+ encodePtr enc = NULL;
+ zval* val;
+
+ if (hdrs) {
+ smart_str key = {0};
+ sdlSoapBindingFunctionHeaderPtr *hdr;
+
+ if (trav->ns) {
+ smart_str_appends(&key, (char*)trav->ns->href);
+ smart_str_appendc(&key,':');
+ }
+ smart_str_appends(&key, (char*)trav->name);
+ smart_str_0(&key);
+ if (zend_hash_find(hdrs, key.c, key.len+1, (void**)&hdr) == SUCCESS) {
+ enc = (*hdr)->encode;
+ }
+ smart_str_free(&key);
+ }
+ val = master_to_zval(enc, trav TSRMLS_CC);
+ add_assoc_zval(soap_headers, (char*)trav->name, val);
+ }
+ trav = trav->next;
+ }
+ }
+
+ xmlFreeDoc(response);
+ return TRUE;
+}
diff --git a/ext/soap/php_packet_soap.h b/ext/soap/php_packet_soap.h
new file mode 100644
index 0000000..210539b
--- /dev/null
+++ b/ext/soap/php_packet_soap.h
@@ -0,0 +1,27 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#ifndef PHP_PACKET_SOAP_H
+#define PHP_PACKET_SOAP_H
+
+int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers TSRMLS_DC);
+
+#endif
diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c
new file mode 100644
index 0000000..7d2e129
--- /dev/null
+++ b/ext/soap/php_schema.c
@@ -0,0 +1,2549 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#include "php_soap.h"
+#include "libxml/uri.h"
+
+static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpleType, sdlTypePtr cur_type);
+static int schema_complexType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compType, sdlTypePtr cur_type);
+static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypePtr cur_type);
+static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTypePtr cur_type);
+static int schema_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpCompType, sdlTypePtr cur_type);
+static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr restType, sdlTypePtr cur_type, int simpleType);
+static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr restType, sdlTypePtr cur_type);
+static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type);
+static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type);
+static int schema_sequence(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr seqType, sdlTypePtr cur_type, sdlContentModelPtr model);
+static int schema_all(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type, sdlContentModelPtr model);
+static int schema_choice(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr choiceType, sdlTypePtr cur_type, sdlContentModelPtr model);
+static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTypePtr cur_type, sdlContentModelPtr model);
+static int schema_any(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type, sdlContentModelPtr model);
+static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTypePtr cur_type, sdlContentModelPtr model);
+static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdlTypePtr cur_type, sdlCtx *ctx);
+static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdlTypePtr cur_type, sdlCtx *ctx);
+
+static int schema_restriction_var_int(xmlNodePtr val, sdlRestrictionIntPtr *valptr);
+
+static int schema_restriction_var_char(xmlNodePtr val, sdlRestrictionCharPtr *valptr);
+
+static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type);
+
+static encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const xmlChar *ns, const xmlChar *type)
+{
+ smart_str nscat = {0};
+ encodePtr enc, *enc_ptr;
+
+ if (sdl->encoders == NULL) {
+ sdl->encoders = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0);
+ }
+ smart_str_appends(&nscat, (char*)ns);
+ smart_str_appendc(&nscat, ':');
+ smart_str_appends(&nscat, (char*)type);
+ smart_str_0(&nscat);
+ if (zend_hash_find(sdl->encoders, nscat.c, nscat.len + 1, (void**)&enc_ptr) == SUCCESS) {
+ enc = *enc_ptr;
+ if (enc->details.ns) {
+ efree(enc->details.ns);
+ }
+ if (enc->details.type_str) {
+ efree(enc->details.type_str);
+ }
+ } else {
+ enc_ptr = NULL;
+ enc = emalloc(sizeof(encode));
+ }
+ memset(enc, 0, sizeof(encode));
+
+ enc->details.ns = estrdup((char*)ns);
+ enc->details.type_str = estrdup((char*)type);
+ enc->details.sdl_type = cur_type;
+ enc->to_xml = sdl_guess_convert_xml;
+ enc->to_zval = sdl_guess_convert_zval;
+
+ if (enc_ptr == NULL) {
+ zend_hash_update(sdl->encoders, nscat.c, nscat.len + 1, &enc, sizeof(encodePtr), NULL);
+ }
+ smart_str_free(&nscat);
+ return enc;
+}
+
+static encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const xmlChar *ns, const xmlChar *type)
+{
+ encodePtr enc = get_encoder(sdl, (char*)ns, (char*)type);
+ if (enc == NULL) {
+ enc = create_encoder(sdl, cur_type, ns, type);
+ }
+ return enc;
+}
+
+static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlAttrPtr tns, int import TSRMLS_DC) {
+ if (location != NULL &&
+ !zend_hash_exists(&ctx->docs, (char*)location, xmlStrlen(location)+1)) {
+ xmlDocPtr doc;
+ xmlNodePtr schema;
+ xmlAttrPtr new_tns;
+
+ sdl_set_uri_credentials(ctx, (char*)location TSRMLS_CC);
+ doc = soap_xmlParseFile((char*)location TSRMLS_CC);
+ sdl_restore_uri_credentials(ctx TSRMLS_CC);
+
+ if (doc == NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s'", location);
+ }
+ schema = get_node(doc->children, "schema");
+ if (schema == NULL) {
+ xmlFreeDoc(doc);
+ soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s'", location);
+ }
+ new_tns = get_attribute(schema->properties, "targetNamespace");
+ if (import) {
+ if (ns != NULL && (new_tns == NULL || xmlStrcmp(ns->children->content, new_tns->children->content) != 0)) {
+ xmlFreeDoc(doc);
+ soap_error2(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s'", location, ns->children->content);
+ }
+ if (ns == NULL && new_tns != NULL) {
+ xmlFreeDoc(doc);
+ soap_error2(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s'", location, new_tns->children->content);
+ }
+ } else {
+ new_tns = get_attribute(schema->properties, "targetNamespace");
+ if (new_tns == NULL) {
+ if (tns != NULL) {
+ xmlSetProp(schema, BAD_CAST("targetNamespace"), tns->children->content);
+ }
+ } else if (tns != NULL && xmlStrcmp(tns->children->content, new_tns->children->content) != 0) {
+ xmlFreeDoc(doc);
+ soap_error1(E_ERROR, "Parsing Schema: can't include schema from '%s', different 'targetNamespace'", location);
+ }
+ }
+ zend_hash_add(&ctx->docs, (char*)location, xmlStrlen(location)+1, (void**)&doc, sizeof(xmlDocPtr), NULL);
+ load_schema(ctx, schema TSRMLS_CC);
+ }
+}
+
+/*
+2.6.1 xsi:type
+2.6.2 xsi:nil
+2.6.3 xsi:schemaLocation, xsi:noNamespaceSchemaLocation
+*/
+
+/*
+<schema
+ attributeFormDefault = (qualified | unqualified) : unqualified
+ blockDefault = (#all | List of (extension | restriction | substitution)) : ''
+ elementFormDefault = (qualified | unqualified) : unqualified
+ finalDefault = (#all | List of (extension | restriction)) : ''
+ id = ID
+ targetNamespace = anyURI
+ version = token
+ xml:lang = language
+ {any attributes with non-schema namespace . . .}>
+ Content: ((include | import | redefine | annotation)*, (((simpleType | complexType | group | attributeGroup) | element | attribute | notation), annotation*)*)
+</schema>
+*/
+int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC)
+{
+ xmlNodePtr trav;
+ xmlAttrPtr tns;
+
+ if (!ctx->sdl->types) {
+ ctx->sdl->types = emalloc(sizeof(HashTable));
+ zend_hash_init(ctx->sdl->types, 0, NULL, delete_type, 0);
+ }
+ if (!ctx->attributes) {
+ ctx->attributes = emalloc(sizeof(HashTable));
+ zend_hash_init(ctx->attributes, 0, NULL, delete_attribute, 0);
+ }
+ if (!ctx->attributeGroups) {
+ ctx->attributeGroups = emalloc(sizeof(HashTable));
+ zend_hash_init(ctx->attributeGroups, 0, NULL, delete_type, 0);
+ }
+
+ tns = get_attribute(schema->properties, "targetNamespace");
+ if (tns == NULL) {
+ tns = xmlSetProp(schema, BAD_CAST("targetNamespace"), BAD_CAST(""));
+ xmlNewNs(schema, BAD_CAST(""), NULL);
+ }
+
+ trav = schema->children;
+ while (trav != NULL) {
+ if (node_is_equal(trav,"include")) {
+ xmlAttrPtr location;
+
+ location = get_attribute(trav->properties, "schemaLocation");
+ if (location == NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: include has no 'schemaLocation' attribute");
+ } else {
+ xmlChar *uri;
+ xmlChar *base = xmlNodeGetBase(trav->doc, trav);
+
+ if (base == NULL) {
+ uri = xmlBuildURI(location->children->content, trav->doc->URL);
+ } else {
+ uri = xmlBuildURI(location->children->content, base);
+ xmlFree(base);
+ }
+ schema_load_file(ctx, NULL, uri, tns, 0 TSRMLS_CC);
+ xmlFree(uri);
+ }
+
+ } else if (node_is_equal(trav,"redefine")) {
+ xmlAttrPtr location;
+
+ location = get_attribute(trav->properties, "schemaLocation");
+ if (location == NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: redefine has no 'schemaLocation' attribute");
+ } else {
+ xmlChar *uri;
+ xmlChar *base = xmlNodeGetBase(trav->doc, trav);
+
+ if (base == NULL) {
+ uri = xmlBuildURI(location->children->content, trav->doc->URL);
+ } else {
+ uri = xmlBuildURI(location->children->content, base);
+ xmlFree(base);
+ }
+ schema_load_file(ctx, NULL, uri, tns, 0 TSRMLS_CC);
+ xmlFree(uri);
+ /* TODO: <redefine> support */
+ }
+
+ } else if (node_is_equal(trav,"import")) {
+ xmlAttrPtr ns, location;
+ xmlChar *uri = NULL;
+
+ ns = get_attribute(trav->properties, "namespace");
+ location = get_attribute(trav->properties, "schemaLocation");
+
+ if (ns != NULL && tns != NULL && xmlStrcmp(ns->children->content, tns->children->content) == 0) {
+ if (location) {
+ soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s', namespace must not match the enclosing schema 'targetNamespace'", location->children->content);
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: can't import schema. Namespace must not match the enclosing schema 'targetNamespace'");
+ }
+ }
+ if (location) {
+ xmlChar *base = xmlNodeGetBase(trav->doc, trav);
+
+ if (base == NULL) {
+ uri = xmlBuildURI(location->children->content, trav->doc->URL);
+ } else {
+ uri = xmlBuildURI(location->children->content, base);
+ xmlFree(base);
+ }
+ }
+ schema_load_file(ctx, ns, uri, tns, 1 TSRMLS_CC);
+ if (uri != NULL) {xmlFree(uri);}
+ } else if (node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+/* annotation cleanup
+ xmlNodePtr tmp = trav;
+ trav = trav->next;
+ xmlUnlinkNode(tmp);
+ xmlFreeNode(tmp);
+ continue;
+*/
+ } else {
+ break;
+ }
+ trav = trav->next;
+ }
+
+ while (trav != NULL) {
+ if (node_is_equal(trav,"simpleType")) {
+ schema_simpleType(ctx->sdl, tns, trav, NULL);
+ } else if (node_is_equal(trav,"complexType")) {
+ schema_complexType(ctx->sdl, tns, trav, NULL);
+ } else if (node_is_equal(trav,"group")) {
+ schema_group(ctx->sdl, tns, trav, NULL, NULL);
+ } else if (node_is_equal(trav,"attributeGroup")) {
+ schema_attributeGroup(ctx->sdl, tns, trav, NULL, ctx);
+ } else if (node_is_equal(trav,"element")) {
+ schema_element(ctx->sdl, tns, trav, NULL, NULL);
+ } else if (node_is_equal(trav,"attribute")) {
+ schema_attribute(ctx->sdl, tns, trav, NULL, ctx);
+ } else if (node_is_equal(trav,"notation")) {
+ /* TODO: <notation> support */
+ } else if (node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in schema", trav->name);
+ }
+ trav = trav->next;
+ }
+ return TRUE;
+}
+
+/*
+<simpleType
+ final = (#all | (list | union | restriction))
+ id = ID
+ name = NCName
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, (restriction | list | union))
+</simpleType>
+*/
+static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpleType, sdlTypePtr cur_type)
+{
+ xmlNodePtr trav;
+ xmlAttrPtr name, ns;
+
+ ns = get_attribute(simpleType->properties, "targetNamespace");
+ if (ns == NULL) {
+ ns = tns;
+ }
+
+ name = get_attribute(simpleType->properties, "name");
+ if (cur_type != NULL) {
+ /* Anonymous type inside <element> or <restriction> */
+ sdlTypePtr newType, *ptr;
+
+ newType = emalloc(sizeof(sdlType));
+ memset(newType, 0, sizeof(sdlType));
+ newType->kind = XSD_TYPEKIND_SIMPLE;
+ if (name != NULL) {
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
+ } else {
+ newType->name = estrdup(cur_type->name);
+ newType->namens = estrdup(cur_type->namens);
+ }
+
+ zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr);
+
+ if (sdl->encoders == NULL) {
+ sdl->encoders = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0);
+ }
+ cur_type->encode = emalloc(sizeof(encode));
+ memset(cur_type->encode, 0, sizeof(encode));
+ cur_type->encode->details.ns = estrdup(newType->namens);
+ cur_type->encode->details.type_str = estrdup(newType->name);
+ cur_type->encode->details.sdl_type = *ptr;
+ cur_type->encode->to_xml = sdl_guess_convert_xml;
+ cur_type->encode->to_zval = sdl_guess_convert_zval;
+ zend_hash_next_index_insert(sdl->encoders, &cur_type->encode, sizeof(encodePtr), NULL);
+
+ cur_type =*ptr;
+
+ } else if (name != NULL) {
+ sdlTypePtr newType, *ptr;
+
+ newType = emalloc(sizeof(sdlType));
+ memset(newType, 0, sizeof(sdlType));
+ newType->kind = XSD_TYPEKIND_SIMPLE;
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
+
+ if (cur_type == NULL) {
+ zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr);
+ } else {
+ if (cur_type->elements == NULL) {
+ cur_type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0);
+ }
+ zend_hash_update(cur_type->elements, newType->name, strlen(newType->name)+1, &newType, sizeof(sdlTypePtr), (void **)&ptr);
+ }
+ cur_type = (*ptr);
+
+ create_encoder(sdl, cur_type, ns->children->content, name->children->content);
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: simpleType has no 'name' attribute");
+ }
+
+ trav = simpleType->children;
+ if (trav != NULL && node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ if (node_is_equal(trav,"restriction")) {
+ schema_restriction_simpleContent(sdl, tns, trav, cur_type, 1);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"list")) {
+ cur_type->kind = XSD_TYPEKIND_LIST;
+ schema_list(sdl, tns, trav, cur_type);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"union")) {
+ cur_type->kind = XSD_TYPEKIND_UNION;
+ schema_union(sdl, tns, trav, cur_type);
+ trav = trav->next;
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name);
+ }
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: expected <restriction>, <list> or <union> in simpleType");
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name);
+ }
+
+ return TRUE;
+}
+
+/*
+<list
+ id = ID
+ itemType = QName
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, (simpleType?))
+</list>
+*/
+static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypePtr cur_type)
+{
+ xmlNodePtr trav;
+ xmlAttrPtr itemType;
+
+ itemType = get_attribute(listType->properties, "itemType");
+ if (itemType != NULL) {
+ char *type, *ns;
+ xmlNsPtr nsptr;
+
+ parse_namespace(itemType->children->content, &type, &ns);
+ nsptr = xmlSearchNs(listType->doc, listType, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ sdlTypePtr newType, *tmp;
+
+ newType = emalloc(sizeof(sdlType));
+ memset(newType, 0, sizeof(sdlType));
+
+ newType->name = estrdup(type);
+ newType->namens = estrdup((char*)nsptr->href);
+
+ newType->encode = get_create_encoder(sdl, newType, nsptr->href, BAD_CAST(type));
+
+ if (cur_type->elements == NULL) {
+ cur_type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0);
+ }
+ zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp);
+ }
+ if (type) {efree(type);}
+ if (ns) {efree(ns);}
+ }
+
+ trav = listType->children;
+ if (trav != NULL && node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ if (trav != NULL && node_is_equal(trav,"simpleType")) {
+ sdlTypePtr newType, *tmp;
+
+ if (itemType != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'itemType' attribute and subtype");
+ }
+
+ newType = emalloc(sizeof(sdlType));
+ memset(newType, 0, sizeof(sdlType));
+
+ {
+ smart_str anonymous = {0};
+
+ smart_str_appendl(&anonymous, "anonymous", sizeof("anonymous")-1);
+ smart_str_append_long(&anonymous, zend_hash_num_elements(sdl->types));
+ smart_str_0(&anonymous);
+ newType->name = anonymous.c;
+ }
+ newType->namens = estrdup((char*)tns->children->content);
+
+ if (cur_type->elements == NULL) {
+ cur_type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0);
+ }
+ zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp);
+
+ schema_simpleType(sdl, tns, trav, newType);
+
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in list", trav->name);
+ }
+ return TRUE;
+}
+
+/*
+<union
+ id = ID
+ memberTypes = List of QName
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, (simpleType*))
+</union>
+*/
+static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTypePtr cur_type)
+{
+ xmlNodePtr trav;
+ xmlAttrPtr memberTypes;
+
+ memberTypes = get_attribute(unionType->properties, "memberTypes");
+ if (memberTypes != NULL) {
+ char *str, *start, *end, *next;
+ char *type, *ns;
+ xmlNsPtr nsptr;
+
+ str = estrdup((char*)memberTypes->children->content);
+ whiteSpace_collapse(BAD_CAST(str));
+ start = str;
+ while (start != NULL && *start != '\0') {
+ end = strchr(start,' ');
+ if (end == NULL) {
+ next = NULL;
+ } else {
+ *end = '\0';
+ next = end+1;
+ }
+
+ parse_namespace(BAD_CAST(start), &type, &ns);
+ nsptr = xmlSearchNs(unionType->doc, unionType, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ sdlTypePtr newType, *tmp;
+
+ newType = emalloc(sizeof(sdlType));
+ memset(newType, 0, sizeof(sdlType));
+
+ newType->name = estrdup(type);
+ newType->namens = estrdup((char*)nsptr->href);
+
+ newType->encode = get_create_encoder(sdl, newType, nsptr->href, BAD_CAST(type));
+
+ if (cur_type->elements == NULL) {
+ cur_type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0);
+ }
+ zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp);
+ }
+ if (type) {efree(type);}
+ if (ns) {efree(ns);}
+
+ start = next;
+ }
+ efree(str);
+ }
+
+ trav = unionType->children;
+ if (trav != NULL && node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ while (trav != NULL) {
+ if (node_is_equal(trav,"simpleType")) {
+ sdlTypePtr newType, *tmp;
+
+ newType = emalloc(sizeof(sdlType));
+ memset(newType, 0, sizeof(sdlType));
+
+ {
+ smart_str anonymous = {0};
+
+ smart_str_appendl(&anonymous, "anonymous", sizeof("anonymous")-1);
+ smart_str_append_long(&anonymous, zend_hash_num_elements(sdl->types));
+ smart_str_0(&anonymous);
+ newType->name = anonymous.c;
+ }
+ newType->namens = estrdup((char*)tns->children->content);
+
+ if (cur_type->elements == NULL) {
+ cur_type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0);
+ }
+ zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp);
+
+ schema_simpleType(sdl, tns, trav, newType);
+
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name);
+ }
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name);
+ }
+ return TRUE;
+}
+
+/*
+<simpleContent
+ id = ID
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, (restriction | extension))
+</simpleContent>
+*/
+static int schema_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpCompType, sdlTypePtr cur_type)
+{
+ xmlNodePtr trav;
+
+ trav = simpCompType->children;
+ if (trav != NULL && node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ if (node_is_equal(trav, "restriction")) {
+ cur_type->kind = XSD_TYPEKIND_RESTRICTION;
+ schema_restriction_simpleContent(sdl, tns, trav, cur_type, 0);
+ trav = trav->next;
+ } else if (node_is_equal(trav, "extension")) {
+ cur_type->kind = XSD_TYPEKIND_EXTENSION;
+ schema_extension_simpleContent(sdl, tns, trav, cur_type);
+ trav = trav->next;
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name);
+ }
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: expected <restriction> or <extension> in simpleContent");
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name);
+ }
+
+ return TRUE;
+}
+
+/*
+simpleType:<restriction
+ base = QName
+ id = ID
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern)*)?)
+</restriction>
+simpleContent:<restriction
+ base = QName
+ id = ID
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern)*)?, ((attribute | attributeGroup)*, anyAttribute?))
+</restriction>
+*/
+static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr restType, sdlTypePtr cur_type, int simpleType)
+{
+ xmlNodePtr trav;
+ xmlAttrPtr base;
+
+ base = get_attribute(restType->properties, "base");
+ if (base != NULL) {
+ char *type, *ns;
+ xmlNsPtr nsptr;
+
+ parse_namespace(base->children->content, &type, &ns);
+ nsptr = xmlSearchNs(restType->doc, restType, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(type));
+ }
+ if (type) {efree(type);}
+ if (ns) {efree(ns);}
+ } else if (!simpleType) {
+ soap_error0(E_ERROR, "Parsing Schema: restriction has no 'base' attribute");
+ }
+
+ if (cur_type->restrictions == NULL) {
+ cur_type->restrictions = emalloc(sizeof(sdlRestrictions));
+ memset(cur_type->restrictions, 0, sizeof(sdlRestrictions));
+ }
+
+ trav = restType->children;
+ if (trav != NULL && node_is_equal(trav, "annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ if (trav != NULL && node_is_equal(trav, "simpleType")) {
+ schema_simpleType(sdl, tns, trav, cur_type);
+ trav = trav->next;
+ }
+ while (trav != NULL) {
+ if (node_is_equal(trav, "minExclusive")) {
+ schema_restriction_var_int(trav, &cur_type->restrictions->minExclusive);
+ } else if (node_is_equal(trav, "minInclusive")) {
+ schema_restriction_var_int(trav, &cur_type->restrictions->minInclusive);
+ } else if (node_is_equal(trav, "maxExclusive")) {
+ schema_restriction_var_int(trav, &cur_type->restrictions->maxExclusive);
+ } else if (node_is_equal(trav, "maxInclusive")) {
+ schema_restriction_var_int(trav, &cur_type->restrictions->maxInclusive);
+ } else if (node_is_equal(trav, "totalDigits")) {
+ schema_restriction_var_int(trav, &cur_type->restrictions->totalDigits);
+ } else if (node_is_equal(trav, "fractionDigits")) {
+ schema_restriction_var_int(trav, &cur_type->restrictions->fractionDigits);
+ } else if (node_is_equal(trav, "length")) {
+ schema_restriction_var_int(trav, &cur_type->restrictions->length);
+ } else if (node_is_equal(trav, "minLength")) {
+ schema_restriction_var_int(trav, &cur_type->restrictions->minLength);
+ } else if (node_is_equal(trav, "maxLength")) {
+ schema_restriction_var_int(trav, &cur_type->restrictions->maxLength);
+ } else if (node_is_equal(trav, "whiteSpace")) {
+ schema_restriction_var_char(trav, &cur_type->restrictions->whiteSpace);
+ } else if (node_is_equal(trav, "pattern")) {
+ schema_restriction_var_char(trav, &cur_type->restrictions->pattern);
+ } else if (node_is_equal(trav, "enumeration")) {
+ sdlRestrictionCharPtr enumval = NULL;
+
+ schema_restriction_var_char(trav, &enumval);
+ if (cur_type->restrictions->enumeration == NULL) {
+ cur_type->restrictions->enumeration = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->restrictions->enumeration, 0, NULL, delete_restriction_var_char, 0);
+ }
+ if (zend_hash_add(cur_type->restrictions->enumeration, enumval->value, strlen(enumval->value)+1, &enumval, sizeof(sdlRestrictionCharPtr), NULL) == FAILURE) {
+ delete_restriction_var_char(&enumval);
+ }
+ } else {
+ break;
+ }
+ trav = trav->next;
+ }
+ if (!simpleType) {
+ while (trav != NULL) {
+ if (node_is_equal(trav,"attribute")) {
+ schema_attribute(sdl, tns, trav, cur_type, NULL);
+ } else if (node_is_equal(trav,"attributeGroup")) {
+ schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
+ } else if (node_is_equal(trav,"anyAttribute")) {
+ /* TODO: <anyAttribute> support */
+ trav = trav->next;
+ break;
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name);
+ }
+ trav = trav->next;
+ }
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name);
+ }
+
+ return TRUE;
+}
+
+/*
+<restriction
+ base = QName
+ id = ID
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, (group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?))
+</restriction>
+*/
+static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr restType, sdlTypePtr cur_type)
+{
+ xmlAttrPtr base;
+ xmlNodePtr trav;
+
+ base = get_attribute(restType->properties, "base");
+ if (base != NULL) {
+ char *type, *ns;
+ xmlNsPtr nsptr;
+
+ parse_namespace(base->children->content, &type, &ns);
+ nsptr = xmlSearchNs(restType->doc, restType, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(type));
+ }
+ if (type) {efree(type);}
+ if (ns) {efree(ns);}
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: restriction has no 'base' attribute");
+ }
+
+ trav = restType->children;
+ if (trav != NULL && node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ if (node_is_equal(trav,"group")) {
+ schema_group(sdl, tns, trav, cur_type, NULL);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"all")) {
+ schema_all(sdl, tns, trav, cur_type, NULL);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"choice")) {
+ schema_choice(sdl, tns, trav, cur_type, NULL);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"sequence")) {
+ schema_sequence(sdl, tns, trav, cur_type, NULL);
+ trav = trav->next;
+ }
+ }
+ while (trav != NULL) {
+ if (node_is_equal(trav,"attribute")) {
+ schema_attribute(sdl, tns, trav, cur_type, NULL);
+ } else if (node_is_equal(trav,"attributeGroup")) {
+ schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
+ } else if (node_is_equal(trav,"anyAttribute")) {
+ /* TODO: <anyAttribute> support */
+ trav = trav->next;
+ break;
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name);
+ }
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name);
+ }
+
+ return TRUE;
+}
+
+static int schema_restriction_var_int(xmlNodePtr val, sdlRestrictionIntPtr *valptr)
+{
+ xmlAttrPtr fixed, value;
+
+ if ((*valptr) == NULL) {
+ (*valptr) = emalloc(sizeof(sdlRestrictionInt));
+ }
+ memset((*valptr), 0, sizeof(sdlRestrictionInt));
+
+ fixed = get_attribute(val->properties, "fixed");
+ (*valptr)->fixed = FALSE;
+ if (fixed != NULL) {
+ if (!strncmp((char*)fixed->children->content, "true", sizeof("true")) ||
+ !strncmp((char*)fixed->children->content, "1", sizeof("1")))
+ (*valptr)->fixed = TRUE;
+ }
+
+ value = get_attribute(val->properties, "value");
+ if (value == NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: missing restriction value");
+ }
+
+ (*valptr)->value = atoi((char*)value->children->content);
+
+ return TRUE;
+}
+
+static int schema_restriction_var_char(xmlNodePtr val, sdlRestrictionCharPtr *valptr)
+{
+ xmlAttrPtr fixed, value;
+
+ if ((*valptr) == NULL) {
+ (*valptr) = emalloc(sizeof(sdlRestrictionChar));
+ }
+ memset((*valptr), 0, sizeof(sdlRestrictionChar));
+
+ fixed = get_attribute(val->properties, "fixed");
+ (*valptr)->fixed = FALSE;
+ if (fixed != NULL) {
+ if (!strncmp((char*)fixed->children->content, "true", sizeof("true")) ||
+ !strncmp((char*)fixed->children->content, "1", sizeof("1"))) {
+ (*valptr)->fixed = TRUE;
+ }
+ }
+
+ value = get_attribute(val->properties, "value");
+ if (value == NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: missing restriction value");
+ }
+
+ (*valptr)->value = estrdup((char*)value->children->content);
+ return TRUE;
+}
+
+/*
+From simpleContent (not supported):
+<extension
+ base = QName
+ id = ID
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?))
+</extension>
+*/
+static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type)
+{
+ xmlNodePtr trav;
+ xmlAttrPtr base;
+
+ base = get_attribute(extType->properties, "base");
+ if (base != NULL) {
+ char *type, *ns;
+ xmlNsPtr nsptr;
+
+ parse_namespace(base->children->content, &type, &ns);
+ nsptr = xmlSearchNs(extType->doc, extType, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(type));
+ }
+ if (type) {efree(type);}
+ if (ns) {efree(ns);}
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: extension has no 'base' attribute");
+ }
+
+ trav = extType->children;
+ if (trav != NULL && node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ while (trav != NULL) {
+ if (node_is_equal(trav,"attribute")) {
+ schema_attribute(sdl, tns, trav, cur_type, NULL);
+ } else if (node_is_equal(trav,"attributeGroup")) {
+ schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
+ } else if (node_is_equal(trav,"anyAttribute")) {
+ /* TODO: <anyAttribute> support */
+ trav = trav->next;
+ break;
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name);
+ }
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name);
+ }
+ return TRUE;
+}
+
+/*
+From complexContent:
+<extension
+ base = QName
+ id = ID
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))
+</extension>
+*/
+static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type)
+{
+ xmlNodePtr trav;
+ xmlAttrPtr base;
+
+ base = get_attribute(extType->properties, "base");
+ if (base != NULL) {
+ char *type, *ns;
+ xmlNsPtr nsptr;
+
+ parse_namespace(base->children->content, &type, &ns);
+ nsptr = xmlSearchNs(extType->doc, extType, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(type));
+ }
+ if (type) {efree(type);}
+ if (ns) {efree(ns);}
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: extension has no 'base' attribute");
+ }
+
+ trav = extType->children;
+ if (trav != NULL && node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ if (node_is_equal(trav,"group")) {
+ schema_group(sdl, tns, trav, cur_type, NULL);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"all")) {
+ schema_all(sdl, tns, trav, cur_type, NULL);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"choice")) {
+ schema_choice(sdl, tns, trav, cur_type, NULL);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"sequence")) {
+ schema_sequence(sdl, tns, trav, cur_type, NULL);
+ trav = trav->next;
+ }
+ }
+ while (trav != NULL) {
+ if (node_is_equal(trav,"attribute")) {
+ schema_attribute(sdl, tns, trav, cur_type, NULL);
+ } else if (node_is_equal(trav,"attributeGroup")) {
+ schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
+ } else if (node_is_equal(trav,"anyAttribute")) {
+ /* TODO: <anyAttribute> support */
+ trav = trav->next;
+ break;
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name);
+ }
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name);
+ }
+ return TRUE;
+}
+
+void schema_min_max(xmlNodePtr node, sdlContentModelPtr model)
+{
+ xmlAttrPtr attr = get_attribute(node->properties, "minOccurs");
+
+ if (attr) {
+ model->min_occurs = atoi((char*)attr->children->content);
+ } else {
+ model->min_occurs = 1;
+ }
+
+ attr = get_attribute(node->properties, "maxOccurs");
+ if (attr) {
+ if (!strncmp((char*)attr->children->content, "unbounded", sizeof("unbounded"))) {
+ model->max_occurs = -1;
+ } else {
+ model->max_occurs = atoi((char*)attr->children->content);
+ }
+ } else {
+ model->max_occurs = 1;
+ }
+}
+
+/*
+<all
+ id = ID
+ maxOccurs = 1 : 1
+ minOccurs = (0 | 1) : 1
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, element*)
+</all>
+*/
+static int schema_all(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr all, sdlTypePtr cur_type, sdlContentModelPtr model)
+{
+ xmlNodePtr trav;
+ sdlContentModelPtr newModel;
+
+ newModel = emalloc(sizeof(sdlContentModel));
+ newModel->kind = XSD_CONTENT_ALL;
+ newModel->u.content = emalloc(sizeof(HashTable));
+ zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0);
+ if (model == NULL) {
+ cur_type->model = newModel;
+ } else {
+ zend_hash_next_index_insert(model->u.content,&newModel,sizeof(sdlContentModelPtr), NULL);
+ }
+
+ schema_min_max(all, newModel);
+
+ trav = all->children;
+ if (trav != NULL && node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ while (trav != NULL) {
+ if (node_is_equal(trav,"element")) {
+ schema_element(sdl, tns, trav, cur_type, newModel);
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in all", trav->name);
+ }
+ trav = trav->next;
+ }
+ return TRUE;
+}
+
+/*
+<group
+ name = NCName
+ Content: (annotation?, (all | choice | sequence))
+</group>
+<group
+ name = NCName
+ ref = QName>
+ Content: (annotation?)
+</group>
+*/
+static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTypePtr cur_type, sdlContentModelPtr model)
+{
+ xmlNodePtr trav;
+ xmlAttrPtr ns, name, ref = NULL;
+ sdlContentModelPtr newModel;
+
+ ns = get_attribute(groupType->properties, "targetNamespace");
+ if (ns == NULL) {
+ ns = tns;
+ }
+
+ name = get_attribute(groupType->properties, "name");
+ if (name == NULL) {
+ name = ref = get_attribute(groupType->properties, "ref");
+ }
+
+ if (name) {
+ smart_str key = {0};
+
+ if (ref) {
+ char *type, *ns;
+ xmlNsPtr nsptr;
+
+ parse_namespace(ref->children->content, &type, &ns);
+ nsptr = xmlSearchNs(groupType->doc, groupType, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ smart_str_appends(&key, (char*)nsptr->href);
+ }
+ smart_str_appendc(&key, ':');
+ smart_str_appends(&key, type);
+ smart_str_0(&key);
+
+ newModel = emalloc(sizeof(sdlContentModel));
+ newModel->kind = XSD_CONTENT_GROUP_REF;
+ newModel->u.group_ref = estrdup(key.c);
+
+ if (type) {efree(type);}
+ if (ns) {efree(ns);}
+ } else {
+ newModel = emalloc(sizeof(sdlContentModel));
+ newModel->kind = XSD_CONTENT_SEQUENCE; /* will be redefined */
+ newModel->u.content = emalloc(sizeof(HashTable));
+ zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0);
+
+ smart_str_appends(&key, (char*)ns->children->content);
+ smart_str_appendc(&key, ':');
+ smart_str_appends(&key, (char*)name->children->content);
+ smart_str_0(&key);
+ }
+
+ if (cur_type == NULL) {
+ sdlTypePtr newType;
+
+ newType = emalloc(sizeof(sdlType));
+ memset(newType, 0, sizeof(sdlType));
+
+ if (sdl->groups == NULL) {
+ sdl->groups = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->groups, 0, NULL, delete_type, 0);
+ }
+ if (zend_hash_add(sdl->groups, key.c, key.len+1, (void**)&newType, sizeof(sdlTypePtr), NULL) != SUCCESS) {
+ soap_error1(E_ERROR, "Parsing Schema: group '%s' already defined", key.c);
+ }
+
+ cur_type = newType;
+ }
+ smart_str_free(&key);
+
+ if (model == NULL) {
+ cur_type->model = newModel;
+ } else {
+ zend_hash_next_index_insert(model->u.content, &newModel, sizeof(sdlContentModelPtr), NULL);
+ }
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: group has no 'name' nor 'ref' attributes");
+ }
+
+ schema_min_max(groupType, newModel);
+
+ trav = groupType->children;
+ if (trav != NULL && node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ if (node_is_equal(trav,"choice")) {
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent");
+ }
+ newModel->kind = XSD_CONTENT_CHOICE;
+ schema_choice(sdl, tns, trav, cur_type, newModel);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"sequence")) {
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent");
+ }
+ newModel->kind = XSD_CONTENT_SEQUENCE;
+ schema_sequence(sdl, tns, trav, cur_type, newModel);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"all")) {
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent");
+ }
+ newModel->kind = XSD_CONTENT_ALL;
+ schema_all(sdl, tns, trav, cur_type, newModel);
+ trav = trav->next;
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name);
+ }
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name);
+ }
+ return TRUE;
+}
+/*
+<choice
+ id = ID
+ maxOccurs = (nonNegativeInteger | unbounded) : 1
+ minOccurs = nonNegativeInteger : 1
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, (element | group | choice | sequence | any)*)
+</choice>
+*/
+static int schema_choice(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr choiceType, sdlTypePtr cur_type, sdlContentModelPtr model)
+{
+ xmlNodePtr trav;
+ sdlContentModelPtr newModel;
+
+ newModel = emalloc(sizeof(sdlContentModel));
+ newModel->kind = XSD_CONTENT_CHOICE;
+ newModel->u.content = emalloc(sizeof(HashTable));
+ zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0);
+ if (model == NULL) {
+ cur_type->model = newModel;
+ } else {
+ zend_hash_next_index_insert(model->u.content,&newModel,sizeof(sdlContentModelPtr), NULL);
+ }
+
+ schema_min_max(choiceType, newModel);
+
+ trav = choiceType->children;
+ if (trav != NULL && node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ while (trav != NULL) {
+ if (node_is_equal(trav,"element")) {
+ schema_element(sdl, tns, trav, cur_type, newModel);
+ } else if (node_is_equal(trav,"group")) {
+ schema_group(sdl, tns, trav, cur_type, newModel);
+ } else if (node_is_equal(trav,"choice")) {
+ schema_choice(sdl, tns, trav, cur_type, newModel);
+ } else if (node_is_equal(trav,"sequence")) {
+ schema_sequence(sdl, tns, trav, cur_type, newModel);
+ } else if (node_is_equal(trav,"any")) {
+ schema_any(sdl, tns, trav, cur_type, newModel);
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in choice", trav->name);
+ }
+ trav = trav->next;
+ }
+ return TRUE;
+}
+
+/*
+<sequence
+ id = ID
+ maxOccurs = (nonNegativeInteger | unbounded) : 1
+ minOccurs = nonNegativeInteger : 1
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, (element | group | choice | sequence | any)*)
+</sequence>
+*/
+static int schema_sequence(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr seqType, sdlTypePtr cur_type, sdlContentModelPtr model)
+{
+ xmlNodePtr trav;
+ sdlContentModelPtr newModel;
+
+ newModel = emalloc(sizeof(sdlContentModel));
+ newModel->kind = XSD_CONTENT_SEQUENCE;
+ newModel->u.content = emalloc(sizeof(HashTable));
+ zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0);
+ if (model == NULL) {
+ cur_type->model = newModel;
+ } else {
+ zend_hash_next_index_insert(model->u.content,&newModel,sizeof(sdlContentModelPtr), NULL);
+ }
+
+ schema_min_max(seqType, newModel);
+
+ trav = seqType->children;
+ if (trav != NULL && node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ while (trav != NULL) {
+ if (node_is_equal(trav,"element")) {
+ schema_element(sdl, tns, trav, cur_type, newModel);
+ } else if (node_is_equal(trav,"group")) {
+ schema_group(sdl, tns, trav, cur_type, newModel);
+ } else if (node_is_equal(trav,"choice")) {
+ schema_choice(sdl, tns, trav, cur_type, newModel);
+ } else if (node_is_equal(trav,"sequence")) {
+ schema_sequence(sdl, tns, trav, cur_type, newModel);
+ } else if (node_is_equal(trav,"any")) {
+ schema_any(sdl, tns, trav, cur_type, newModel);
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in sequence", trav->name);
+ }
+ trav = trav->next;
+ }
+ return TRUE;
+}
+
+/*
+<any
+ id = ID
+ maxOccurs = (nonNegativeInteger | unbounded) : 1
+ minOccurs = nonNegativeInteger : 1
+ namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) ) : ##any
+ processContents = (lax | skip | strict) : strict
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?)
+</any>
+*/
+static int schema_any(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr anyType, sdlTypePtr cur_type, sdlContentModelPtr model)
+{
+ if (model != NULL) {
+ sdlContentModelPtr newModel;
+
+ newModel = emalloc(sizeof(sdlContentModel));
+ newModel->kind = XSD_CONTENT_ANY;
+
+ schema_min_max(anyType, newModel);
+
+ zend_hash_next_index_insert(model->u.content, &newModel, sizeof(sdlContentModelPtr), NULL);
+ }
+ return TRUE;
+}
+
+/*
+<complexContent
+ id = ID
+ mixed = boolean
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, (restriction | extension))
+</complexContent>
+*/
+static int schema_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compCont, sdlTypePtr cur_type)
+{
+ xmlNodePtr trav;
+
+ trav = compCont->children;
+ if (trav != NULL && node_is_equal(trav,"annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ if (node_is_equal(trav, "restriction")) {
+ cur_type->kind = XSD_TYPEKIND_RESTRICTION;
+ schema_restriction_complexContent(sdl, tns, trav, cur_type);
+ trav = trav->next;
+ } else if (node_is_equal(trav, "extension")) {
+ cur_type->kind = XSD_TYPEKIND_EXTENSION;
+ schema_extension_complexContent(sdl, tns, trav, cur_type);
+ trav = trav->next;
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name);
+ }
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: <restriction> or <extension> expected in complexContent");
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name);
+ }
+
+ return TRUE;
+}
+
+/*
+<complexType
+ abstract = boolean : false
+ block = (#all | List of (extension | restriction))
+ final = (#all | List of (extension | restriction))
+ id = ID
+ mixed = boolean : false
+ name = NCName
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?))))
+</complexType>
+*/
+static int schema_complexType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compType, sdlTypePtr cur_type)
+{
+ xmlNodePtr trav;
+ xmlAttrPtr attrs, name, ns;
+
+ attrs = compType->properties;
+ ns = get_attribute(attrs, "targetNamespace");
+ if (ns == NULL) {
+ ns = tns;
+ }
+
+ name = get_attribute(attrs, "name");
+ if (cur_type != NULL) {
+ /* Anonymous type inside <element> */
+ sdlTypePtr newType, *ptr;
+
+ newType = emalloc(sizeof(sdlType));
+ memset(newType, 0, sizeof(sdlType));
+ newType->kind = XSD_TYPEKIND_COMPLEX;
+ if (name != NULL) {
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
+ } else {
+ newType->name = estrdup(cur_type->name);
+ newType->namens = estrdup(cur_type->namens);
+ }
+
+ zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr);
+
+ if (sdl->encoders == NULL) {
+ sdl->encoders = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0);
+ }
+ cur_type->encode = emalloc(sizeof(encode));
+ memset(cur_type->encode, 0, sizeof(encode));
+ cur_type->encode->details.ns = estrdup(newType->namens);
+ cur_type->encode->details.type_str = estrdup(newType->name);
+ cur_type->encode->details.sdl_type = *ptr;
+ cur_type->encode->to_xml = sdl_guess_convert_xml;
+ cur_type->encode->to_zval = sdl_guess_convert_zval;
+ zend_hash_next_index_insert(sdl->encoders, &cur_type->encode, sizeof(encodePtr), NULL);
+
+ cur_type =*ptr;
+
+ } else if (name) {
+ sdlTypePtr newType, *ptr;
+
+ newType = emalloc(sizeof(sdlType));
+ memset(newType, 0, sizeof(sdlType));
+ newType->kind = XSD_TYPEKIND_COMPLEX;
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
+
+ zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr);
+
+ cur_type = (*ptr);
+ create_encoder(sdl, cur_type, ns->children->content, name->children->content);
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: complexType has no 'name' attribute");
+ return FALSE;
+ }
+
+ trav = compType->children;
+ if (trav != NULL && node_is_equal(trav, "annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ if (node_is_equal(trav,"simpleContent")) {
+ schema_simpleContent(sdl, tns, trav, cur_type);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"complexContent")) {
+ schema_complexContent(sdl, tns, trav, cur_type);
+ trav = trav->next;
+ } else {
+ if (node_is_equal(trav,"group")) {
+ schema_group(sdl, tns, trav, cur_type, NULL);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"all")) {
+ schema_all(sdl, tns, trav, cur_type, NULL);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"choice")) {
+ schema_choice(sdl, tns, trav, cur_type, NULL);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"sequence")) {
+ schema_sequence(sdl, tns, trav, cur_type, NULL);
+ trav = trav->next;
+ }
+ while (trav != NULL) {
+ if (node_is_equal(trav,"attribute")) {
+ schema_attribute(sdl, tns, trav, cur_type, NULL);
+ } else if (node_is_equal(trav,"attributeGroup")) {
+ schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
+ } else if (node_is_equal(trav,"anyAttribute")) {
+ /* TODO: <anyAttribute> support */
+ trav = trav->next;
+ break;
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name);
+ }
+ trav = trav->next;
+ }
+ }
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name);
+ }
+ return TRUE;
+}
+/*
+<element
+ abstract = boolean : false
+ block = (#all | List of (extension | restriction | substitution))
+ default = string
+ final = (#all | List of (extension | restriction))
+ fixed = string
+ form = (qualified | unqualified)
+ id = ID
+ maxOccurs = (nonNegativeInteger | unbounded) : 1
+ minOccurs = nonNegativeInteger : 1
+ name = NCName
+ nillable = boolean : false
+ ref = QName
+ substitutionGroup = QName
+ type = QName
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*))
+</element>
+*/
+static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTypePtr cur_type, sdlContentModelPtr model)
+{
+ xmlNodePtr trav;
+ xmlAttrPtr attrs, attr, ns, name, type, ref = NULL;
+
+ attrs = element->properties;
+ ns = get_attribute(attrs, "targetNamespace");
+ if (ns == NULL) {
+ ns = tns;
+ }
+
+ name = get_attribute(attrs, "name");
+ if (name == NULL) {
+ name = ref = get_attribute(attrs, "ref");
+ }
+
+ if (name) {
+ HashTable *addHash;
+ sdlTypePtr newType;
+ smart_str key = {0};
+
+ newType = emalloc(sizeof(sdlType));
+ memset(newType, 0, sizeof(sdlType));
+
+ if (ref) {
+ smart_str nscat = {0};
+ char *type, *ns;
+ xmlNsPtr nsptr;
+
+ parse_namespace(ref->children->content, &type, &ns);
+ nsptr = xmlSearchNs(element->doc, element, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ smart_str_appends(&nscat, (char*)nsptr->href);
+ newType->namens = estrdup((char*)nsptr->href);
+ }
+ smart_str_appendc(&nscat, ':');
+ smart_str_appends(&nscat, type);
+ newType->name = estrdup(type);
+ smart_str_0(&nscat);
+ if (type) {efree(type);}
+ if (ns) {efree(ns);}
+ newType->ref = estrdup(nscat.c);
+ smart_str_free(&nscat);
+ } else {
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
+ }
+
+ newType->nillable = FALSE;
+
+ if (cur_type == NULL) {
+ if (sdl->elements == NULL) {
+ sdl->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->elements, 0, NULL, delete_type, 0);
+ }
+ addHash = sdl->elements;
+ smart_str_appends(&key, newType->namens);
+ smart_str_appendc(&key, ':');
+ smart_str_appends(&key, newType->name);
+ } else {
+ if (cur_type->elements == NULL) {
+ cur_type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0);
+ }
+ addHash = cur_type->elements;
+ smart_str_appends(&key, newType->name);
+ }
+
+ smart_str_0(&key);
+ if (zend_hash_add(addHash, key.c, key.len + 1, &newType, sizeof(sdlTypePtr), NULL) != SUCCESS) {
+ if (cur_type == NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: element '%s' already defined", key.c);
+ } else {
+ zend_hash_next_index_insert(addHash, &newType, sizeof(sdlTypePtr), NULL);
+ }
+ }
+ smart_str_free(&key);
+
+ if (model != NULL) {
+ sdlContentModelPtr newModel = emalloc(sizeof(sdlContentModel));
+
+ newModel->kind = XSD_CONTENT_ELEMENT;
+ newModel->u.element = newType;
+
+ schema_min_max(element, newModel);
+
+
+ zend_hash_next_index_insert(model->u.content, &newModel, sizeof(sdlContentModelPtr), NULL);
+ }
+ cur_type = newType;
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: element has no 'name' nor 'ref' attributes");
+ }
+
+ /* nillable = boolean : false */
+ attrs = element->properties;
+ attr = get_attribute(attrs, "nillable");
+ if (attr) {
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'nillable' attributes");
+ }
+ if (!stricmp((char*)attr->children->content, "true") ||
+ !stricmp((char*)attr->children->content, "1")) {
+ cur_type->nillable = TRUE;
+ } else {
+ cur_type->nillable = FALSE;
+ }
+ } else {
+ cur_type->nillable = FALSE;
+ }
+
+ attr = get_attribute(attrs, "fixed");
+ if (attr) {
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes");
+ }
+ cur_type->fixed = estrdup((char*)attr->children->content);
+ }
+
+ attr = get_attribute(attrs, "default");
+ if (attr) {
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes");
+ } else if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'default' and 'fixed' attributes");
+ }
+ cur_type->def = estrdup((char*)attr->children->content);
+ }
+
+ /* form */
+ attr = get_attribute(attrs, "form");
+ if (attr) {
+ if (strncmp((char*)attr->children->content, "qualified", sizeof("qualified")) == 0) {
+ cur_type->form = XSD_FORM_QUALIFIED;
+ } else if (strncmp((char*)attr->children->content, "unqualified", sizeof("unqualified")) == 0) {
+ cur_type->form = XSD_FORM_UNQUALIFIED;
+ } else {
+ cur_type->form = XSD_FORM_DEFAULT;
+ }
+ } else {
+ cur_type->form = XSD_FORM_DEFAULT;
+ }
+ if (cur_type->form == XSD_FORM_DEFAULT) {
+ xmlNodePtr parent = element->parent;
+ while (parent) {
+ if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) {
+ xmlAttrPtr def;
+ def = get_attribute(parent->properties, "elementFormDefault");
+ if(def == NULL || strncmp((char*)def->children->content, "qualified", sizeof("qualified"))) {
+ cur_type->form = XSD_FORM_UNQUALIFIED;
+ } else {
+ cur_type->form = XSD_FORM_QUALIFIED;
+ }
+ break;
+ }
+ parent = parent->parent;
+ }
+ if (parent == NULL) {
+ cur_type->form = XSD_FORM_UNQUALIFIED;
+ }
+ }
+
+ /* type = QName */
+ type = get_attribute(attrs, "type");
+ if (type) {
+ char *cptype, *str_ns;
+ xmlNsPtr nsptr;
+
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'type' attributes");
+ }
+ parse_namespace(type->children->content, &cptype, &str_ns);
+ nsptr = xmlSearchNs(element->doc, element, BAD_CAST(str_ns));
+ if (nsptr != NULL) {
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(cptype));
+ }
+ if (str_ns) {efree(str_ns);}
+ if (cptype) {efree(cptype);}
+ }
+
+ trav = element->children;
+ if (trav != NULL && node_is_equal(trav, "annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ if (node_is_equal(trav,"simpleType")) {
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype");
+ } else if (type != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype");
+ }
+ schema_simpleType(sdl, tns, trav, cur_type);
+ trav = trav->next;
+ } else if (node_is_equal(trav,"complexType")) {
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype");
+ } else if (type != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype");
+ }
+ schema_complexType(sdl, tns, trav, cur_type);
+ trav = trav->next;
+ }
+ }
+ while (trav != NULL) {
+ if (node_is_equal(trav,"unique")) {
+ /* TODO: <unique> support */
+ } else if (node_is_equal(trav,"key")) {
+ /* TODO: <key> support */
+ } else if (node_is_equal(trav,"keyref")) {
+ /* TODO: <keyref> support */
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in element", trav->name);
+ }
+ trav = trav->next;
+ }
+
+ return TRUE;
+}
+
+/*
+<attribute
+ default = string
+ fixed = string
+ form = (qualified | unqualified)
+ id = ID
+ name = NCName
+ ref = QName
+ type = QName
+ use = (optional | prohibited | required) : optional
+ {any attributes with non-schema namespace . . .}>
+ Content: (annotation?, (simpleType?))
+</attribute>
+*/
+static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdlTypePtr cur_type, sdlCtx *ctx)
+{
+ sdlAttributePtr newAttr;
+ xmlAttrPtr attr, name, ref = NULL, type = NULL;
+ xmlNodePtr trav;
+
+ name = get_attribute(attrType->properties, "name");
+ if (name == NULL) {
+ name = ref = get_attribute(attrType->properties, "ref");
+ }
+ if (name) {
+ HashTable *addHash;
+ smart_str key = {0};
+
+ newAttr = emalloc(sizeof(sdlAttribute));
+ memset(newAttr, 0, sizeof(sdlAttribute));
+
+ if (ref) {
+ char *attr_name, *ns;
+ xmlNsPtr nsptr;
+
+ parse_namespace(ref->children->content, &attr_name, &ns);
+ nsptr = xmlSearchNs(attrType->doc, attrType, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ smart_str_appends(&key, (char*)nsptr->href);
+ newAttr->namens = estrdup((char*)nsptr->href);
+ }
+ smart_str_appendc(&key, ':');
+ smart_str_appends(&key, attr_name);
+ smart_str_0(&key);
+ newAttr->ref = estrdup(key.c);
+ if (attr_name) {efree(attr_name);}
+ if (ns) {efree(ns);}
+ } else {
+ xmlAttrPtr ns;
+
+ ns = get_attribute(attrType->properties, "targetNamespace");
+ if (ns == NULL) {
+ ns = tns;
+ }
+ if (ns != NULL) {
+ smart_str_appends(&key, (char*)ns->children->content);
+ smart_str_appendc(&key, ':');
+ newAttr->namens = estrdup((char*)ns->children->content);
+ }
+ smart_str_appends(&key, (char*)name->children->content);
+ smart_str_0(&key);
+ }
+
+ if (cur_type == NULL) {
+ addHash = ctx->attributes;
+ } else {
+ if (cur_type->attributes == NULL) {
+ cur_type->attributes = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->attributes, 0, NULL, delete_attribute, 0);
+ }
+ addHash = cur_type->attributes;
+ }
+
+ if (zend_hash_add(addHash, key.c, key.len + 1, &newAttr, sizeof(sdlAttributePtr), NULL) != SUCCESS) {
+ soap_error1(E_ERROR, "Parsing Schema: attribute '%s' already defined", key.c);
+ }
+ smart_str_free(&key);
+ } else{
+ soap_error0(E_ERROR, "Parsing Schema: attribute has no 'name' nor 'ref' attributes");
+ }
+
+ /* type = QName */
+ type = get_attribute(attrType->properties, "type");
+ if (type) {
+ char *cptype, *str_ns;
+ xmlNsPtr nsptr;
+
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: attribute has both 'ref' and 'type' attributes");
+ }
+ parse_namespace(type->children->content, &cptype, &str_ns);
+ nsptr = xmlSearchNs(attrType->doc, attrType, BAD_CAST(str_ns));
+ if (nsptr != NULL) {
+ newAttr->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(cptype));
+ }
+ if (str_ns) {efree(str_ns);}
+ if (cptype) {efree(cptype);}
+ }
+
+ attr = attrType->properties;
+ while (attr != NULL) {
+ if (attr_is_equal_ex(attr, "default", SCHEMA_NAMESPACE)) {
+ newAttr->def = estrdup((char*)attr->children->content);
+ } else if (attr_is_equal_ex(attr, "fixed", SCHEMA_NAMESPACE)) {
+ newAttr->fixed = estrdup((char*)attr->children->content);
+ } else if (attr_is_equal_ex(attr, "form", SCHEMA_NAMESPACE)) {
+ if (strncmp((char*)attr->children->content, "qualified", sizeof("qualified")) == 0) {
+ newAttr->form = XSD_FORM_QUALIFIED;
+ } else if (strncmp((char*)attr->children->content, "unqualified", sizeof("unqualified")) == 0) {
+ newAttr->form = XSD_FORM_UNQUALIFIED;
+ } else {
+ newAttr->form = XSD_FORM_DEFAULT;
+ }
+ } else if (attr_is_equal_ex(attr, "id", SCHEMA_NAMESPACE)) {
+ /* skip */
+ } else if (attr_is_equal_ex(attr, "name", SCHEMA_NAMESPACE)) {
+ newAttr->name = estrdup((char*)attr->children->content);
+ } else if (attr_is_equal_ex(attr, "ref", SCHEMA_NAMESPACE)) {
+ /* already processed */
+ } else if (attr_is_equal_ex(attr, "type", SCHEMA_NAMESPACE)) {
+ /* already processed */
+ } else if (attr_is_equal_ex(attr, "use", SCHEMA_NAMESPACE)) {
+ if (strncmp((char*)attr->children->content, "prohibited", sizeof("prohibited")) == 0) {
+ newAttr->use = XSD_USE_PROHIBITED;
+ } else if (strncmp((char*)attr->children->content, "required", sizeof("required")) == 0) {
+ newAttr->use = XSD_USE_REQUIRED;
+ } else if (strncmp((char*)attr->children->content, "optional", sizeof("optional")) == 0) {
+ newAttr->use = XSD_USE_OPTIONAL;
+ } else {
+ newAttr->use = XSD_USE_DEFAULT;
+ }
+ } else {
+ xmlNsPtr nsPtr = attr_find_ns(attr);
+
+ if (strncmp((char*)nsPtr->href, SCHEMA_NAMESPACE, sizeof(SCHEMA_NAMESPACE))) {
+ smart_str key2 = {0};
+ sdlExtraAttributePtr ext;
+ xmlNsPtr nsptr;
+ char *value, *ns;
+
+ ext = emalloc(sizeof(sdlExtraAttribute));
+ memset(ext, 0, sizeof(sdlExtraAttribute));
+ parse_namespace(attr->children->content, &value, &ns);
+ nsptr = xmlSearchNs(attr->doc, attr->parent, BAD_CAST(ns));
+ if (nsptr) {
+ ext->ns = estrdup((char*)nsptr->href);
+ ext->val = estrdup(value);
+ } else {
+ ext->val = estrdup((char*)attr->children->content);
+ }
+ if (ns) {efree(ns);}
+ efree(value);
+
+ if (!newAttr->extraAttributes) {
+ newAttr->extraAttributes = emalloc(sizeof(HashTable));
+ zend_hash_init(newAttr->extraAttributes, 0, NULL, delete_extra_attribute, 0);
+ }
+
+ smart_str_appends(&key2, (char*)nsPtr->href);
+ smart_str_appendc(&key2, ':');
+ smart_str_appends(&key2, (char*)attr->name);
+ smart_str_0(&key2);
+ zend_hash_add(newAttr->extraAttributes, key2.c, key2.len + 1, &ext, sizeof(sdlExtraAttributePtr), NULL);
+ smart_str_free(&key2);
+ }
+ }
+ attr = attr->next;
+ }
+ if (newAttr->form == XSD_FORM_DEFAULT) {
+ xmlNodePtr parent = attrType->parent;
+ while (parent) {
+ if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) {
+ xmlAttrPtr def;
+ def = get_attribute(parent->properties, "attributeFormDefault");
+ if(def == NULL || strncmp((char*)def->children->content, "qualified", sizeof("qualified"))) {
+ newAttr->form = XSD_FORM_UNQUALIFIED;
+ } else {
+ newAttr->form = XSD_FORM_QUALIFIED;
+ }
+ break;
+ }
+ parent = parent->parent;
+ }
+ if (parent == NULL) {
+ newAttr->form = XSD_FORM_UNQUALIFIED;
+ }
+ }
+ trav = attrType->children;
+ if (trav != NULL && node_is_equal(trav, "annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ if (node_is_equal(trav,"simpleType")) {
+ sdlTypePtr dummy_type;
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: attribute has both 'ref' attribute and subtype");
+ } else if (type != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: attribute has both 'type' attribute and subtype");
+ }
+ dummy_type = emalloc(sizeof(sdlType));
+ memset(dummy_type, 0, sizeof(sdlType));
+ {
+ smart_str anonymous = {0};
+
+ smart_str_appendl(&anonymous, "anonymous", sizeof("anonymous")-1);
+ smart_str_append_long(&anonymous, zend_hash_num_elements(sdl->types));
+ smart_str_0(&anonymous);
+ dummy_type->name = anonymous.c;
+ }
+ dummy_type->namens = estrdup((char*)tns->children->content);
+ schema_simpleType(sdl, tns, trav, dummy_type);
+ newAttr->encode = dummy_type->encode;
+ delete_type(&dummy_type);
+ trav = trav->next;
+ }
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in attribute", trav->name);
+ }
+ return TRUE;
+}
+
+static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGroup, sdlTypePtr cur_type, sdlCtx *ctx)
+{
+ xmlNodePtr trav;
+ xmlAttrPtr name, ref = NULL;
+
+
+ name = get_attribute(attrGroup->properties, "name");
+ if (name == NULL) {
+ name = ref = get_attribute(attrGroup->properties, "ref");
+ }
+ if (name) {
+ if (cur_type == NULL) {
+ xmlAttrPtr ns;
+ sdlTypePtr newType;
+ smart_str key = {0};
+
+ ns = get_attribute(attrGroup->properties, "targetNamespace");
+ if (ns == NULL) {
+ ns = tns;
+ }
+ newType = emalloc(sizeof(sdlType));
+ memset(newType, 0, sizeof(sdlType));
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
+
+ smart_str_appends(&key, newType->namens);
+ smart_str_appendc(&key, ':');
+ smart_str_appends(&key, newType->name);
+ smart_str_0(&key);
+
+ if (zend_hash_add(ctx->attributeGroups, key.c, key.len + 1, &newType, sizeof(sdlTypePtr), NULL) != SUCCESS) {
+ soap_error1(E_ERROR, "Parsing Schema: attributeGroup '%s' already defined", key.c);
+ }
+ cur_type = newType;
+ smart_str_free(&key);
+ } else if (ref) {
+ sdlAttributePtr newAttr;
+ char *group_name, *ns;
+ smart_str key = {0};
+ xmlNsPtr nsptr;
+
+ if (cur_type->attributes == NULL) {
+ cur_type->attributes = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->attributes, 0, NULL, delete_attribute, 0);
+ }
+ newAttr = emalloc(sizeof(sdlAttribute));
+ memset(newAttr, 0, sizeof(sdlAttribute));
+
+ parse_namespace(ref->children->content, &group_name, &ns);
+ nsptr = xmlSearchNs(attrGroup->doc, attrGroup, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ smart_str_appends(&key, (char*)nsptr->href);
+ }
+ smart_str_appendc(&key, ':');
+ smart_str_appends(&key, group_name);
+ smart_str_0(&key);
+ newAttr->ref = estrdup(key.c);
+ if (group_name) {efree(group_name);}
+ if (ns) {efree(ns);}
+ smart_str_free(&key);
+
+ zend_hash_next_index_insert(cur_type->attributes, &newAttr, sizeof(sdlAttributePtr), NULL);
+ cur_type = NULL;
+ }
+ } else{
+ soap_error0(E_ERROR, "Parsing Schema: attributeGroup has no 'name' nor 'ref' attributes");
+ }
+
+ trav = attrGroup->children;
+ if (trav != NULL && node_is_equal(trav, "annotation")) {
+ /* TODO: <annotation> support */
+ trav = trav->next;
+ }
+ while (trav != NULL) {
+ if (node_is_equal(trav,"attribute")) {
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute");
+ }
+ schema_attribute(sdl, tns, trav, cur_type, NULL);
+ } else if (node_is_equal(trav,"attributeGroup")) {
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute");
+ }
+ schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
+ } else if (node_is_equal(trav,"anyAttribute")) {
+ if (ref != NULL) {
+ soap_error0(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute");
+ }
+ /* TODO: <anyAttribute> support */
+ trav = trav->next;
+ break;
+ } else {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name);
+ }
+ trav = trav->next;
+ }
+ if (trav != NULL) {
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name);
+ }
+ return TRUE;
+}
+
+static void copy_extra_attribute(void *attribute)
+{
+ sdlExtraAttributePtr *attr = (sdlExtraAttributePtr*)attribute;
+ sdlExtraAttributePtr new_attr;
+
+ new_attr = emalloc(sizeof(sdlExtraAttribute));
+ memcpy(new_attr, *attr, sizeof(sdlExtraAttribute));
+ *attr = new_attr;
+ if (new_attr->ns) {
+ new_attr->ns = estrdup(new_attr->ns);
+ }
+ if (new_attr->val) {
+ new_attr->val = estrdup(new_attr->val);
+ }
+}
+
+static void schema_attribute_fixup(sdlCtx *ctx, sdlAttributePtr attr)
+{
+ sdlAttributePtr *tmp;
+
+ if (attr->ref != NULL) {
+ if (ctx->attributes != NULL) {
+ if (zend_hash_find(ctx->attributes, attr->ref, strlen(attr->ref)+1, (void**)&tmp) == SUCCESS) {
+ schema_attribute_fixup(ctx, *tmp);
+ if ((*tmp)->name != NULL && attr->name == NULL) {
+ attr->name = estrdup((*tmp)->name);
+ }
+ if ((*tmp)->namens != NULL && attr->namens == NULL) {
+ attr->namens = estrdup((*tmp)->namens);
+ }
+ if ((*tmp)->def != NULL && attr->def == NULL) {
+ attr->def = estrdup((*tmp)->def);
+ }
+ if ((*tmp)->fixed != NULL && attr->fixed == NULL) {
+ attr->fixed = estrdup((*tmp)->fixed);
+ }
+ if (attr->form == XSD_FORM_DEFAULT) {
+ attr->form = (*tmp)->form;
+ }
+ if (attr->use == XSD_USE_DEFAULT) {
+ attr->use = (*tmp)->use;
+ }
+ if ((*tmp)->extraAttributes != NULL) {
+ xmlNodePtr node;
+
+ attr->extraAttributes = emalloc(sizeof(HashTable));
+ zend_hash_init(attr->extraAttributes, zend_hash_num_elements((*tmp)->extraAttributes), NULL, delete_extra_attribute, 0);
+ zend_hash_copy(attr->extraAttributes, (*tmp)->extraAttributes, copy_extra_attribute, &node, sizeof(xmlNodePtr));
+ }
+ attr->encode = (*tmp)->encode;
+ }
+ }
+ if (attr->name == NULL && attr->ref != NULL) {
+ char *name = strrchr(attr->ref, ':');
+ if (name) {
+ attr->name = estrdup(name+1);
+ } else{
+ attr->name = estrdup(attr->ref);
+ }
+ }
+ efree(attr->ref);
+ attr->ref = NULL;
+ }
+}
+
+static void schema_attributegroup_fixup(sdlCtx *ctx, sdlAttributePtr attr, HashTable *ht)
+{
+ sdlTypePtr *tmp;
+ sdlAttributePtr *tmp_attr;
+
+ if (attr->ref != NULL) {
+ if (ctx->attributeGroups != NULL) {
+ if (zend_hash_find(ctx->attributeGroups, attr->ref, strlen(attr->ref)+1, (void**)&tmp) == SUCCESS) {
+ if ((*tmp)->attributes) {
+ zend_hash_internal_pointer_reset((*tmp)->attributes);
+ while (zend_hash_get_current_data((*tmp)->attributes,(void**)&tmp_attr) == SUCCESS) {
+ if (zend_hash_get_current_key_type((*tmp)->attributes) == HASH_KEY_IS_STRING) {
+ char* key;
+ uint key_len;
+ sdlAttributePtr newAttr;
+
+ schema_attribute_fixup(ctx,*tmp_attr);
+
+ newAttr = emalloc(sizeof(sdlAttribute));
+ memcpy(newAttr, *tmp_attr, sizeof(sdlAttribute));
+ if (newAttr->def) {newAttr->def = estrdup(newAttr->def);}
+ if (newAttr->fixed) {newAttr->fixed = estrdup(newAttr->fixed);}
+ if (newAttr->namens) {newAttr->namens = estrdup(newAttr->namens);}
+ if (newAttr->name) {newAttr->name = estrdup(newAttr->name);}
+ if (newAttr->extraAttributes) {
+ xmlNodePtr node;
+ HashTable *ht = emalloc(sizeof(HashTable));
+ zend_hash_init(ht, zend_hash_num_elements(newAttr->extraAttributes), NULL, delete_extra_attribute, 0);
+ zend_hash_copy(ht, newAttr->extraAttributes, copy_extra_attribute, &node, sizeof(xmlNodePtr));
+ newAttr->extraAttributes = ht;
+ }
+
+ zend_hash_get_current_key_ex((*tmp)->attributes, &key, &key_len, NULL, 0, NULL);
+ zend_hash_add(ht, key, key_len, &newAttr, sizeof(sdlAttributePtr), NULL);
+
+ zend_hash_move_forward((*tmp)->attributes);
+ } else {
+ ulong index;
+
+ schema_attributegroup_fixup(ctx,*tmp_attr, ht);
+ zend_hash_get_current_key((*tmp)->attributes, NULL, &index, 0);
+ zend_hash_index_del((*tmp)->attributes, index);
+ }
+ }
+ }
+ }
+ }
+ efree(attr->ref);
+ attr->ref = NULL;
+ }
+}
+
+static void schema_content_model_fixup(sdlCtx *ctx, sdlContentModelPtr model)
+{
+ switch (model->kind) {
+ case XSD_CONTENT_GROUP_REF: {
+ sdlTypePtr *tmp;
+
+ if (ctx->sdl->groups && zend_hash_find(ctx->sdl->groups, model->u.group_ref, strlen(model->u.group_ref)+1, (void**)&tmp) == SUCCESS) {
+ schema_type_fixup(ctx,*tmp);
+ efree(model->u.group_ref);
+ model->kind = XSD_CONTENT_GROUP;
+ model->u.group = (*tmp);
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: unresolved group 'ref' attribute");
+ }
+ break;
+ }
+ case XSD_CONTENT_CHOICE: {
+ if (model->max_occurs != 1) {
+ HashPosition pos;
+ sdlContentModelPtr *tmp;
+
+ zend_hash_internal_pointer_reset_ex(model->u.content, &pos);
+ while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) {
+ (*tmp)->min_occurs = 0;
+ (*tmp)->max_occurs = model->max_occurs;
+ zend_hash_move_forward_ex(model->u.content, &pos);
+ }
+
+ model->kind = XSD_CONTENT_ALL;
+ model->min_occurs = 1;
+ model->max_occurs = 1;
+ }
+ }
+ case XSD_CONTENT_SEQUENCE:
+ case XSD_CONTENT_ALL: {
+ sdlContentModelPtr *tmp;
+
+ zend_hash_internal_pointer_reset(model->u.content);
+ while (zend_hash_get_current_data(model->u.content, (void**)&tmp) == SUCCESS) {
+ schema_content_model_fixup(ctx, *tmp);
+ zend_hash_move_forward(model->u.content);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type)
+{
+ sdlTypePtr *tmp;
+ sdlAttributePtr *attr;
+
+ if (type->ref != NULL) {
+ if (ctx->sdl->elements != NULL) {
+ if (zend_hash_find(ctx->sdl->elements, type->ref, strlen(type->ref)+1, (void**)&tmp) == SUCCESS) {
+ type->kind = (*tmp)->kind;
+ type->encode = (*tmp)->encode;
+ if ((*tmp)->nillable) {
+ type->nillable = 1;
+ }
+ if ((*tmp)->fixed) {
+ type->fixed = estrdup((*tmp)->fixed);
+ }
+ if ((*tmp)->def) {
+ type->def = estrdup((*tmp)->def);
+ }
+ type->form = (*tmp)->form;
+ } else if (strcmp(type->ref, SCHEMA_NAMESPACE ":schema") == 0) {
+ type->encode = get_conversion(XSD_ANYXML);
+ } else {
+ soap_error0(E_ERROR, "Parsing Schema: unresolved element 'ref' attribute");
+ }
+ }
+ efree(type->ref);
+ type->ref = NULL;
+ }
+ if (type->elements) {
+ zend_hash_internal_pointer_reset(type->elements);
+ while (zend_hash_get_current_data(type->elements,(void**)&tmp) == SUCCESS) {
+ schema_type_fixup(ctx,*tmp);
+ zend_hash_move_forward(type->elements);
+ }
+ }
+ if (type->model) {
+ schema_content_model_fixup(ctx, type->model);
+ }
+ if (type->attributes) {
+ zend_hash_internal_pointer_reset(type->attributes);
+ while (zend_hash_get_current_data(type->attributes,(void**)&attr) == SUCCESS) {
+ if (zend_hash_get_current_key_type(type->attributes) == HASH_KEY_IS_STRING) {
+ schema_attribute_fixup(ctx,*attr);
+ zend_hash_move_forward(type->attributes);
+ } else {
+ ulong index;
+
+ schema_attributegroup_fixup(ctx,*attr,type->attributes);
+ zend_hash_get_current_key(type->attributes, NULL, &index, 0);
+ zend_hash_index_del(type->attributes, index);
+ }
+ }
+ }
+}
+
+void schema_pass2(sdlCtx *ctx)
+{
+ sdlPtr sdl = ctx->sdl;
+ sdlAttributePtr *attr;
+ sdlTypePtr *type;
+
+ if (ctx->attributes) {
+ zend_hash_internal_pointer_reset(ctx->attributes);
+ while (zend_hash_get_current_data(ctx->attributes,(void**)&attr) == SUCCESS) {
+ schema_attribute_fixup(ctx,*attr);
+ zend_hash_move_forward(ctx->attributes);
+ }
+ }
+ if (ctx->attributeGroups) {
+ zend_hash_internal_pointer_reset(ctx->attributeGroups);
+ while (zend_hash_get_current_data(ctx->attributeGroups,(void**)&type) == SUCCESS) {
+ schema_type_fixup(ctx,*type);
+ zend_hash_move_forward(ctx->attributeGroups);
+ }
+ }
+ if (sdl->elements) {
+ zend_hash_internal_pointer_reset(sdl->elements);
+ while (zend_hash_get_current_data(sdl->elements,(void**)&type) == SUCCESS) {
+ schema_type_fixup(ctx,*type);
+ zend_hash_move_forward(sdl->elements);
+ }
+ }
+ if (sdl->groups) {
+ zend_hash_internal_pointer_reset(sdl->groups);
+ while (zend_hash_get_current_data(sdl->groups,(void**)&type) == SUCCESS) {
+ schema_type_fixup(ctx,*type);
+ zend_hash_move_forward(sdl->groups);
+ }
+ }
+ if (sdl->types) {
+ zend_hash_internal_pointer_reset(sdl->types);
+ while (zend_hash_get_current_data(sdl->types,(void**)&type) == SUCCESS) {
+ schema_type_fixup(ctx,*type);
+ zend_hash_move_forward(sdl->types);
+ }
+ }
+ if (ctx->attributes) {
+ zend_hash_destroy(ctx->attributes);
+ efree(ctx->attributes);
+ }
+ if (ctx->attributeGroups) {
+ zend_hash_destroy(ctx->attributeGroups);
+ efree(ctx->attributeGroups);
+ }
+}
+
+void delete_model(void *handle)
+{
+ sdlContentModelPtr tmp = *((sdlContentModelPtr*)handle);
+ switch (tmp->kind) {
+ case XSD_CONTENT_ELEMENT:
+ case XSD_CONTENT_GROUP:
+ break;
+ case XSD_CONTENT_SEQUENCE:
+ case XSD_CONTENT_ALL:
+ case XSD_CONTENT_CHOICE:
+ zend_hash_destroy(tmp->u.content);
+ efree(tmp->u.content);
+ break;
+ case XSD_CONTENT_GROUP_REF:
+ efree(tmp->u.group_ref);
+ break;
+ default:
+ break;
+ }
+ efree(tmp);
+}
+
+void delete_model_persistent(void *handle)
+{
+ sdlContentModelPtr tmp = *((sdlContentModelPtr*)handle);
+ switch (tmp->kind) {
+ case XSD_CONTENT_ELEMENT:
+ case XSD_CONTENT_GROUP:
+ break;
+ case XSD_CONTENT_SEQUENCE:
+ case XSD_CONTENT_ALL:
+ case XSD_CONTENT_CHOICE:
+ zend_hash_destroy(tmp->u.content);
+ free(tmp->u.content);
+ break;
+ case XSD_CONTENT_GROUP_REF:
+ free(tmp->u.group_ref);
+ break;
+ default:
+ break;
+ }
+ free(tmp);
+}
+
+void delete_type(void *data)
+{
+ sdlTypePtr type = *((sdlTypePtr*)data);
+
+ if (type->name) {
+ efree(type->name);
+ }
+ if (type->namens) {
+ efree(type->namens);
+ }
+ if (type->def) {
+ efree(type->def);
+ }
+ if (type->fixed) {
+ efree(type->fixed);
+ }
+ if (type->elements) {
+ zend_hash_destroy(type->elements);
+ efree(type->elements);
+ }
+ if (type->attributes) {
+ zend_hash_destroy(type->attributes);
+ efree(type->attributes);
+ }
+ if (type->model) {
+ delete_model((void**)&type->model);
+ }
+ if (type->restrictions) {
+ delete_restriction_var_int(&type->restrictions->minExclusive);
+ delete_restriction_var_int(&type->restrictions->minInclusive);
+ delete_restriction_var_int(&type->restrictions->maxExclusive);
+ delete_restriction_var_int(&type->restrictions->maxInclusive);
+ delete_restriction_var_int(&type->restrictions->totalDigits);
+ delete_restriction_var_int(&type->restrictions->fractionDigits);
+ delete_restriction_var_int(&type->restrictions->length);
+ delete_restriction_var_int(&type->restrictions->minLength);
+ delete_restriction_var_int(&type->restrictions->maxLength);
+ delete_restriction_var_char(&type->restrictions->whiteSpace);
+ delete_restriction_var_char(&type->restrictions->pattern);
+ if (type->restrictions->enumeration) {
+ zend_hash_destroy(type->restrictions->enumeration);
+ efree(type->restrictions->enumeration);
+ }
+ efree(type->restrictions);
+ }
+ efree(type);
+}
+
+void delete_type_persistent(void *data)
+{
+ sdlTypePtr type = *((sdlTypePtr*)data);
+ if (type->name) {
+ free(type->name);
+ }
+ if (type->namens) {
+ free(type->namens);
+ }
+ if (type->def) {
+ free(type->def);
+ }
+ if (type->fixed) {
+ free(type->fixed);
+ }
+ if (type->elements) {
+ zend_hash_destroy(type->elements);
+ free(type->elements);
+ }
+ if (type->attributes) {
+ zend_hash_destroy(type->attributes);
+ free(type->attributes);
+ }
+ if (type->model) {
+ delete_model_persistent((void**)&type->model);
+ }
+ if (type->restrictions) {
+ delete_restriction_var_int_persistent(&type->restrictions->minExclusive);
+ delete_restriction_var_int_persistent(&type->restrictions->minInclusive);
+ delete_restriction_var_int_persistent(&type->restrictions->maxExclusive);
+ delete_restriction_var_int_persistent(&type->restrictions->maxInclusive);
+ delete_restriction_var_int_persistent(&type->restrictions->totalDigits);
+ delete_restriction_var_int_persistent(&type->restrictions->fractionDigits);
+ delete_restriction_var_int_persistent(&type->restrictions->length);
+ delete_restriction_var_int_persistent(&type->restrictions->minLength);
+ delete_restriction_var_int_persistent(&type->restrictions->maxLength);
+ delete_restriction_var_char_persistent(&type->restrictions->whiteSpace);
+ delete_restriction_var_char_persistent(&type->restrictions->pattern);
+ if (type->restrictions->enumeration) {
+ zend_hash_destroy(type->restrictions->enumeration);
+ free(type->restrictions->enumeration);
+ }
+ free(type->restrictions);
+ }
+ free(type);
+}
+
+void delete_extra_attribute(void *attribute)
+{
+ sdlExtraAttributePtr attr = *((sdlExtraAttributePtr*)attribute);
+
+ if (attr->ns) {
+ efree(attr->ns);
+ }
+ if (attr->val) {
+ efree(attr->val);
+ }
+ efree(attr);
+}
+
+void delete_extra_attribute_persistent(void *attribute)
+{
+ sdlExtraAttributePtr attr = *((sdlExtraAttributePtr*)attribute);
+
+ if (attr->ns) {
+ free(attr->ns);
+ }
+ if (attr->val) {
+ free(attr->val);
+ }
+ free(attr);
+}
+
+void delete_attribute(void *attribute)
+{
+ sdlAttributePtr attr = *((sdlAttributePtr*)attribute);
+
+ if (attr->def) {
+ efree(attr->def);
+ }
+ if (attr->fixed) {
+ efree(attr->fixed);
+ }
+ if (attr->name) {
+ efree(attr->name);
+ }
+ if (attr->namens) {
+ efree(attr->namens);
+ }
+ if (attr->ref) {
+ efree(attr->ref);
+ }
+ if (attr->extraAttributes) {
+ zend_hash_destroy(attr->extraAttributes);
+ efree(attr->extraAttributes);
+ }
+ efree(attr);
+}
+
+void delete_attribute_persistent(void *attribute)
+{
+ sdlAttributePtr attr = *((sdlAttributePtr*)attribute);
+
+ if (attr->def) {
+ free(attr->def);
+ }
+ if (attr->fixed) {
+ free(attr->fixed);
+ }
+ if (attr->name) {
+ free(attr->name);
+ }
+ if (attr->namens) {
+ free(attr->namens);
+ }
+ if (attr->ref) {
+ free(attr->ref);
+ }
+ if (attr->extraAttributes) {
+ zend_hash_destroy(attr->extraAttributes);
+ free(attr->extraAttributes);
+ }
+ free(attr);
+}
+
+void delete_restriction_var_int(void *rvi)
+{
+ sdlRestrictionIntPtr ptr = *((sdlRestrictionIntPtr*)rvi);
+ if (ptr) {
+ efree(ptr);
+ }
+}
+
+void delete_restriction_var_int_persistent(void *rvi)
+{
+ sdlRestrictionIntPtr ptr = *((sdlRestrictionIntPtr*)rvi);
+ if (ptr) {
+ free(ptr);
+ }
+}
+
+void delete_restriction_var_char(void *srvc)
+{
+ sdlRestrictionCharPtr ptr = *((sdlRestrictionCharPtr*)srvc);
+ if (ptr) {
+ if (ptr->value) {
+ efree(ptr->value);
+ }
+ efree(ptr);
+ }
+}
+
+void delete_restriction_var_char_persistent(void *srvc)
+{
+ sdlRestrictionCharPtr ptr = *((sdlRestrictionCharPtr*)srvc);
+ if (ptr) {
+ if (ptr->value) {
+ free(ptr->value);
+ }
+ free(ptr);
+ }
+}
diff --git a/ext/soap/php_schema.h b/ext/soap/php_schema.h
new file mode 100644
index 0000000..81748f5
--- /dev/null
+++ b/ext/soap/php_schema.h
@@ -0,0 +1,40 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#ifndef PHP_SCHEMA_H
+#define PHP_SCHEMA_H
+
+int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC);
+void schema_pass2(sdlCtx *ctx);
+
+void delete_model(void *handle);
+void delete_model_persistent(void *handle);
+void delete_type(void *data);
+void delete_type_persistent(void *data);
+void delete_extra_attribute(void *attribute);
+void delete_extra_attribute_persistent(void *attribute);
+void delete_attribute(void *attribute);
+void delete_attribute_persistent(void *attribute);
+void delete_restriction_var_int(void *rvi);
+void delete_restriction_var_int_persistent(void *rvi);
+void delete_restriction_var_char(void *srvc);
+void delete_restriction_var_char_persistent(void *srvc);
+#endif
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
new file mode 100644
index 0000000..33e137c
--- /dev/null
+++ b/ext/soap/php_sdl.c
@@ -0,0 +1,3705 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#include "php_soap.h"
+#include "ext/libxml/php_libxml.h"
+#include "libxml/uri.h"
+
+#include "ext/standard/md5.h"
+#include "tsrm_virtual_cwd.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
+static void delete_fault(void *fault);
+static void delete_fault_persistent(void *fault);
+static void delete_binding(void *binding);
+static void delete_binding_persistent(void *binding);
+static void delete_function(void *function);
+static void delete_function_persistent(void *function);
+static void delete_parameter(void *paramater);
+static void delete_parameter_persistent(void *paramater);
+static void delete_header(void *header);
+static void delete_header_persistent(void *header);
+static void delete_document(void *doc_ptr);
+
+encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr node, const xmlChar *type)
+{
+ encodePtr enc = NULL;
+ xmlNsPtr nsptr;
+ char *ns, *cptype;
+
+ parse_namespace(type, &cptype, &ns);
+ nsptr = xmlSearchNs(node->doc, node, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ enc = get_encoder(sdl, (char*)nsptr->href, cptype);
+ if (enc == NULL) {
+ enc = get_encoder_ex(sdl, cptype, strlen(cptype));
+ }
+ } else {
+ enc = get_encoder_ex(sdl, (char*)type, xmlStrlen(type));
+ }
+ efree(cptype);
+ if (ns) {efree(ns);}
+ return enc;
+}
+
+static sdlTypePtr get_element(sdlPtr sdl, xmlNodePtr node, const xmlChar *type)
+{
+ sdlTypePtr ret = NULL;
+
+ if (sdl->elements) {
+ xmlNsPtr nsptr;
+ char *ns, *cptype;
+ sdlTypePtr *sdl_type;
+
+ parse_namespace(type, &cptype, &ns);
+ nsptr = xmlSearchNs(node->doc, node, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ int ns_len = xmlStrlen(nsptr->href);
+ int type_len = strlen(cptype);
+ int len = ns_len + type_len + 1;
+ char *nscat = emalloc(len + 1);
+
+ memcpy(nscat, nsptr->href, ns_len);
+ nscat[ns_len] = ':';
+ memcpy(nscat+ns_len+1, cptype, type_len);
+ nscat[len] = '\0';
+
+ if (zend_hash_find(sdl->elements, nscat, len + 1, (void **)&sdl_type) == SUCCESS) {
+ ret = *sdl_type;
+ } else if (zend_hash_find(sdl->elements, (char*)type, type_len + 1, (void **)&sdl_type) == SUCCESS) {
+ ret = *sdl_type;
+ }
+ efree(nscat);
+ } else {
+ if (zend_hash_find(sdl->elements, (char*)type, xmlStrlen(type) + 1, (void **)&sdl_type) == SUCCESS) {
+ ret = *sdl_type;
+ }
+ }
+
+ efree(cptype);
+ if (ns) {efree(ns);}
+ }
+ return ret;
+}
+
+encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type)
+{
+ encodePtr enc = NULL;
+ char *nscat;
+ int ns_len = strlen(ns);
+ int type_len = strlen(type);
+ int len = ns_len + type_len + 1;
+
+ nscat = emalloc(len + 1);
+ memcpy(nscat, ns, ns_len);
+ nscat[ns_len] = ':';
+ memcpy(nscat+ns_len+1, type, type_len);
+ nscat[len] = '\0';
+
+ enc = get_encoder_ex(sdl, nscat, len);
+
+ if (enc == NULL &&
+ ((ns_len == sizeof(SOAP_1_1_ENC_NAMESPACE)-1 &&
+ memcmp(ns, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE)-1) == 0) ||
+ (ns_len == sizeof(SOAP_1_2_ENC_NAMESPACE)-1 &&
+ memcmp(ns, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)-1) == 0))) {
+ char *enc_nscat;
+ int enc_ns_len;
+ int enc_len;
+
+ enc_ns_len = sizeof(XSD_NAMESPACE)-1;
+ enc_len = enc_ns_len + type_len + 1;
+ enc_nscat = emalloc(enc_len + 1);
+ memcpy(enc_nscat, XSD_NAMESPACE, sizeof(XSD_NAMESPACE)-1);
+ enc_nscat[enc_ns_len] = ':';
+ memcpy(enc_nscat+enc_ns_len+1, type, type_len);
+ enc_nscat[enc_len] = '\0';
+
+ enc = get_encoder_ex(NULL, enc_nscat, enc_len);
+ efree(enc_nscat);
+ if (enc && sdl) {
+ encodePtr new_enc = pemalloc(sizeof(encode), sdl->is_persistent);
+ memcpy(new_enc, enc, sizeof(encode));
+ if (sdl->is_persistent) {
+ new_enc->details.ns = zend_strndup(ns, ns_len);
+ new_enc->details.type_str = strdup(new_enc->details.type_str);
+ } else {
+ new_enc->details.ns = estrndup(ns, ns_len);
+ new_enc->details.type_str = estrdup(new_enc->details.type_str);
+ }
+ if (sdl->encoders == NULL) {
+ sdl->encoders = pemalloc(sizeof(HashTable), sdl->is_persistent);
+ zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, sdl->is_persistent);
+ }
+ zend_hash_update(sdl->encoders, nscat, len + 1, &new_enc, sizeof(encodePtr), NULL);
+ enc = new_enc;
+ }
+ }
+ efree(nscat);
+ return enc;
+}
+
+encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len)
+{
+ encodePtr *enc;
+ TSRMLS_FETCH();
+
+ if (zend_hash_find(&SOAP_GLOBAL(defEnc), (char*)nscat, len + 1, (void **)&enc) == SUCCESS) {
+ return (*enc);
+ } else if (sdl && sdl->encoders && zend_hash_find(sdl->encoders, (char*)nscat, len + 1, (void **)&enc) == SUCCESS) {
+ return (*enc);
+ }
+ return NULL;
+}
+
+sdlBindingPtr get_binding_from_type(sdlPtr sdl, int type)
+{
+ sdlBindingPtr *binding;
+
+ if (sdl == NULL) {
+ return NULL;
+ }
+
+ for (zend_hash_internal_pointer_reset(sdl->bindings);
+ zend_hash_get_current_data(sdl->bindings, (void **) &binding) == SUCCESS;
+ zend_hash_move_forward(sdl->bindings)) {
+ if ((*binding)->bindingType == type) {
+ return *binding;
+ }
+ }
+ return NULL;
+}
+
+sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns)
+{
+ sdlBindingPtr binding = NULL;
+ smart_str key = {0};
+
+ smart_str_appends(&key, ns);
+ smart_str_appendc(&key, ':');
+ smart_str_appends(&key, name);
+ smart_str_0(&key);
+
+ zend_hash_find(sdl->bindings, key.c, key.len, (void **)&binding);
+
+ smart_str_free(&key);
+ return binding;
+}
+
+static int is_wsdl_element(xmlNodePtr node)
+{
+ if (node->ns && strcmp((char*)node->ns->href, WSDL_NAMESPACE) != 0) {
+ xmlAttrPtr attr;
+ if ((attr = get_attribute_ex(node->properties, "required", WSDL_NAMESPACE)) != NULL &&
+ attr->children && attr->children->content &&
+ (strcmp((char*)attr->children->content, "1") == 0 ||
+ strcmp((char*)attr->children->content, "true") == 0)) {
+ soap_error1(E_ERROR, "Parsing WSDL: Unknown required WSDL extension '%s'", node->ns->href);
+ }
+ return 0;
+ }
+ return 1;
+}
+
+void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC)
+{
+ char *s;
+ int l1, l2;
+ zval *context = NULL;
+ zval **header = NULL;
+
+ /* check if we load xsd from the same server */
+ s = strstr(ctx->sdl->source, "://");
+ if (!s) return;
+ s = strchr(s+3, '/');
+ l1 = s ? (s - ctx->sdl->source) : strlen(ctx->sdl->source);
+ s = strstr((char*)uri, "://");
+ if (!s) return;
+ s = strchr(s+3, '/');
+ l2 = s ? (s - (char*)uri) : strlen((char*)uri);
+ if (l1 != l2) {
+ /* check for http://...:80/ */
+ if (l1 > 11 &&
+ ctx->sdl->source[4] == ':' &&
+ ctx->sdl->source[l1-3] == ':' &&
+ ctx->sdl->source[l1-2] == '8' &&
+ ctx->sdl->source[l1-1] == '0') {
+ l1 -= 3;
+ }
+ if (l2 > 11 &&
+ uri[4] == ':' &&
+ uri[l2-3] == ':' &&
+ uri[l2-2] == '8' &&
+ uri[l2-1] == '0') {
+ l2 -= 3;
+ }
+ /* check for https://...:443/ */
+ if (l1 > 13 &&
+ ctx->sdl->source[4] == 's' &&
+ ctx->sdl->source[l1-4] == ':' &&
+ ctx->sdl->source[l1-3] == '4' &&
+ ctx->sdl->source[l1-2] == '4' &&
+ ctx->sdl->source[l1-1] == '3') {
+ l1 -= 4;
+ }
+ if (l2 > 13 &&
+ uri[4] == 's' &&
+ uri[l2-4] == ':' &&
+ uri[l2-3] == '4' &&
+ uri[l2-2] == '4' &&
+ uri[l2-1] == '3') {
+ l2 -= 4;
+ }
+ }
+ if (l1 != l2 || memcmp(ctx->sdl->source, uri, l1) != 0) {
+ /* another server. clear authentication credentals */
+ context = php_libxml_switch_context(NULL TSRMLS_CC);
+ php_libxml_switch_context(context TSRMLS_CC);
+ if (context) {
+ ctx->context = php_stream_context_from_zval(context, 1);
+
+ if (ctx->context &&
+ php_stream_context_get_option(ctx->context, "http", "header", &header) == SUCCESS) {
+ s = strstr(Z_STRVAL_PP(header), "Authorization: Basic");
+ if (s && (s == Z_STRVAL_PP(header) || *(s-1) == '\n' || *(s-1) == '\r')) {
+ char *rest = strstr(s, "\r\n");
+ if (rest) {
+ zval new_header;
+
+ rest += 2;
+ Z_TYPE(new_header) = IS_STRING;
+ Z_STRLEN(new_header) = Z_STRLEN_PP(header) - (rest - s);
+ Z_STRVAL(new_header) = emalloc(Z_STRLEN_PP(header) + 1);
+ memcpy(Z_STRVAL(new_header), Z_STRVAL_PP(header), s - Z_STRVAL_PP(header));
+ memcpy(Z_STRVAL(new_header) + (s - Z_STRVAL_PP(header)), rest, Z_STRLEN_PP(header) - (rest - Z_STRVAL_PP(header)) + 1);
+ ctx->old_header = *header;
+ Z_ADDREF_P(ctx->old_header);
+ php_stream_context_set_option(ctx->context, "http", "header", &new_header);
+ zval_dtor(&new_header);
+ }
+ }
+ }
+ }
+ }
+}
+
+void sdl_restore_uri_credentials(sdlCtx *ctx TSRMLS_DC)
+{
+ if (ctx->old_header) {
+ php_stream_context_set_option(ctx->context, "http", "header", ctx->old_header);
+ zval_ptr_dtor(&ctx->old_header);
+ ctx->old_header = NULL;
+ }
+ ctx->context = NULL;
+}
+
+static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include TSRMLS_DC)
+{
+ sdlPtr tmpsdl = ctx->sdl;
+ xmlDocPtr wsdl;
+ xmlNodePtr root, definitions, trav;
+ xmlAttrPtr targetNamespace;
+
+ if (zend_hash_exists(&ctx->docs, struri, strlen(struri)+1)) {
+ return;
+ }
+
+ sdl_set_uri_credentials(ctx, struri TSRMLS_CC);
+ wsdl = soap_xmlParseFile(struri TSRMLS_CC);
+ sdl_restore_uri_credentials(ctx TSRMLS_CC);
+
+ if (!wsdl) {
+ xmlErrorPtr xmlErrorPtr = xmlGetLastError();
+
+ if (xmlErrorPtr) {
+ soap_error2(E_ERROR, "Parsing WSDL: Couldn't load from '%s' : %s", struri, xmlErrorPtr->message);
+ } else {
+ soap_error1(E_ERROR, "Parsing WSDL: Couldn't load from '%s'", struri);
+ }
+ }
+
+ zend_hash_add(&ctx->docs, struri, strlen(struri)+1, (void**)&wsdl, sizeof(xmlDocPtr), NULL);
+
+ root = wsdl->children;
+ definitions = get_node_ex(root, "definitions", WSDL_NAMESPACE);
+ if (!definitions) {
+ if (include) {
+ xmlNodePtr schema = get_node_ex(root, "schema", XSD_NAMESPACE);
+ if (schema) {
+ load_schema(ctx, schema TSRMLS_CC);
+ return;
+ }
+ }
+ soap_error1(E_ERROR, "Parsing WSDL: Couldn't find <definitions> in '%s'", struri);
+ }
+
+ if (!include) {
+ targetNamespace = get_attribute(definitions->properties, "targetNamespace");
+ if (targetNamespace) {
+ tmpsdl->target_ns = estrdup((char*)targetNamespace->children->content);
+ }
+ }
+
+ trav = definitions->children;
+ while (trav != NULL) {
+ if (!is_wsdl_element(trav)) {
+ trav = trav->next;
+ continue;
+ }
+ if (node_is_equal(trav,"types")) {
+ /* TODO: Only one "types" is allowed */
+ xmlNodePtr trav2 = trav->children;
+
+ while (trav2 != NULL) {
+ if (node_is_equal_ex(trav2, "schema", XSD_NAMESPACE)) {
+ load_schema(ctx, trav2 TSRMLS_CC);
+ } else if (is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) {
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav2->name);
+ }
+ trav2 = trav2->next;
+ }
+ } else if (node_is_equal(trav,"import")) {
+ /* TODO: namespace ??? */
+ xmlAttrPtr tmp = get_attribute(trav->properties, "location");
+ if (tmp) {
+ xmlChar *uri;
+ xmlChar *base = xmlNodeGetBase(trav->doc, trav);
+
+ if (base == NULL) {
+ uri = xmlBuildURI(tmp->children->content, trav->doc->URL);
+ } else {
+ uri = xmlBuildURI(tmp->children->content, base);
+ xmlFree(base);
+ }
+ load_wsdl_ex(this_ptr, (char*)uri, ctx, 1 TSRMLS_CC);
+ xmlFree(uri);
+ }
+
+ } else if (node_is_equal(trav,"message")) {
+ xmlAttrPtr name = get_attribute(trav->properties, "name");
+ if (name && name->children && name->children->content) {
+ if (zend_hash_add(&ctx->messages, (char*)name->children->content, xmlStrlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
+ soap_error1(E_ERROR, "Parsing WSDL: <message> '%s' already defined", name->children->content);
+ }
+ } else {
+ soap_error0(E_ERROR, "Parsing WSDL: <message> has no name attribute");
+ }
+
+ } else if (node_is_equal(trav,"portType")) {
+ xmlAttrPtr name = get_attribute(trav->properties, "name");
+ if (name && name->children && name->children->content) {
+ if (zend_hash_add(&ctx->portTypes, (char*)name->children->content, xmlStrlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
+ soap_error1(E_ERROR, "Parsing WSDL: <portType> '%s' already defined", name->children->content);
+ }
+ } else {
+ soap_error0(E_ERROR, "Parsing WSDL: <portType> has no name attribute");
+ }
+
+ } else if (node_is_equal(trav,"binding")) {
+ xmlAttrPtr name = get_attribute(trav->properties, "name");
+ if (name && name->children && name->children->content) {
+ if (zend_hash_add(&ctx->bindings, (char*)name->children->content, xmlStrlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
+ soap_error1(E_ERROR, "Parsing WSDL: <binding> '%s' already defined", name->children->content);
+ }
+ } else {
+ soap_error0(E_ERROR, "Parsing WSDL: <binding> has no name attribute");
+ }
+
+ } else if (node_is_equal(trav,"service")) {
+ xmlAttrPtr name = get_attribute(trav->properties, "name");
+ if (name && name->children && name->children->content) {
+ if (zend_hash_add(&ctx->services, (char*)name->children->content, xmlStrlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
+ soap_error1(E_ERROR, "Parsing WSDL: <service> '%s' already defined", name->children->content);
+ }
+ } else {
+ soap_error0(E_ERROR, "Parsing WSDL: <service> has no name attribute");
+ }
+ } else if (!node_is_equal(trav,"documentation")) {
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name);
+ }
+ trav = trav->next;
+ }
+}
+
+static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xmlNodePtr header, char* wsdl_soap_namespace, int fault)
+{
+ xmlAttrPtr tmp;
+ xmlNodePtr *message, part;
+ char *ctype;
+ sdlSoapBindingFunctionHeaderPtr h;
+
+ tmp = get_attribute(header->properties, "message");
+ if (!tmp) {
+ soap_error0(E_ERROR, "Parsing WSDL: Missing message attribute for <header>");
+ }
+
+ ctype = strrchr((char*)tmp->children->content,':');
+ if (ctype == NULL) {
+ ctype = (char*)tmp->children->content;
+ } else {
+ ++ctype;
+ }
+ if (zend_hash_find(&ctx->messages, ctype, strlen(ctype)+1, (void**)&message) != SUCCESS) {
+ soap_error1(E_ERROR, "Parsing WSDL: Missing <message> with name '%s'", tmp->children->content);
+ }
+
+ tmp = get_attribute(header->properties, "part");
+ if (!tmp) {
+ soap_error0(E_ERROR, "Parsing WSDL: Missing part attribute for <header>");
+ }
+ part = get_node_with_attribute_ex((*message)->children, "part", WSDL_NAMESPACE, "name", (char*)tmp->children->content, NULL);
+ if (!part) {
+ soap_error1(E_ERROR, "Parsing WSDL: Missing part '%s' in <message>", tmp->children->content);
+ }
+
+ h = emalloc(sizeof(sdlSoapBindingFunctionHeader));
+ memset(h, 0, sizeof(sdlSoapBindingFunctionHeader));
+ h->name = estrdup((char*)tmp->children->content);
+
+ tmp = get_attribute(header->properties, "use");
+ if (tmp && !strncmp((char*)tmp->children->content, "encoded", sizeof("encoded"))) {
+ h->use = SOAP_ENCODED;
+ } else {
+ h->use = SOAP_LITERAL;
+ }
+
+ tmp = get_attribute(header->properties, "namespace");
+ if (tmp) {
+ h->ns = estrdup((char*)tmp->children->content);
+ }
+
+ if (h->use == SOAP_ENCODED) {
+ tmp = get_attribute(header->properties, "encodingStyle");
+ if (tmp) {
+ if (strncmp((char*)tmp->children->content, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE)) == 0) {
+ h->encodingStyle = SOAP_ENCODING_1_1;
+ } else if (strncmp((char*)tmp->children->content, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) {
+ h->encodingStyle = SOAP_ENCODING_1_2;
+ } else {
+ soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content);
+ }
+ } else {
+ soap_error0(E_ERROR, "Parsing WSDL: Unspecified encodingStyle");
+ }
+ }
+
+ tmp = get_attribute(part->properties, "type");
+ if (tmp != NULL) {
+ h->encode = get_encoder_from_prefix(ctx->sdl, part, tmp->children->content);
+ } else {
+ tmp = get_attribute(part->properties, "element");
+ if (tmp != NULL) {
+ h->element = get_element(ctx->sdl, part, tmp->children->content);
+ if (h->element) {
+ h->encode = h->element->encode;
+ if (!h->ns && h->element->namens) {
+ h->ns = estrdup(h->element->namens);
+ }
+ if (h->element->name) {
+ efree(h->name);
+ h->name = estrdup(h->element->name);
+ }
+ }
+ }
+ }
+ if (!fault) {
+ xmlNodePtr trav = header->children;
+ while (trav != NULL) {
+ if (node_is_equal_ex(trav, "headerfault", wsdl_soap_namespace)) {
+ sdlSoapBindingFunctionHeaderPtr hf = wsdl_soap_binding_header(ctx, trav, wsdl_soap_namespace, 1);
+ smart_str key = {0};
+
+ if (h->headerfaults == NULL) {
+ h->headerfaults = emalloc(sizeof(HashTable));
+ zend_hash_init(h->headerfaults, 0, NULL, delete_header, 0);
+ }
+
+ if (hf->ns) {
+ smart_str_appends(&key,hf->ns);
+ smart_str_appendc(&key,':');
+ }
+ smart_str_appends(&key,hf->name);
+ smart_str_0(&key);
+ if (zend_hash_add(h->headerfaults, key.c, key.len+1, (void**)&hf, sizeof(sdlSoapBindingFunctionHeaderPtr), NULL) != SUCCESS) {
+ delete_header((void**)&hf);
+ }
+ smart_str_free(&key);
+ } else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) {
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name);
+ }
+ trav = trav->next;
+ }
+ }
+ return h;
+}
+
+static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap_namespace, sdlSoapBindingFunctionBody *binding, HashTable* params)
+{
+ xmlNodePtr body, trav;
+ xmlAttrPtr tmp;
+
+ trav = node->children;
+ while (trav != NULL) {
+ if (node_is_equal_ex(trav, "body", wsdl_soap_namespace)) {
+ body = trav;
+
+ tmp = get_attribute(body->properties, "use");
+ if (tmp && !strncmp((char*)tmp->children->content, "literal", sizeof("literal"))) {
+ binding->use = SOAP_LITERAL;
+ } else {
+ binding->use = SOAP_ENCODED;
+ }
+
+ tmp = get_attribute(body->properties, "namespace");
+ if (tmp) {
+ binding->ns = estrdup((char*)tmp->children->content);
+ }
+
+ tmp = get_attribute(body->properties, "parts");
+ if (tmp) {
+ HashTable ht;
+ char *parts = (char*)tmp->children->content;
+
+ /* Delete all parts those are not in the "parts" attribute */
+ zend_hash_init(&ht, 0, NULL, delete_parameter, 0);
+ while (*parts) {
+ HashPosition pos;
+ sdlParamPtr *param;
+ int found = 0;
+ char *end;
+
+ while (*parts == ' ') ++parts;
+ if (*parts == '\0') break;
+ end = strchr(parts, ' ');
+ if (end) *end = '\0';
+ zend_hash_internal_pointer_reset_ex(params, &pos);
+ while (zend_hash_get_current_data_ex(params, (void **)&param, &pos) != FAILURE) {
+ if ((*param)->paramName &&
+ strcmp(parts, (*param)->paramName) == 0) {
+ sdlParamPtr x_param;
+ x_param = emalloc(sizeof(sdlParam));
+ *x_param = **param;
+ (*param)->paramName = NULL;
+ zend_hash_next_index_insert(&ht, &x_param, sizeof(sdlParamPtr), NULL);
+ found = 1;
+ break;
+ }
+ zend_hash_move_forward_ex(params, &pos);
+ }
+ if (!found) {
+ soap_error1(E_ERROR, "Parsing WSDL: Missing part '%s' in <message>", parts);
+ }
+ parts += strlen(parts);
+ if (end) *end = ' ';
+ }
+ zend_hash_destroy(params);
+ *params = ht;
+ }
+
+ if (binding->use == SOAP_ENCODED) {
+ tmp = get_attribute(body->properties, "encodingStyle");
+ if (tmp) {
+ if (strncmp((char*)tmp->children->content, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE)) == 0) {
+ binding->encodingStyle = SOAP_ENCODING_1_1;
+ } else if (strncmp((char*)tmp->children->content, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) {
+ binding->encodingStyle = SOAP_ENCODING_1_2;
+ } else {
+ soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content);
+ }
+ } else {
+ soap_error0(E_ERROR, "Parsing WSDL: Unspecified encodingStyle");
+ }
+ }
+ } else if (node_is_equal_ex(trav, "header", wsdl_soap_namespace)) {
+ sdlSoapBindingFunctionHeaderPtr h = wsdl_soap_binding_header(ctx, trav, wsdl_soap_namespace, 0);
+ smart_str key = {0};
+
+ if (binding->headers == NULL) {
+ binding->headers = emalloc(sizeof(HashTable));
+ zend_hash_init(binding->headers, 0, NULL, delete_header, 0);
+ }
+
+ if (h->ns) {
+ smart_str_appends(&key,h->ns);
+ smart_str_appendc(&key,':');
+ }
+ smart_str_appends(&key,h->name);
+ smart_str_0(&key);
+ if (zend_hash_add(binding->headers, key.c, key.len+1, (void**)&h, sizeof(sdlSoapBindingFunctionHeaderPtr), NULL) != SUCCESS) {
+ delete_header((void**)&h);
+ }
+ smart_str_free(&key);
+ } else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) {
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name);
+ }
+ trav = trav->next;
+ }
+}
+
+static HashTable* wsdl_message(sdlCtx *ctx, xmlChar* message_name)
+{
+ xmlNodePtr trav, part, message = NULL, *tmp;
+ HashTable* parameters = NULL;
+ char *ctype;
+
+ ctype = strrchr((char*)message_name,':');
+ if (ctype == NULL) {
+ ctype = (char*)message_name;
+ } else {
+ ++ctype;
+ }
+ if (zend_hash_find(&ctx->messages, ctype, strlen(ctype)+1, (void**)&tmp) != SUCCESS) {
+ soap_error1(E_ERROR, "Parsing WSDL: Missing <message> with name '%s'", message_name);
+ }
+ message = *tmp;
+
+ parameters = emalloc(sizeof(HashTable));
+ zend_hash_init(parameters, 0, NULL, delete_parameter, 0);
+
+ trav = message->children;
+ while (trav != NULL) {
+ xmlAttrPtr element, type, name;
+ sdlParamPtr param;
+
+ if (trav->ns != NULL && strcmp((char*)trav->ns->href, WSDL_NAMESPACE) != 0) {
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected extensibility element <%s>", trav->name);
+ }
+ if (node_is_equal(trav,"documentation")) {
+ trav = trav->next;
+ continue;
+ }
+ if (!node_is_equal(trav,"part")) {
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name);
+ }
+ part = trav;
+ param = emalloc(sizeof(sdlParam));
+ memset(param,0,sizeof(sdlParam));
+ param->order = 0;
+
+ name = get_attribute(part->properties, "name");
+ if (name == NULL) {
+ soap_error1(E_ERROR, "Parsing WSDL: No name associated with <part> '%s'", message->name);
+ }
+
+ param->paramName = estrdup((char*)name->children->content);
+
+ type = get_attribute(part->properties, "type");
+ if (type != NULL) {
+ param->encode = get_encoder_from_prefix(ctx->sdl, part, type->children->content);
+ } else {
+ element = get_attribute(part->properties, "element");
+ if (element != NULL) {
+ param->element = get_element(ctx->sdl, part, element->children->content);
+ if (param->element) {
+ param->encode = param->element->encode;
+ }
+ }
+ }
+
+ zend_hash_next_index_insert(parameters, &param, sizeof(sdlParamPtr), NULL);
+
+ trav = trav->next;
+ }
+ return parameters;
+}
+
+static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
+{
+ sdlCtx ctx;
+ int i,n;
+
+ memset(&ctx,0,sizeof(ctx));
+ ctx.sdl = emalloc(sizeof(sdl));
+ memset(ctx.sdl, 0, sizeof(sdl));
+ ctx.sdl->source = estrdup(struri);
+ zend_hash_init(&ctx.sdl->functions, 0, NULL, delete_function, 0);
+
+ zend_hash_init(&ctx.docs, 0, NULL, delete_document, 0);
+ zend_hash_init(&ctx.messages, 0, NULL, NULL, 0);
+ zend_hash_init(&ctx.bindings, 0, NULL, NULL, 0);
+ zend_hash_init(&ctx.portTypes, 0, NULL, NULL, 0);
+ zend_hash_init(&ctx.services, 0, NULL, NULL, 0);
+
+ load_wsdl_ex(this_ptr, struri,&ctx, 0 TSRMLS_CC);
+ schema_pass2(&ctx);
+
+ n = zend_hash_num_elements(&ctx.services);
+ if (n > 0) {
+ zend_hash_internal_pointer_reset(&ctx.services);
+ for (i = 0; i < n; i++) {
+ xmlNodePtr *tmp, service;
+ xmlNodePtr trav, port;
+ int has_soap_port = 0;
+
+ zend_hash_get_current_data(&ctx.services, (void **)&tmp);
+ service = *tmp;
+
+ trav = service->children;
+ while (trav != NULL) {
+ xmlAttrPtr type, name, bindingAttr, location;
+ xmlNodePtr portType, operation;
+ xmlNodePtr address, binding, trav2;
+ char *ctype;
+ sdlBindingPtr tmpbinding;
+ char *wsdl_soap_namespace = NULL;
+
+ if (!is_wsdl_element(trav) || node_is_equal(trav,"documentation")) {
+ trav = trav->next;
+ continue;
+ }
+ if (!node_is_equal(trav,"port")) {
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name);
+ }
+
+ port = trav;
+
+ tmpbinding = emalloc(sizeof(sdlBinding));
+ memset(tmpbinding, 0, sizeof(sdlBinding));
+
+ bindingAttr = get_attribute(port->properties, "binding");
+ if (bindingAttr == NULL) {
+ soap_error0(E_ERROR, "Parsing WSDL: No binding associated with <port>");
+ }
+
+ /* find address and figure out binding type */
+ address = NULL;
+ trav2 = port->children;
+ while (trav2 != NULL) {
+ if (node_is_equal(trav2,"address") && trav2->ns) {
+ if (!strncmp((char*)trav2->ns->href, WSDL_SOAP11_NAMESPACE, sizeof(WSDL_SOAP11_NAMESPACE))) {
+ address = trav2;
+ wsdl_soap_namespace = WSDL_SOAP11_NAMESPACE;
+ tmpbinding->bindingType = BINDING_SOAP;
+ } else if (!strncmp((char*)trav2->ns->href, WSDL_SOAP12_NAMESPACE, sizeof(WSDL_SOAP12_NAMESPACE))) {
+ address = trav2;
+ wsdl_soap_namespace = WSDL_SOAP12_NAMESPACE;
+ tmpbinding->bindingType = BINDING_SOAP;
+ } else if (!strncmp((char*)trav2->ns->href, RPC_SOAP12_NAMESPACE, sizeof(RPC_SOAP12_NAMESPACE))) {
+ address = trav2;
+ wsdl_soap_namespace = RPC_SOAP12_NAMESPACE;
+ tmpbinding->bindingType = BINDING_SOAP;
+ } else if (!strncmp((char*)trav2->ns->href, WSDL_HTTP11_NAMESPACE, sizeof(WSDL_HTTP11_NAMESPACE))) {
+ address = trav2;
+ tmpbinding->bindingType = BINDING_HTTP;
+ } else if (!strncmp((char*)trav2->ns->href, WSDL_HTTP12_NAMESPACE, sizeof(WSDL_HTTP12_NAMESPACE))) {
+ address = trav2;
+ tmpbinding->bindingType = BINDING_HTTP;
+ }
+ }
+ if (trav2 != address && is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) {
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav2->name);
+ }
+ trav2 = trav2->next;
+ }
+ if (!address || tmpbinding->bindingType == BINDING_HTTP) {
+ if (has_soap_port || trav->next || i < n-1) {
+ efree(tmpbinding);
+ trav = trav->next;
+ continue;
+ } else if (!address) {
+ soap_error0(E_ERROR, "Parsing WSDL: No address associated with <port>");
+ }
+ }
+ has_soap_port = 1;
+
+ location = get_attribute(address->properties, "location");
+ if (!location) {
+ soap_error0(E_ERROR, "Parsing WSDL: No location associated with <port>");
+ }
+
+ tmpbinding->location = estrdup((char*)location->children->content);
+
+ ctype = strrchr((char*)bindingAttr->children->content,':');
+ if (ctype == NULL) {
+ ctype = (char*)bindingAttr->children->content;
+ } else {
+ ++ctype;
+ }
+ if (zend_hash_find(&ctx.bindings, ctype, strlen(ctype)+1, (void*)&tmp) != SUCCESS) {
+ soap_error1(E_ERROR, "Parsing WSDL: No <binding> element with name '%s'", ctype);
+ }
+ binding = *tmp;
+
+ if (tmpbinding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingPtr soapBinding;
+ xmlNodePtr soapBindingNode;
+ xmlAttrPtr tmp;
+
+ soapBinding = emalloc(sizeof(sdlSoapBinding));
+ memset(soapBinding, 0, sizeof(sdlSoapBinding));
+ soapBinding->style = SOAP_DOCUMENT;
+
+ soapBindingNode = get_node_ex(binding->children, "binding", wsdl_soap_namespace);
+ if (soapBindingNode) {
+ tmp = get_attribute(soapBindingNode->properties, "style");
+ if (tmp && !strncmp((char*)tmp->children->content, "rpc", sizeof("rpc"))) {
+ soapBinding->style = SOAP_RPC;
+ }
+
+ tmp = get_attribute(soapBindingNode->properties, "transport");
+ if (tmp) {
+ if (strncmp((char*)tmp->children->content, WSDL_HTTP_TRANSPORT, sizeof(WSDL_HTTP_TRANSPORT)) == 0) {
+ soapBinding->transport = SOAP_TRANSPORT_HTTP;
+ } else {
+ /* try the next binding */
+ efree(soapBinding);
+ efree(tmpbinding->location);
+ efree(tmpbinding);
+ trav = trav->next;
+ continue;
+ }
+ }
+ }
+ tmpbinding->bindingAttributes = (void *)soapBinding;
+ }
+
+ name = get_attribute(binding->properties, "name");
+ if (name == NULL) {
+ soap_error0(E_ERROR, "Parsing WSDL: Missing 'name' attribute for <binding>");
+ }
+ tmpbinding->name = estrdup((char*)name->children->content);
+
+ type = get_attribute(binding->properties, "type");
+ if (type == NULL) {
+ soap_error0(E_ERROR, "Parsing WSDL: Missing 'type' attribute for <binding>");
+ }
+
+ ctype = strrchr((char*)type->children->content,':');
+ if (ctype == NULL) {
+ ctype = (char*)type->children->content;
+ } else {
+ ++ctype;
+ }
+ if (zend_hash_find(&ctx.portTypes, ctype, strlen(ctype)+1, (void**)&tmp) != SUCCESS) {
+ soap_error1(E_ERROR, "Parsing WSDL: Missing <portType> with name '%s'", name->children->content);
+ }
+ portType = *tmp;
+
+ trav2 = binding->children;
+ while (trav2 != NULL) {
+ sdlFunctionPtr function;
+ xmlNodePtr input, output, fault, portTypeOperation, trav3;
+ xmlAttrPtr op_name, paramOrder;
+
+ if ((tmpbinding->bindingType == BINDING_SOAP &&
+ node_is_equal_ex(trav2, "binding", wsdl_soap_namespace)) ||
+ !is_wsdl_element(trav2) ||
+ node_is_equal(trav2,"documentation")) {
+ trav2 = trav2->next;
+ continue;
+ }
+ if (!node_is_equal(trav2,"operation")) {
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav2->name);
+ }
+
+ operation = trav2;
+
+ op_name = get_attribute(operation->properties, "name");
+ if (op_name == NULL) {
+ soap_error0(E_ERROR, "Parsing WSDL: Missing 'name' attribute for <operation>");
+ }
+
+ trav3 = operation->children;
+ while (trav3 != NULL) {
+ if (tmpbinding->bindingType == BINDING_SOAP &&
+ node_is_equal_ex(trav3, "operation", wsdl_soap_namespace)) {
+ } else if (is_wsdl_element(trav3) &&
+ !node_is_equal(trav3,"input") &&
+ !node_is_equal(trav3,"output") &&
+ !node_is_equal(trav3,"fault") &&
+ !node_is_equal(trav3,"documentation")) {
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav3->name);
+ }
+ trav3 = trav3->next;
+ }
+
+ portTypeOperation = get_node_with_attribute_ex(portType->children, "operation", WSDL_NAMESPACE, "name", (char*)op_name->children->content, NULL);
+ if (portTypeOperation == NULL) {
+ soap_error1(E_ERROR, "Parsing WSDL: Missing <portType>/<operation> with name '%s'", op_name->children->content);
+ }
+
+ function = emalloc(sizeof(sdlFunction));
+ memset(function, 0, sizeof(sdlFunction));
+ function->functionName = estrdup((char*)op_name->children->content);
+
+ if (tmpbinding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionPtr soapFunctionBinding;
+ sdlSoapBindingPtr soapBinding;
+ xmlNodePtr soapOperation;
+ xmlAttrPtr tmp;
+
+ soapFunctionBinding = emalloc(sizeof(sdlSoapBindingFunction));
+ memset(soapFunctionBinding, 0, sizeof(sdlSoapBindingFunction));
+ soapBinding = (sdlSoapBindingPtr)tmpbinding->bindingAttributes;
+ soapFunctionBinding->style = soapBinding->style;
+
+ soapOperation = get_node_ex(operation->children, "operation", wsdl_soap_namespace);
+ if (soapOperation) {
+ tmp = get_attribute(soapOperation->properties, "soapAction");
+ if (tmp) {
+ soapFunctionBinding->soapAction = estrdup((char*)tmp->children->content);
+ }
+
+ tmp = get_attribute(soapOperation->properties, "style");
+ if (tmp) {
+ if (!strncmp((char*)tmp->children->content, "rpc", sizeof("rpc"))) {
+ soapFunctionBinding->style = SOAP_RPC;
+ } else {
+ soapFunctionBinding->style = SOAP_DOCUMENT;
+ }
+ } else {
+ soapFunctionBinding->style = soapBinding->style;
+ }
+ }
+
+ function->bindingAttributes = (void *)soapFunctionBinding;
+ }
+
+ input = get_node_ex(portTypeOperation->children, "input", WSDL_NAMESPACE);
+ if (input != NULL) {
+ xmlAttrPtr message, name;
+
+ message = get_attribute(input->properties, "message");
+ if (message == NULL) {
+ soap_error1(E_ERROR, "Parsing WSDL: Missing name for <input> of '%s'", op_name->children->content);
+ }
+ function->requestParameters = wsdl_message(&ctx, message->children->content);
+
+ name = get_attribute(input->properties, "name");
+/* FIXME
+ if (name != NULL) {
+ function->requestName = estrdup(name->children->content);
+ } else {
+*/
+ {
+ function->requestName = estrdup(function->functionName);
+ }
+
+ if (tmpbinding->bindingType == BINDING_SOAP) {
+ input = get_node_ex(operation->children, "input", WSDL_NAMESPACE);
+ if (input != NULL) {
+ sdlSoapBindingFunctionPtr soapFunctionBinding = function->bindingAttributes;
+ wsdl_soap_binding_body(&ctx, input, wsdl_soap_namespace, &soapFunctionBinding->input, function->requestParameters);
+ }
+ }
+ }
+
+ output = get_node_ex(portTypeOperation->children, "output", WSDL_NAMESPACE);
+ if (output != NULL) {
+ xmlAttrPtr message, name;
+
+ message = get_attribute(output->properties, "message");
+ if (message == NULL) {
+ soap_error1(E_ERROR, "Parsing WSDL: Missing name for <output> of '%s'", op_name->children->content);
+ }
+ function->responseParameters = wsdl_message(&ctx, message->children->content);
+
+ name = get_attribute(output->properties, "name");
+/* FIXME
+ if (name != NULL) {
+ function->responseName = estrdup(name->children->content);
+ } else if (input == NULL) {
+ function->responseName = estrdup(function->functionName);
+ } else {
+*/
+ {
+ int len = strlen(function->functionName);
+ function->responseName = emalloc(len + sizeof("Response"));
+ memcpy(function->responseName, function->functionName, len);
+ memcpy(function->responseName+len, "Response", sizeof("Response"));
+ }
+
+ if (tmpbinding->bindingType == BINDING_SOAP) {
+ output = get_node_ex(operation->children, "output", WSDL_NAMESPACE);
+ if (output != NULL) {
+ sdlSoapBindingFunctionPtr soapFunctionBinding = function->bindingAttributes;
+ wsdl_soap_binding_body(&ctx, output, wsdl_soap_namespace, &soapFunctionBinding->output, function->responseParameters);
+ }
+ }
+ }
+
+ paramOrder = get_attribute(portTypeOperation->properties, "parameterOrder");
+ if (paramOrder) {
+ /* FIXME: */
+ }
+
+ fault = portTypeOperation->children;
+ while (fault != NULL) {
+ if (node_is_equal_ex(fault, "fault", WSDL_NAMESPACE)) {
+ xmlAttrPtr message, name;
+ sdlFaultPtr f;
+
+ name = get_attribute(fault->properties, "name");
+ if (name == NULL) {
+ soap_error1(E_ERROR, "Parsing WSDL: Missing name for <fault> of '%s'", op_name->children->content);
+ }
+ message = get_attribute(fault->properties, "message");
+ if (message == NULL) {
+ soap_error1(E_ERROR, "Parsing WSDL: Missing name for <output> of '%s'", op_name->children->content);
+ }
+
+ f = emalloc(sizeof(sdlFault));
+ memset(f, 0, sizeof(sdlFault));
+
+ f->name = estrdup((char*)name->children->content);
+ f->details = wsdl_message(&ctx, message->children->content);
+ if (f->details == NULL || zend_hash_num_elements(f->details) > 1) {
+ soap_error1(E_ERROR, "Parsing WSDL: The fault message '%s' must have a single part", message->children->content);
+ }
+
+ if (tmpbinding->bindingType == BINDING_SOAP) {
+ xmlNodePtr soap_fault = get_node_with_attribute_ex(operation->children, "fault", WSDL_NAMESPACE, "name", f->name, NULL);
+ if (soap_fault != NULL) {
+ xmlNodePtr trav = soap_fault->children;
+ while (trav != NULL) {
+ if (node_is_equal_ex(trav, "fault", wsdl_soap_namespace)) {
+ xmlAttrPtr tmp;
+ sdlSoapBindingFunctionFaultPtr binding;
+
+ binding = f->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunctionFault));
+ memset(f->bindingAttributes, 0, sizeof(sdlSoapBindingFunctionFault));
+
+ tmp = get_attribute(trav->properties, "use");
+ if (tmp && !strncmp((char*)tmp->children->content, "encoded", sizeof("encoded"))) {
+ binding->use = SOAP_ENCODED;
+ } else {
+ binding->use = SOAP_LITERAL;
+ }
+
+ tmp = get_attribute(trav->properties, "namespace");
+ if (tmp) {
+ binding->ns = estrdup((char*)tmp->children->content);
+ }
+
+ if (binding->use == SOAP_ENCODED) {
+ tmp = get_attribute(trav->properties, "encodingStyle");
+ if (tmp) {
+ if (strncmp((char*)tmp->children->content, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE)) == 0) {
+ binding->encodingStyle = SOAP_ENCODING_1_1;
+ } else if (strncmp((char*)tmp->children->content, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) {
+ binding->encodingStyle = SOAP_ENCODING_1_2;
+ } else {
+ soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content);
+ }
+ } else {
+ soap_error0(E_ERROR, "Parsing WSDL: Unspecified encodingStyle");
+ }
+ }
+ } else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) {
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name);
+ }
+ trav = trav->next;
+ }
+ }
+ }
+ if (function->faults == NULL) {
+ function->faults = emalloc(sizeof(HashTable));
+ zend_hash_init(function->faults, 0, NULL, delete_fault, 0);
+ }
+ if (zend_hash_add(function->faults, f->name, strlen(f->name)+1, (void**)&f, sizeof(sdlFaultPtr), NULL) != SUCCESS) {
+ soap_error2(E_ERROR, "Parsing WSDL: <fault> with name '%s' already defined in '%s'", f->name, op_name->children->content);
+ }
+ }
+ fault = fault->next;
+ }
+
+ function->binding = tmpbinding;
+
+ {
+ char *tmp = estrdup(function->functionName);
+ int len = strlen(tmp);
+
+ if (zend_hash_add(&ctx.sdl->functions, php_strtolower(tmp, len), len+1, &function, sizeof(sdlFunctionPtr), NULL) != SUCCESS) {
+ zend_hash_next_index_insert(&ctx.sdl->functions, &function, sizeof(sdlFunctionPtr), NULL);
+ }
+ efree(tmp);
+ if (function->requestName != NULL && strcmp(function->requestName,function->functionName) != 0) {
+ if (ctx.sdl->requests == NULL) {
+ ctx.sdl->requests = emalloc(sizeof(HashTable));
+ zend_hash_init(ctx.sdl->requests, 0, NULL, NULL, 0);
+ }
+ tmp = estrdup(function->requestName);
+ len = strlen(tmp);
+ zend_hash_add(ctx.sdl->requests, php_strtolower(tmp, len), len+1, &function, sizeof(sdlFunctionPtr), NULL);
+ efree(tmp);
+ }
+ }
+ trav2 = trav2->next;
+ }
+
+ if (!ctx.sdl->bindings) {
+ ctx.sdl->bindings = emalloc(sizeof(HashTable));
+ zend_hash_init(ctx.sdl->bindings, 0, NULL, delete_binding, 0);
+ }
+
+ zend_hash_add(ctx.sdl->bindings, tmpbinding->name, strlen(tmpbinding->name), &tmpbinding, sizeof(sdlBindingPtr), NULL);
+ trav= trav->next;
+ }
+
+ zend_hash_move_forward(&ctx.services);
+ }
+ } else {
+ soap_error0(E_ERROR, "Parsing WSDL: Couldn't bind to service");
+ }
+
+ if (ctx.sdl->bindings == NULL || ctx.sdl->bindings->nNumOfElements == 0) {
+ soap_error0(E_ERROR, "Parsing WSDL: Could not find any usable binding services in WSDL.");
+ }
+
+ zend_hash_destroy(&ctx.messages);
+ zend_hash_destroy(&ctx.bindings);
+ zend_hash_destroy(&ctx.portTypes);
+ zend_hash_destroy(&ctx.services);
+ zend_hash_destroy(&ctx.docs);
+
+ return ctx.sdl;
+}
+
+#define WSDL_CACHE_VERSION 0x0e
+
+#define WSDL_CACHE_GET(ret,type,buf) memcpy(&ret,*buf,sizeof(type)); *buf += sizeof(type);
+#define WSDL_CACHE_GET_INT(ret,buf) ret = ((unsigned char)(*buf)[0])|((unsigned char)(*buf)[1]<<8)|((unsigned char)(*buf)[2]<<16)|((int)(*buf)[3]<<24); *buf += 4;
+#define WSDL_CACHE_GET_1(ret,type,buf) ret = (type)(**buf); (*buf)++;
+#define WSDL_CACHE_GET_N(ret,n,buf) memcpy(ret,*buf,n); *buf += n;
+#define WSDL_CACHE_SKIP(n,buf) *buf += n;
+
+#define WSDL_CACHE_PUT_INT(val,buf) smart_str_appendc(buf,val & 0xff); \
+ smart_str_appendc(buf,(val >> 8) & 0xff); \
+ smart_str_appendc(buf,(val >> 16) & 0xff); \
+ smart_str_appendc(buf,(val >> 24) & 0xff);
+#define WSDL_CACHE_PUT_1(val,buf) smart_str_appendc(buf,val);
+#define WSDL_CACHE_PUT_N(val,n,buf) smart_str_appendl(buf,(char*)val,n);
+
+static char* sdl_deserialize_string(char **in)
+{
+ char *s;
+ int len;
+
+ WSDL_CACHE_GET_INT(len, in);
+ if (len == 0x7fffffff) {
+ return NULL;
+ } else {
+ s = emalloc(len+1);
+ WSDL_CACHE_GET_N(s, len, in);
+ s[len] = '\0';
+ return s;
+ }
+}
+
+static void sdl_deserialize_key(HashTable* ht, void* data, char **in)
+{
+ int len;
+
+ WSDL_CACHE_GET_INT(len, in);
+ if (len == 0) {
+ zend_hash_next_index_insert(ht, &data, sizeof(void*), NULL);
+ } else {
+ zend_hash_add(ht, *in, len, &data, sizeof(void*), NULL);
+ WSDL_CACHE_SKIP(len, in);
+ }
+}
+
+static void sdl_deserialize_attribute(sdlAttributePtr attr, encodePtr *encoders, char **in)
+{
+ int i;
+
+ attr->name = sdl_deserialize_string(in);
+ attr->namens = sdl_deserialize_string(in);
+ attr->ref = sdl_deserialize_string(in);
+ attr->def = sdl_deserialize_string(in);
+ attr->fixed = sdl_deserialize_string(in);
+ WSDL_CACHE_GET_1(attr->form, sdlForm, in);
+ WSDL_CACHE_GET_1(attr->use, sdlUse, in);
+ WSDL_CACHE_GET_INT(i, in);
+ attr->encode = encoders[i];
+ WSDL_CACHE_GET_INT(i, in);
+ if (i > 0) {
+ attr->extraAttributes = emalloc(sizeof(HashTable));
+ zend_hash_init(attr->extraAttributes, i, NULL, delete_extra_attribute, 0);
+ while (i > 0) {
+ sdlExtraAttributePtr x = emalloc(sizeof(sdlExtraAttribute));
+ sdl_deserialize_key(attr->extraAttributes, x, in);
+ x->ns = sdl_deserialize_string(in);
+ x->val = sdl_deserialize_string(in);
+ --i;
+ }
+ }
+}
+
+static sdlRestrictionIntPtr sdl_deserialize_resriction_int(char **in)
+{
+ if (**in == 1) {
+ sdlRestrictionIntPtr x = emalloc(sizeof(sdlRestrictionInt));
+ WSDL_CACHE_SKIP(1, in);
+ WSDL_CACHE_GET_INT(x->value, in);
+ WSDL_CACHE_GET_1(x->fixed, char, in);
+ return x;
+ } else {
+ WSDL_CACHE_SKIP(1, in);
+ return NULL;
+ }
+}
+
+static sdlRestrictionCharPtr sdl_deserialize_resriction_char(char **in)
+{
+ if (**in == 1) {
+ sdlRestrictionCharPtr x = emalloc(sizeof(sdlRestrictionChar));
+ WSDL_CACHE_SKIP(1, in);
+ x->value = sdl_deserialize_string(in);
+ WSDL_CACHE_GET_1(x->fixed, char, in);
+ return x;
+ } else {
+ WSDL_CACHE_SKIP(1, in);
+ return NULL;
+ }
+}
+
+static sdlContentModelPtr sdl_deserialize_model(sdlTypePtr *types, sdlTypePtr *elements, char **in)
+{
+ int i;
+ sdlContentModelPtr model = emalloc(sizeof(sdlContentModel));
+
+ WSDL_CACHE_GET_1(model->kind, sdlContentKind, in);
+ WSDL_CACHE_GET_INT(model->min_occurs, in);
+ WSDL_CACHE_GET_INT(model->max_occurs, in);
+ switch (model->kind) {
+ case XSD_CONTENT_ELEMENT:
+ WSDL_CACHE_GET_INT(i, in);
+ model->u.element = elements[i];
+ break;
+ case XSD_CONTENT_SEQUENCE:
+ case XSD_CONTENT_ALL:
+ case XSD_CONTENT_CHOICE:
+ WSDL_CACHE_GET_INT(i, in);
+ model->u.content = emalloc(sizeof(HashTable));
+ zend_hash_init(model->u.content, i, NULL, delete_model, 0);
+ while (i > 0) {
+ sdlContentModelPtr x = sdl_deserialize_model(types, elements, in);
+ zend_hash_next_index_insert(model->u.content,&x,sizeof(sdlContentModelPtr),NULL);
+ i--;
+ }
+ break;
+ case XSD_CONTENT_GROUP_REF:
+ model->u.group_ref = sdl_deserialize_string(in);
+ break;
+ case XSD_CONTENT_GROUP:
+ WSDL_CACHE_GET_INT(i, in);
+ model->u.group = types[i];
+ break;
+ default:
+ break;
+ }
+ return model;
+}
+
+static void sdl_deserialize_type(sdlTypePtr type, sdlTypePtr *types, encodePtr *encoders, char **in)
+{
+ int i;
+ sdlTypePtr *elements = NULL;
+
+ WSDL_CACHE_GET_1(type->kind, sdlTypeKind, in);
+ type->name = sdl_deserialize_string(in);
+ type->namens = sdl_deserialize_string(in);
+ type->def = sdl_deserialize_string(in);
+ type->fixed = sdl_deserialize_string(in);
+ type->ref = sdl_deserialize_string(in);
+ WSDL_CACHE_GET_1(type->nillable, char, in);
+ WSDL_CACHE_GET_1(type->form, sdlForm, in);
+
+ WSDL_CACHE_GET_INT(i, in);
+ type->encode = encoders[i];
+
+ if (**in == 1) {
+ WSDL_CACHE_SKIP(1, in);
+ type->restrictions = emalloc(sizeof(sdlRestrictions));
+ /*memset(type->restrictions, 0, sizeof(sdlRestrictions));*/
+ type->restrictions->minExclusive = sdl_deserialize_resriction_int(in);
+ type->restrictions->minInclusive = sdl_deserialize_resriction_int(in);
+ type->restrictions->maxExclusive = sdl_deserialize_resriction_int(in);
+ type->restrictions->maxInclusive = sdl_deserialize_resriction_int(in);
+ type->restrictions->totalDigits = sdl_deserialize_resriction_int(in);
+ type->restrictions->fractionDigits = sdl_deserialize_resriction_int(in);
+ type->restrictions->length = sdl_deserialize_resriction_int(in);
+ type->restrictions->minLength = sdl_deserialize_resriction_int(in);
+ type->restrictions->maxLength = sdl_deserialize_resriction_int(in);
+ type->restrictions->whiteSpace = sdl_deserialize_resriction_char(in);
+ type->restrictions->pattern = sdl_deserialize_resriction_char(in);
+ WSDL_CACHE_GET_INT(i, in);
+ if (i > 0) {
+ type->restrictions->enumeration = emalloc(sizeof(HashTable));
+ zend_hash_init(type->restrictions->enumeration, i, NULL, delete_restriction_var_char, 0);
+ while (i > 0) {
+ sdlRestrictionCharPtr x = sdl_deserialize_resriction_char(in);
+ sdl_deserialize_key(type->restrictions->enumeration, x, in);
+ --i;
+ }
+ } else {
+ type->restrictions->enumeration = NULL;
+ }
+ } else {
+ WSDL_CACHE_SKIP(1, in);
+ }
+
+ WSDL_CACHE_GET_INT(i, in);
+ if (i > 0) {
+ elements = safe_emalloc((i+1), sizeof(sdlTypePtr), 0);
+ elements[0] = NULL;
+ type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(type->elements, i, NULL, delete_type, 0);
+ while (i > 0) {
+ sdlTypePtr t = emalloc(sizeof(sdlType));
+ memset(t, 0, sizeof(sdlType));
+ sdl_deserialize_key(type->elements, t, in);
+ sdl_deserialize_type(t, types, encoders, in);
+ elements[i] = t;
+ --i;
+ }
+ }
+
+ WSDL_CACHE_GET_INT(i, in);
+ if (i > 0) {
+ type->attributes = emalloc(sizeof(HashTable));
+ zend_hash_init(type->attributes, i, NULL, delete_attribute, 0);
+ while (i > 0) {
+ sdlAttributePtr attr = emalloc(sizeof(sdlAttribute));
+ memset(attr, 0, sizeof(sdlAttribute));
+ sdl_deserialize_key(type->attributes, attr, in);
+ sdl_deserialize_attribute(attr, encoders, in);
+ --i;
+ }
+ }
+
+ if (**in != 0) {
+ WSDL_CACHE_SKIP(1, in);
+ type->model = sdl_deserialize_model(types, elements, in);
+ } else {
+ WSDL_CACHE_SKIP(1, in);
+ }
+ if (elements != NULL) {
+ efree(elements);
+ }
+}
+
+static void sdl_deserialize_encoder(encodePtr enc, sdlTypePtr *types, char **in)
+{
+ int i;
+
+ WSDL_CACHE_GET_INT(enc->details.type, in);
+ enc->details.type_str = sdl_deserialize_string(in);
+ enc->details.ns = sdl_deserialize_string(in);
+ WSDL_CACHE_GET_INT(i, in);
+ enc->details.sdl_type = types[i];
+ enc->to_xml = sdl_guess_convert_xml;
+ enc->to_zval = sdl_guess_convert_zval;
+
+ if (enc->details.sdl_type == NULL) {
+ int ns_len = strlen(enc->details.ns);
+ int type_len = strlen(enc->details.type_str);
+
+ if (((ns_len == sizeof(SOAP_1_1_ENC_NAMESPACE)-1 &&
+ memcmp(enc->details.ns, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE)-1) == 0) ||
+ (ns_len == sizeof(SOAP_1_2_ENC_NAMESPACE)-1 &&
+ memcmp(enc->details.ns, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)-1) == 0))) {
+ char *enc_nscat;
+ int enc_ns_len;
+ int enc_len;
+ encodePtr real_enc;
+
+ enc_ns_len = sizeof(XSD_NAMESPACE)-1;
+ enc_len = enc_ns_len + type_len + 1;
+ enc_nscat = emalloc(enc_len + 1);
+ memcpy(enc_nscat, XSD_NAMESPACE, sizeof(XSD_NAMESPACE)-1);
+ enc_nscat[enc_ns_len] = ':';
+ memcpy(enc_nscat+enc_ns_len+1, enc->details.type_str, type_len);
+ enc_nscat[enc_len] = '\0';
+
+ real_enc = get_encoder_ex(NULL, enc_nscat, enc_len);
+ efree(enc_nscat);
+ if (real_enc) {
+ enc->to_zval = real_enc->to_zval;
+ enc->to_xml = real_enc->to_xml;
+ }
+ }
+ }
+}
+
+static void sdl_deserialize_soap_body(sdlSoapBindingFunctionBodyPtr body, encodePtr *encoders, sdlTypePtr *types, char **in)
+{
+ int i, j, n;
+
+ WSDL_CACHE_GET_1(body->use, sdlEncodingUse, in);
+ if (body->use == SOAP_ENCODED) {
+ WSDL_CACHE_GET_1(body->encodingStyle, sdlRpcEncodingStyle, in);
+ } else {
+ body->encodingStyle = SOAP_ENCODING_DEFAULT;
+ }
+ body->ns = sdl_deserialize_string(in);
+ WSDL_CACHE_GET_INT(i, in);
+ if (i > 0) {
+ body->headers = emalloc(sizeof(HashTable));
+ zend_hash_init(body->headers, i, NULL, delete_header, 0);
+ while (i > 0) {
+ sdlSoapBindingFunctionHeaderPtr tmp = emalloc(sizeof(sdlSoapBindingFunctionHeader));
+ memset(tmp, 0, sizeof(sdlSoapBindingFunctionHeader));
+ sdl_deserialize_key(body->headers, tmp, in);
+ WSDL_CACHE_GET_1(tmp->use, sdlEncodingUse, in);
+ if (tmp->use == SOAP_ENCODED) {
+ WSDL_CACHE_GET_1(tmp->encodingStyle, sdlRpcEncodingStyle, in);
+ } else {
+ tmp->encodingStyle = SOAP_ENCODING_DEFAULT;
+ }
+ tmp->name = sdl_deserialize_string(in);
+ tmp->ns = sdl_deserialize_string(in);
+ WSDL_CACHE_GET_INT(n, in);
+ tmp->encode = encoders[n];
+ WSDL_CACHE_GET_INT(n, in);
+ tmp->element = types[n];
+ --i;
+ WSDL_CACHE_GET_INT(j, in);
+ if (j > 0) {
+ tmp->headerfaults = emalloc(sizeof(HashTable));
+ zend_hash_init(tmp->headerfaults, i, NULL, delete_header, 0);
+ while (j > 0) {
+ sdlSoapBindingFunctionHeaderPtr tmp2 = emalloc(sizeof(sdlSoapBindingFunctionHeader));
+ memset(tmp2, 0, sizeof(sdlSoapBindingFunctionHeader));
+ sdl_deserialize_key(tmp->headerfaults, tmp2, in);
+ WSDL_CACHE_GET_1(tmp2->use, sdlEncodingUse, in);
+ if (tmp2->use == SOAP_ENCODED) {
+ WSDL_CACHE_GET_1(tmp2->encodingStyle, sdlRpcEncodingStyle, in);
+ } else {
+ tmp2->encodingStyle = SOAP_ENCODING_DEFAULT;
+ }
+ tmp2->name = sdl_deserialize_string(in);
+ tmp2->ns = sdl_deserialize_string(in);
+ WSDL_CACHE_GET_INT(n, in);
+ tmp2->encode = encoders[n];
+ WSDL_CACHE_GET_INT(n, in);
+ tmp2->element = types[n];
+ --j;
+ }
+ }
+ }
+ }
+}
+
+static HashTable* sdl_deserialize_parameters(encodePtr *encoders, sdlTypePtr *types, char **in)
+{
+ int i, n;
+ HashTable *ht;
+
+ WSDL_CACHE_GET_INT(i, in);
+ if (i == 0) {return NULL;}
+ ht = emalloc(sizeof(HashTable));
+ zend_hash_init(ht, i, NULL, delete_parameter, 0);
+ while (i > 0) {
+ sdlParamPtr param = emalloc(sizeof(sdlParam));
+ sdl_deserialize_key(ht, param, in);
+ param->paramName = sdl_deserialize_string(in);
+ WSDL_CACHE_GET_INT(param->order, in);
+ WSDL_CACHE_GET_INT(n, in);
+ param->encode = encoders[n];
+ WSDL_CACHE_GET_INT(n, in);
+ param->element = types[n];
+ --i;
+ }
+ return ht;
+}
+
+static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t, time_t *cached TSRMLS_DC)
+{
+ sdlPtr sdl;
+ time_t old_t;
+ int i, num_groups, num_types, num_elements, num_encoders, num_bindings, num_func;
+ sdlFunctionPtr *functions = NULL;
+ sdlBindingPtr *bindings;
+ sdlTypePtr *types;
+ encodePtr *encoders;
+ encodePtr enc;
+
+ int f;
+ struct stat st;
+ char *in, *buf;
+
+ f = open(fn, O_RDONLY|O_BINARY);
+ if (f < 0) {
+ return NULL;
+ }
+ if (fstat(f, &st) != 0) {
+ close(f);
+ return NULL;
+ }
+ buf = in = emalloc(st.st_size);
+ if (read(f, in, st.st_size) != st.st_size) {
+ close(f);
+ efree(in);
+ return NULL;
+ }
+ close(f);
+
+ if (strncmp(in,"wsdl",4) != 0 || in[4] != WSDL_CACHE_VERSION || in[5] != '\0') {
+ unlink(fn);
+ efree(buf);
+ return NULL;
+ }
+ in += 6;
+
+ WSDL_CACHE_GET(old_t, time_t, &in);
+ if (old_t < t) {
+ unlink(fn);
+ efree(buf);
+ return NULL;
+ }
+ *cached = old_t;
+
+ WSDL_CACHE_GET_INT(i, &in);
+ if (i == 0 && strncmp(in, uri, i) != 0) {
+ unlink(fn);
+ efree(buf);
+ return NULL;
+ }
+ WSDL_CACHE_SKIP(i, &in);
+
+ sdl = emalloc(sizeof(*sdl));
+ memset(sdl, 0, sizeof(*sdl));
+
+ sdl->source = sdl_deserialize_string(&in);
+ sdl->target_ns = sdl_deserialize_string(&in);
+
+ WSDL_CACHE_GET_INT(num_groups, &in);
+ WSDL_CACHE_GET_INT(num_types, &in);
+ WSDL_CACHE_GET_INT(num_elements, &in);
+ WSDL_CACHE_GET_INT(num_encoders, &in);
+
+ i = num_groups+num_types+num_elements;
+ types = safe_emalloc((i+1), sizeof(sdlTypePtr), 0);
+ types[0] = NULL;
+ while (i > 0) {
+ types[i] = emalloc(sizeof(sdlType));
+ memset(types[i], 0, sizeof(sdlType));
+ i--;
+ }
+
+ i = num_encoders;
+ enc = defaultEncoding;
+ while (enc->details.type != END_KNOWN_TYPES) {
+ i++; enc++;
+ }
+ encoders = safe_emalloc((i+1), sizeof(encodePtr), 0);
+ i = num_encoders;
+ encoders[0] = NULL;
+ while (i > 0) {
+ encoders[i] = emalloc(sizeof(encode));
+ memset(encoders[i], 0, sizeof(encode));
+ i--;
+ }
+ i = num_encoders;
+ enc = defaultEncoding;
+ while (enc->details.type != END_KNOWN_TYPES) {
+ encoders[++i] = enc++;
+ }
+
+ i = 1;
+ if (num_groups > 0) {
+ sdl->groups = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->groups, num_groups, NULL, delete_type, 0);
+ while (i < num_groups+1) {
+ sdl_deserialize_key(sdl->groups, types[i], &in);
+ sdl_deserialize_type(types[i], types, encoders, &in);
+ i++;
+ }
+ }
+
+ if (num_types > 0) {
+ sdl->types = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->types, num_types, NULL, delete_type, 0);
+ while (i < num_groups+num_types+1) {
+ sdl_deserialize_key(sdl->types, types[i], &in);
+ sdl_deserialize_type(types[i], types, encoders, &in);
+ i++;
+ }
+ }
+
+ if (num_elements > 0) {
+ sdl->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->elements, num_elements, NULL, delete_type, 0);
+ while (i < num_groups+num_types+num_elements+1) {
+ sdl_deserialize_key(sdl->elements, types[i], &in);
+ sdl_deserialize_type(types[i], types, encoders, &in);
+ i++;
+ }
+ }
+
+ i = 1;
+ if (num_encoders > 0) {
+ sdl->encoders = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->encoders, num_encoders, NULL, delete_encoder, 0);
+ while (i < num_encoders+1) {
+ sdl_deserialize_key(sdl->encoders, encoders[i], &in);
+ sdl_deserialize_encoder(encoders[i], types, &in);
+ i++;
+ }
+ }
+
+ /* deserialize bindings */
+ WSDL_CACHE_GET_INT(num_bindings, &in);
+ bindings = safe_emalloc(num_bindings, sizeof(sdlBindingPtr), 0);
+ if (num_bindings > 0) {
+ sdl->bindings = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->bindings, num_bindings, NULL, delete_binding, 0);
+ for (i = 0; i < num_bindings; i++) {
+ sdlBindingPtr binding = emalloc(sizeof(sdlBinding));
+ memset(binding, 0, sizeof(sdlBinding));
+ sdl_deserialize_key(sdl->bindings, binding, &in);
+ binding->name = sdl_deserialize_string(&in);
+ binding->location = sdl_deserialize_string(&in);
+ WSDL_CACHE_GET_1(binding->bindingType,sdlBindingType,&in);
+ if (binding->bindingType == BINDING_SOAP && *in != 0) {
+ sdlSoapBindingPtr soap_binding = binding->bindingAttributes = emalloc(sizeof(sdlSoapBinding));
+ WSDL_CACHE_GET_1(soap_binding->style,sdlEncodingStyle,&in);
+ WSDL_CACHE_GET_1(soap_binding->transport,sdlTransport,&in);
+ } else {
+ WSDL_CACHE_SKIP(1,&in);
+ }
+ bindings[i] = binding;
+ }
+ }
+
+ /* deserialize functions */
+ WSDL_CACHE_GET_INT(num_func, &in);
+ zend_hash_init(&sdl->functions, num_func, NULL, delete_function, 0);
+ if (num_func > 0) {
+ functions = safe_emalloc(num_func, sizeof(sdlFunctionPtr), 0);
+ for (i = 0; i < num_func; i++) {
+ int binding_num, num_faults;
+ sdlFunctionPtr func = emalloc(sizeof(sdlFunction));
+ sdl_deserialize_key(&sdl->functions, func, &in);
+ func->functionName = sdl_deserialize_string(&in);
+ func->requestName = sdl_deserialize_string(&in);
+ func->responseName = sdl_deserialize_string(&in);
+
+ WSDL_CACHE_GET_INT(binding_num, &in);
+ if (binding_num == 0) {
+ func->binding = NULL;
+ } else {
+ func->binding = bindings[binding_num-1];
+ }
+ if (func->binding && func->binding->bindingType == BINDING_SOAP && *in != 0) {
+ sdlSoapBindingFunctionPtr binding = func->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunction));
+ memset(binding, 0, sizeof(sdlSoapBindingFunction));
+ WSDL_CACHE_GET_1(binding->style,sdlEncodingStyle,&in);
+ binding->soapAction = sdl_deserialize_string(&in);
+ sdl_deserialize_soap_body(&binding->input, encoders, types, &in);
+ sdl_deserialize_soap_body(&binding->output, encoders, types, &in);
+ } else {
+ WSDL_CACHE_SKIP(1, &in);
+ func->bindingAttributes = NULL;
+ }
+
+ func->requestParameters = sdl_deserialize_parameters(encoders, types, &in);
+ func->responseParameters = sdl_deserialize_parameters(encoders, types, &in);
+
+ WSDL_CACHE_GET_INT(num_faults, &in);
+ if (num_faults > 0) {
+ int j;
+
+ func->faults = emalloc(sizeof(HashTable));
+ zend_hash_init(func->faults, num_faults, NULL, delete_fault, 0);
+
+ for (j = 0; j < num_faults; j++) {
+ sdlFaultPtr fault = emalloc(sizeof(sdlFault));
+
+ sdl_deserialize_key(func->faults, fault, &in);
+ fault->name =sdl_deserialize_string(&in);
+ fault->details =sdl_deserialize_parameters(encoders, types, &in);
+ if (*in != 0) {
+ sdlSoapBindingFunctionFaultPtr binding = fault->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunctionFault));
+ memset(binding, 0, sizeof(sdlSoapBindingFunctionFault));
+ WSDL_CACHE_GET_1(binding->use,sdlEncodingUse,&in);
+ if (binding->use == SOAP_ENCODED) {
+ WSDL_CACHE_GET_1(binding->encodingStyle, sdlRpcEncodingStyle, &in);
+ } else {
+ binding->encodingStyle = SOAP_ENCODING_DEFAULT;
+ }
+ binding->ns = sdl_deserialize_string(&in);
+ } else {
+ WSDL_CACHE_SKIP(1, &in);
+ fault->bindingAttributes = NULL;
+ }
+ }
+ } else {
+ func->faults = NULL;
+ }
+ functions[i] = func;
+ }
+ }
+
+ /* deserialize requests */
+ WSDL_CACHE_GET_INT(i, &in);
+ if (i > 0) {
+ sdl->requests = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->requests, i, NULL, NULL, 0);
+ while (i > 0) {
+ int function_num;
+
+ WSDL_CACHE_GET_INT(function_num, &in);
+ sdl_deserialize_key(sdl->requests, functions[function_num-1], &in);
+ i--;
+ }
+ }
+
+ if (functions) {
+ efree(functions);
+ }
+ efree(bindings);
+ efree(encoders);
+ efree(types);
+ efree(buf);
+ return sdl;
+}
+
+static void sdl_serialize_string(const char *str, smart_str *out)
+{
+ int i;
+
+ if (str) {
+ i = strlen(str);
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ WSDL_CACHE_PUT_N(str, i, out);
+ }
+ } else {
+ WSDL_CACHE_PUT_INT(0x7fffffff, out);
+ }
+}
+
+static void sdl_serialize_key(HashTable *ht, smart_str *out)
+{
+ char *key;
+ uint key_len;
+ ulong index;
+
+ if (zend_hash_get_current_key_ex(ht, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ WSDL_CACHE_PUT_INT(key_len, out);
+ WSDL_CACHE_PUT_N(key, key_len, out);
+ } else {
+ WSDL_CACHE_PUT_INT(0, out);
+ }
+}
+
+static void sdl_serialize_encoder_ref(encodePtr enc, HashTable *tmp_encoders, smart_str *out) {
+ if (enc) {
+ int *encoder_num;
+ if (zend_hash_find(tmp_encoders, (char*)&enc, sizeof(enc), (void**)&encoder_num) == SUCCESS) {
+ WSDL_CACHE_PUT_INT(*encoder_num, out);
+ } else {
+ WSDL_CACHE_PUT_INT(0, out);
+ }
+ } else {
+ WSDL_CACHE_PUT_INT(0, out);
+ }
+}
+
+static void sdl_serialize_type_ref(sdlTypePtr type, HashTable *tmp_types, smart_str *out) {
+ if (type) {
+ int *type_num;
+ if (zend_hash_find(tmp_types, (char*)&type, sizeof(type), (void**)&type_num) == SUCCESS) {
+ WSDL_CACHE_PUT_INT(*type_num, out);
+ } else {
+ WSDL_CACHE_PUT_INT(0, out);
+ }
+ } else {
+ WSDL_CACHE_PUT_INT(0,out);
+ }
+}
+
+static void sdl_serialize_attribute(sdlAttributePtr attr, HashTable *tmp_encoders, smart_str *out)
+{
+ int i;
+
+ sdl_serialize_string(attr->name, out);
+ sdl_serialize_string(attr->namens, out);
+ sdl_serialize_string(attr->ref, out);
+ sdl_serialize_string(attr->def, out);
+ sdl_serialize_string(attr->fixed, out);
+ WSDL_CACHE_PUT_1(attr->form, out);
+ WSDL_CACHE_PUT_1(attr->use, out);
+ sdl_serialize_encoder_ref(attr->encode, tmp_encoders, out);
+ if (attr->extraAttributes) {
+ i = zend_hash_num_elements(attr->extraAttributes);
+ } else {
+ i = 0;
+ }
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ sdlExtraAttributePtr *tmp;
+ zend_hash_internal_pointer_reset(attr->extraAttributes);
+ while (zend_hash_get_current_data(attr->extraAttributes, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_key(attr->extraAttributes, out);
+ sdl_serialize_string((*tmp)->ns, out);
+ sdl_serialize_string((*tmp)->val, out);
+ zend_hash_move_forward(attr->extraAttributes);
+ }
+ }
+}
+
+static void sdl_serialize_model(sdlContentModelPtr model, HashTable *tmp_types, HashTable *tmp_elements, smart_str *out)
+{
+ WSDL_CACHE_PUT_1(model->kind, out);
+ WSDL_CACHE_PUT_INT(model->min_occurs, out);
+ WSDL_CACHE_PUT_INT(model->max_occurs, out);
+ switch (model->kind) {
+ case XSD_CONTENT_ELEMENT:
+ sdl_serialize_type_ref(model->u.element, tmp_elements, out);
+ break;
+ case XSD_CONTENT_SEQUENCE:
+ case XSD_CONTENT_ALL:
+ case XSD_CONTENT_CHOICE: {
+ sdlContentModelPtr *tmp;
+ int i = zend_hash_num_elements(model->u.content);
+
+ WSDL_CACHE_PUT_INT(i, out);
+ zend_hash_internal_pointer_reset(model->u.content);
+ while (zend_hash_get_current_data(model->u.content, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_model(*tmp, tmp_types, tmp_elements, out);
+ zend_hash_move_forward(model->u.content);
+ }
+ }
+ break;
+ case XSD_CONTENT_GROUP_REF:
+ sdl_serialize_string(model->u.group_ref,out);
+ break;
+ case XSD_CONTENT_GROUP:
+ sdl_serialize_type_ref(model->u.group, tmp_types, out);
+ break;
+ default:
+ break;
+ }
+}
+
+static void sdl_serialize_resriction_int(sdlRestrictionIntPtr x, smart_str *out)
+{
+ if (x) {
+ WSDL_CACHE_PUT_1(1, out);
+ WSDL_CACHE_PUT_INT(x->value, out);
+ WSDL_CACHE_PUT_1(x->fixed, out);
+ } else {
+ WSDL_CACHE_PUT_1(0, out);
+ }
+}
+
+static void sdl_serialize_resriction_char(sdlRestrictionCharPtr x, smart_str *out)
+{
+ if (x) {
+ WSDL_CACHE_PUT_1(1, out);
+ sdl_serialize_string(x->value, out);
+ WSDL_CACHE_PUT_1(x->fixed, out);
+ } else {
+ WSDL_CACHE_PUT_1(0, out);
+ }
+}
+
+static void sdl_serialize_type(sdlTypePtr type, HashTable *tmp_encoders, HashTable *tmp_types, smart_str *out)
+{
+ int i;
+ HashTable *tmp_elements = NULL;
+
+ WSDL_CACHE_PUT_1(type->kind, out);
+ sdl_serialize_string(type->name, out);
+ sdl_serialize_string(type->namens, out);
+ sdl_serialize_string(type->def, out);
+ sdl_serialize_string(type->fixed, out);
+ sdl_serialize_string(type->ref, out);
+ WSDL_CACHE_PUT_1(type->nillable, out);
+ WSDL_CACHE_PUT_1(type->form, out);
+ sdl_serialize_encoder_ref(type->encode, tmp_encoders, out);
+
+ if (type->restrictions) {
+ WSDL_CACHE_PUT_1(1, out);
+ sdl_serialize_resriction_int(type->restrictions->minExclusive,out);
+ sdl_serialize_resriction_int(type->restrictions->minInclusive,out);
+ sdl_serialize_resriction_int(type->restrictions->maxExclusive,out);
+ sdl_serialize_resriction_int(type->restrictions->maxInclusive,out);
+ sdl_serialize_resriction_int(type->restrictions->totalDigits,out);
+ sdl_serialize_resriction_int(type->restrictions->fractionDigits,out);
+ sdl_serialize_resriction_int(type->restrictions->length,out);
+ sdl_serialize_resriction_int(type->restrictions->minLength,out);
+ sdl_serialize_resriction_int(type->restrictions->maxLength,out);
+ sdl_serialize_resriction_char(type->restrictions->whiteSpace,out);
+ sdl_serialize_resriction_char(type->restrictions->pattern,out);
+ if (type->restrictions->enumeration) {
+ i = zend_hash_num_elements(type->restrictions->enumeration);
+ } else {
+ i = 0;
+ }
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ sdlRestrictionCharPtr *tmp;
+
+ zend_hash_internal_pointer_reset(type->restrictions->enumeration);
+ while (zend_hash_get_current_data(type->restrictions->enumeration, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_resriction_char(*tmp, out);
+ sdl_serialize_key(type->restrictions->enumeration, out);
+ zend_hash_move_forward(type->restrictions->enumeration);
+ }
+ }
+ } else {
+ WSDL_CACHE_PUT_1(0, out);
+ }
+ if (type->elements) {
+ i = zend_hash_num_elements(type->elements);
+ } else {
+ i = 0;
+ }
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ sdlTypePtr *tmp;
+
+ tmp_elements = emalloc(sizeof(HashTable));
+ zend_hash_init(tmp_elements, i, NULL, NULL, 0);
+
+ zend_hash_internal_pointer_reset(type->elements);
+ while (zend_hash_get_current_data(type->elements, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_key(type->elements, out);
+ sdl_serialize_type(*tmp, tmp_encoders, tmp_types, out);
+ zend_hash_add(tmp_elements, (char*)tmp, sizeof(*tmp), &i, sizeof(int), NULL);
+ i--;
+ zend_hash_move_forward(type->elements);
+ }
+ }
+
+ if (type->attributes) {
+ i = zend_hash_num_elements(type->attributes);
+ } else {
+ i = 0;
+ }
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ sdlAttributePtr *tmp;
+ zend_hash_internal_pointer_reset(type->attributes);
+ while (zend_hash_get_current_data(type->attributes, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_key(type->attributes, out);
+ sdl_serialize_attribute(*tmp, tmp_encoders, out);
+ zend_hash_move_forward(type->attributes);
+ }
+ }
+ if (type->model) {
+ WSDL_CACHE_PUT_1(1, out);
+ sdl_serialize_model(type->model, tmp_types, tmp_elements, out);
+ } else {
+ WSDL_CACHE_PUT_1(0, out);
+ }
+ if (tmp_elements != NULL) {
+ zend_hash_destroy(tmp_elements);
+ efree(tmp_elements);
+ }
+}
+
+static void sdl_serialize_encoder(encodePtr enc, HashTable *tmp_types, smart_str *out)
+{
+ WSDL_CACHE_PUT_INT(enc->details.type, out);
+ sdl_serialize_string(enc->details.type_str, out);
+ sdl_serialize_string(enc->details.ns, out);
+ sdl_serialize_type_ref(enc->details.sdl_type, tmp_types, out);
+}
+
+static void sdl_serialize_parameters(HashTable *ht, HashTable *tmp_encoders, HashTable *tmp_types, smart_str *out)
+{
+ int i;
+
+ if (ht) {
+ i = zend_hash_num_elements(ht);
+ } else {
+ i = 0;
+ }
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ sdlParamPtr *tmp;
+
+ zend_hash_internal_pointer_reset(ht);
+ while (zend_hash_get_current_data(ht, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_key(ht, out);
+ sdl_serialize_string((*tmp)->paramName, out);
+ WSDL_CACHE_PUT_INT((*tmp)->order, out);
+ sdl_serialize_encoder_ref((*tmp)->encode, tmp_encoders, out);
+ sdl_serialize_type_ref((*tmp)->element, tmp_types, out);
+ zend_hash_move_forward(ht);
+ }
+ }
+}
+
+static void sdl_serialize_soap_body(sdlSoapBindingFunctionBodyPtr body, HashTable *tmp_encoders, HashTable *tmp_types, smart_str *out)
+{
+ int i, j;
+
+ WSDL_CACHE_PUT_1(body->use, out);
+ if (body->use == SOAP_ENCODED) {
+ WSDL_CACHE_PUT_1(body->encodingStyle, out);
+ }
+ sdl_serialize_string(body->ns, out);
+ if (body->headers) {
+ i = zend_hash_num_elements(body->headers);
+ } else {
+ i = 0;
+ }
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ sdlSoapBindingFunctionHeaderPtr *tmp;
+ zend_hash_internal_pointer_reset(body->headers);
+ while (zend_hash_get_current_data(body->headers, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_key(body->headers, out);
+ WSDL_CACHE_PUT_1((*tmp)->use, out);
+ if ((*tmp)->use == SOAP_ENCODED) {
+ WSDL_CACHE_PUT_1((*tmp)->encodingStyle, out);
+ }
+ sdl_serialize_string((*tmp)->name, out);
+ sdl_serialize_string((*tmp)->ns, out);
+ sdl_serialize_encoder_ref((*tmp)->encode, tmp_encoders, out);
+ sdl_serialize_type_ref((*tmp)->element, tmp_types, out);
+ if ((*tmp)->headerfaults) {
+ j = zend_hash_num_elements((*tmp)->headerfaults);
+ } else {
+ j = 0;
+ }
+ WSDL_CACHE_PUT_INT(j, out);
+ if (j > 0) {
+ sdlSoapBindingFunctionHeaderPtr *tmp2;
+ zend_hash_internal_pointer_reset((*tmp)->headerfaults);
+ while (zend_hash_get_current_data((*tmp)->headerfaults, (void**)&tmp2) == SUCCESS) {
+ sdl_serialize_key((*tmp)->headerfaults, out);
+ WSDL_CACHE_PUT_1((*tmp2)->use, out);
+ if ((*tmp2)->use == SOAP_ENCODED) {
+ WSDL_CACHE_PUT_1((*tmp2)->encodingStyle, out);
+ }
+ sdl_serialize_string((*tmp2)->name, out);
+ sdl_serialize_string((*tmp2)->ns, out);
+ sdl_serialize_encoder_ref((*tmp2)->encode, tmp_encoders, out);
+ sdl_serialize_type_ref((*tmp2)->element, tmp_types, out);
+ zend_hash_move_forward((*tmp)->headerfaults);
+ }
+ }
+ zend_hash_move_forward(body->headers);
+ }
+ }
+}
+
+static void add_sdl_to_cache(const char *fn, const char *uri, time_t t, sdlPtr sdl TSRMLS_DC)
+{
+ smart_str buf = {0};
+ smart_str *out = &buf;
+ int i;
+ int type_num = 1;
+ int encoder_num = 1;
+ int f;
+ encodePtr enc;
+ HashTable tmp_types;
+ HashTable tmp_encoders;
+ HashTable tmp_bindings;
+ HashTable tmp_functions;
+
+#ifdef ZEND_WIN32
+ f = open(fn,O_CREAT|O_WRONLY|O_EXCL|O_BINARY,S_IREAD|S_IWRITE);
+#else
+ f = open(fn,O_CREAT|O_WRONLY|O_EXCL|O_BINARY,S_IREAD|S_IWRITE);
+#endif
+ if (f < 0) {return;}
+
+ zend_hash_init(&tmp_types, 0, NULL, NULL, 0);
+ zend_hash_init(&tmp_encoders, 0, NULL, NULL, 0);
+ zend_hash_init(&tmp_bindings, 0, NULL, NULL, 0);
+ zend_hash_init(&tmp_functions, 0, NULL, NULL, 0);
+
+ WSDL_CACHE_PUT_N("wsdl", 4, out);
+ WSDL_CACHE_PUT_1(WSDL_CACHE_VERSION,out);
+ WSDL_CACHE_PUT_1(0,out);
+ WSDL_CACHE_PUT_N(&t, sizeof(t), out);
+
+ sdl_serialize_string(uri, out);
+ sdl_serialize_string(sdl->source, out);
+ sdl_serialize_string(sdl->target_ns, out);
+
+ if (sdl->groups) {
+ i = zend_hash_num_elements(sdl->groups);
+ } else {
+ i = 0;
+ }
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ sdlTypePtr *tmp;
+
+ zend_hash_internal_pointer_reset(sdl->groups);
+ while (zend_hash_get_current_data(sdl->groups, (void**)&tmp) == SUCCESS) {
+ zend_hash_add(&tmp_types, (char*)tmp, sizeof(*tmp), (void**)&type_num, sizeof(type_num), NULL);
+ ++type_num;
+ zend_hash_move_forward(sdl->groups);
+ }
+ }
+
+ if (sdl->types) {
+ i = zend_hash_num_elements(sdl->types);
+ } else {
+ i = 0;
+ }
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ sdlTypePtr *tmp;
+
+ zend_hash_internal_pointer_reset(sdl->types);
+ while (zend_hash_get_current_data(sdl->types, (void**)&tmp) == SUCCESS) {
+ zend_hash_add(&tmp_types, (char*)tmp, sizeof(*tmp), (void**)&type_num, sizeof(type_num), NULL);
+ ++type_num;
+ zend_hash_move_forward(sdl->types);
+ }
+ }
+
+ if (sdl->elements) {
+ i = zend_hash_num_elements(sdl->elements);
+ } else {
+ i = 0;
+ }
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ sdlTypePtr *tmp;
+
+ zend_hash_internal_pointer_reset(sdl->elements);
+ while (zend_hash_get_current_data(sdl->elements, (void**)&tmp) == SUCCESS) {
+ zend_hash_add(&tmp_types, (char*)tmp, sizeof(*tmp), (void**)&type_num, sizeof(type_num), NULL);
+ ++type_num;
+ zend_hash_move_forward(sdl->elements);
+ }
+ }
+
+ if (sdl->encoders) {
+ i = zend_hash_num_elements(sdl->encoders);
+ } else {
+ i = 0;
+ }
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ encodePtr *tmp;
+
+ zend_hash_internal_pointer_reset(sdl->encoders);
+ while (zend_hash_get_current_data(sdl->encoders, (void**)&tmp) == SUCCESS) {
+ zend_hash_add(&tmp_encoders, (char*)tmp, sizeof(*tmp), (void**)&encoder_num, sizeof(encoder_num), NULL);
+ ++encoder_num;
+ zend_hash_move_forward(sdl->encoders);
+ }
+ }
+ enc = defaultEncoding;
+ while (enc->details.type != END_KNOWN_TYPES) {
+ zend_hash_add(&tmp_encoders, (char*)&enc, sizeof(encodePtr), (void**)&encoder_num, sizeof(encoder_num), NULL);
+ enc++;
+ ++encoder_num;
+ }
+
+ if (sdl->groups) {
+ sdlTypePtr *tmp;
+ zend_hash_internal_pointer_reset(sdl->groups);
+ while (zend_hash_get_current_data(sdl->groups, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_key(sdl->groups, out);
+ sdl_serialize_type(*tmp, &tmp_encoders, &tmp_types, out);
+ zend_hash_move_forward(sdl->groups);
+ }
+ }
+
+ if (sdl->types) {
+ sdlTypePtr *tmp;
+ zend_hash_internal_pointer_reset(sdl->types);
+ while (zend_hash_get_current_data(sdl->types, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_key(sdl->types, out);
+ sdl_serialize_type(*tmp, &tmp_encoders, &tmp_types, out);
+ zend_hash_move_forward(sdl->types);
+ }
+ }
+
+ if (sdl->elements) {
+ sdlTypePtr *tmp;
+ zend_hash_internal_pointer_reset(sdl->elements);
+ while (zend_hash_get_current_data(sdl->elements, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_key(sdl->elements, out);
+ sdl_serialize_type(*tmp, &tmp_encoders, &tmp_types, out);
+ zend_hash_move_forward(sdl->elements);
+ }
+ }
+
+ if (sdl->encoders) {
+ encodePtr *tmp;
+ zend_hash_internal_pointer_reset(sdl->encoders);
+ while (zend_hash_get_current_data(sdl->encoders, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_key(sdl->encoders, out);
+ sdl_serialize_encoder(*tmp, &tmp_types, out);
+ zend_hash_move_forward(sdl->encoders);
+ }
+ }
+
+ /* serialize bindings */
+ if (sdl->bindings) {
+ i = zend_hash_num_elements(sdl->bindings);
+ } else {
+ i = 0;
+ }
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ sdlBindingPtr *tmp;
+ int binding_num = 1;
+
+ zend_hash_internal_pointer_reset(sdl->bindings);
+ while (zend_hash_get_current_data(sdl->bindings, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_key(sdl->bindings, out);
+ sdl_serialize_string((*tmp)->name, out);
+ sdl_serialize_string((*tmp)->location, out);
+ WSDL_CACHE_PUT_1((*tmp)->bindingType,out);
+ if ((*tmp)->bindingType == BINDING_SOAP && (*tmp)->bindingAttributes != NULL) {
+ sdlSoapBindingPtr binding = (sdlSoapBindingPtr)(*tmp)->bindingAttributes;
+ WSDL_CACHE_PUT_1(binding->style, out);
+ WSDL_CACHE_PUT_1(binding->transport, out);
+ } else {
+ WSDL_CACHE_PUT_1(0,out);
+ }
+
+ zend_hash_add(&tmp_bindings, (char*)tmp, sizeof(*tmp), (void**)&binding_num, sizeof(binding_num), NULL);
+ binding_num++;
+ zend_hash_move_forward(sdl->bindings);
+ }
+ }
+
+ /* serialize functions */
+ i = zend_hash_num_elements(&sdl->functions);
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ sdlFunctionPtr *tmp;
+ int *binding_num;
+ int function_num = 1;
+
+ zend_hash_internal_pointer_reset(&sdl->functions);
+ while (zend_hash_get_current_data(&sdl->functions, (void**)&tmp) == SUCCESS) {
+ sdl_serialize_key(&sdl->functions, out);
+ sdl_serialize_string((*tmp)->functionName, out);
+ sdl_serialize_string((*tmp)->requestName, out);
+ sdl_serialize_string((*tmp)->responseName, out);
+
+ if ((*tmp)->binding == NULL ||
+ zend_hash_find(&tmp_bindings,(char*)&(*tmp)->binding,sizeof((*tmp)->binding), (void**)&binding_num) != SUCCESS) {
+ }
+ WSDL_CACHE_PUT_INT(*binding_num, out);
+ if (*binding_num >= 0) {
+ if ((*tmp)->binding->bindingType == BINDING_SOAP && (*tmp)->bindingAttributes != NULL) {
+ sdlSoapBindingFunctionPtr binding = (sdlSoapBindingFunctionPtr)(*tmp)->bindingAttributes;
+ WSDL_CACHE_PUT_1(binding->style, out);
+ sdl_serialize_string(binding->soapAction, out);
+ sdl_serialize_soap_body(&binding->input, &tmp_encoders, &tmp_types, out);
+ sdl_serialize_soap_body(&binding->output, &tmp_encoders, &tmp_types, out);
+ } else {
+ WSDL_CACHE_PUT_1(0,out);
+ }
+ }
+ sdl_serialize_parameters((*tmp)->requestParameters, &tmp_encoders, &tmp_types, out);
+ sdl_serialize_parameters((*tmp)->responseParameters, &tmp_encoders, &tmp_types, out);
+
+ if ((*tmp)->faults) {
+ sdlFaultPtr *fault;
+
+ WSDL_CACHE_PUT_INT(zend_hash_num_elements((*tmp)->faults), out);
+
+ zend_hash_internal_pointer_reset((*tmp)->faults);
+ while (zend_hash_get_current_data((*tmp)->faults, (void**)&fault) == SUCCESS) {
+ sdl_serialize_key((*tmp)->faults, out);
+ sdl_serialize_string((*fault)->name, out);
+ sdl_serialize_parameters((*fault)->details, &tmp_encoders, &tmp_types, out);
+ if ((*tmp)->binding->bindingType == BINDING_SOAP && (*fault)->bindingAttributes != NULL) {
+ sdlSoapBindingFunctionFaultPtr binding = (sdlSoapBindingFunctionFaultPtr)(*fault)->bindingAttributes;
+ WSDL_CACHE_PUT_1(binding->use, out);
+ if (binding->use == SOAP_ENCODED) {
+ WSDL_CACHE_PUT_1(binding->encodingStyle, out);
+ }
+ sdl_serialize_string(binding->ns, out);
+ } else {
+ WSDL_CACHE_PUT_1(0, out);
+ }
+ zend_hash_move_forward((*tmp)->faults);
+ }
+ } else {
+ WSDL_CACHE_PUT_INT(0, out);
+ }
+
+ zend_hash_add(&tmp_functions, (char*)tmp, sizeof(*tmp), (void**)&function_num, sizeof(function_num), NULL);
+ function_num++;
+ zend_hash_move_forward(&sdl->functions);
+ }
+ }
+
+ /* serialize requests */
+ if (sdl->requests) {
+ i = zend_hash_num_elements(sdl->requests);
+ } else {
+ i = 0;
+ }
+ WSDL_CACHE_PUT_INT(i, out);
+ if (i > 0) {
+ sdlFunctionPtr *tmp;
+ int *function_num;
+
+ zend_hash_internal_pointer_reset(sdl->requests);
+ while (zend_hash_get_current_data(sdl->requests, (void**)&tmp) == SUCCESS) {
+ if (zend_hash_find(&tmp_functions, (char*)tmp, sizeof(*tmp), (void**)&function_num) != SUCCESS) {
+ }
+ WSDL_CACHE_PUT_INT(*function_num, out);
+ sdl_serialize_key(sdl->requests, out);
+ zend_hash_move_forward(sdl->requests);
+ }
+ }
+
+ php_ignore_value(write(f, buf.c, buf.len));
+ close(f);
+ smart_str_free(&buf);
+ zend_hash_destroy(&tmp_functions);
+ zend_hash_destroy(&tmp_bindings);
+ zend_hash_destroy(&tmp_encoders);
+ zend_hash_destroy(&tmp_types);
+}
+
+
+static void make_persistent_restriction_int(void *data)
+{
+ sdlRestrictionIntPtr *rest = (sdlRestrictionIntPtr *)data;
+ sdlRestrictionIntPtr prest = NULL;
+
+ prest = malloc(sizeof(sdlRestrictionInt));
+ *prest = **rest;
+ *rest = prest;
+}
+
+
+static void make_persistent_restriction_char(void *data)
+{
+ sdlRestrictionCharPtr *rest = (sdlRestrictionCharPtr *)data;
+ sdlRestrictionCharPtr prest = NULL;
+
+ prest = malloc(sizeof(sdlRestrictionChar));
+ memset(prest, 0, sizeof(sdlRestrictionChar));
+ prest->value = strdup((*rest)->value);
+ prest->fixed = (*rest)->fixed;
+ *rest = prest;
+}
+
+
+static void make_persistent_sdl_type_ref(sdlTypePtr *type, HashTable *ptr_map, HashTable *bp_types)
+{
+ sdlTypePtr *tmp;
+
+ if (zend_hash_find(ptr_map, (char *)type, sizeof(sdlTypePtr), (void**)&tmp) == SUCCESS) {
+ *type = *tmp;
+ } else {
+ zend_hash_next_index_insert(bp_types, (void*)&type, sizeof(sdlTypePtr*), NULL);
+ }
+}
+
+
+static void make_persistent_sdl_encoder_ref(encodePtr *enc, HashTable *ptr_map, HashTable *bp_encoders)
+{
+ encodePtr *tmp;
+
+ /* do not process defaultEncoding's here */
+ if ((*enc) >= defaultEncoding && (*enc) < defaultEncoding + numDefaultEncodings) {
+ return;
+ }
+
+ if (zend_hash_find(ptr_map, (char *)enc, sizeof(encodePtr), (void**)&tmp) == SUCCESS) {
+ *enc = *tmp;
+ } else {
+ zend_hash_next_index_insert(bp_encoders, (void*)&enc, sizeof(encodePtr*), NULL);
+ }
+}
+
+
+static HashTable* make_persistent_sdl_function_headers(HashTable *headers, HashTable *ptr_map)
+{
+ HashTable *pheaders;
+ sdlSoapBindingFunctionHeaderPtr *tmp, pheader;
+ encodePtr *penc;
+ sdlTypePtr *ptype;
+ ulong index;
+ char *key;
+ uint key_len;
+
+ pheaders = malloc(sizeof(HashTable));
+ zend_hash_init(pheaders, zend_hash_num_elements(headers), NULL, delete_header_persistent, 1);
+
+ zend_hash_internal_pointer_reset(headers);
+ while (zend_hash_get_current_data(headers, (void**)&tmp) == SUCCESS) {
+ pheader = malloc(sizeof(sdlSoapBindingFunctionHeader));
+ memset(pheader, 0, sizeof(sdlSoapBindingFunctionHeader));
+ *pheader = **tmp;
+
+ if (pheader->name) {
+ pheader->name = strdup(pheader->name);
+ }
+ if (pheader->ns) {
+ pheader->ns = strdup(pheader->ns);
+ }
+
+ if (pheader->encode->details.sdl_type) {
+ if (zend_hash_find(ptr_map, (char*)&pheader->encode, sizeof(encodePtr), (void**)&penc) == FAILURE) {
+ assert(0);
+ }
+ pheader->encode = *penc;
+ }
+ if (pheader->element) {
+ if (zend_hash_find(ptr_map, (char*)&pheader->element, sizeof(sdlTypePtr), (void**)&ptype) == FAILURE) {
+ assert(0);
+ }
+ pheader->element = *ptype;
+ }
+
+ if (pheader->headerfaults) {
+ pheader->headerfaults = make_persistent_sdl_function_headers(pheader->headerfaults, ptr_map);
+ }
+
+ if (zend_hash_get_current_key_ex(headers, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(pheaders, key, key_len, (void*)&pheader, sizeof(sdlSoapBindingFunctionHeaderPtr), NULL);
+ } else {
+ zend_hash_next_index_insert(pheaders, (void*)&pheader, sizeof(sdlSoapBindingFunctionHeaderPtr), NULL);
+ }
+
+ zend_hash_move_forward(headers);
+ }
+
+ return pheaders;
+}
+
+
+static void make_persistent_sdl_soap_body(sdlSoapBindingFunctionBodyPtr body, HashTable *ptr_map)
+{
+ if (body->ns) {
+ body->ns = strdup(body->ns);
+ }
+
+ if (body->headers) {
+ body->headers = make_persistent_sdl_function_headers(body->headers, ptr_map);
+ }
+}
+
+
+static HashTable* make_persistent_sdl_parameters(HashTable *params, HashTable *ptr_map)
+{
+ HashTable *pparams;
+ sdlParamPtr *tmp, pparam;
+ sdlTypePtr *ptype;
+ encodePtr *penc;
+ ulong index;
+ char *key;
+ uint key_len;
+
+ pparams = malloc(sizeof(HashTable));
+ zend_hash_init(pparams, zend_hash_num_elements(params), NULL, delete_parameter_persistent, 1);
+
+ zend_hash_internal_pointer_reset(params);
+ while (zend_hash_get_current_data(params, (void**)&tmp) == SUCCESS) {
+ pparam = malloc(sizeof(sdlParam));
+ memset(pparam, 0, sizeof(sdlParam));
+ *pparam = **tmp;
+
+ if (pparam->paramName) {
+ pparam->paramName = strdup(pparam->paramName);
+ }
+
+ if (pparam->encode && pparam->encode->details.sdl_type) {
+ if (zend_hash_find(ptr_map, (char*)&pparam->encode, sizeof(encodePtr), (void**)&penc) == FAILURE) {
+ assert(0);
+ }
+ pparam->encode = *penc;
+ }
+ if (pparam->element) {
+ if (zend_hash_find(ptr_map, (char*)&pparam->element, sizeof(sdlTypePtr), (void**)&ptype) == FAILURE) {
+ assert(0);
+ }
+ pparam->element = *ptype;
+ }
+
+ if (zend_hash_get_current_key_ex(params, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(pparams, key, key_len, (void*)&pparam, sizeof(sdlParamPtr), NULL);
+ } else {
+ zend_hash_next_index_insert(pparams, (void*)&pparam, sizeof(sdlParamPtr), NULL);
+ }
+
+ zend_hash_move_forward(params);
+ }
+
+
+ return pparams;
+}
+
+static HashTable* make_persistent_sdl_function_faults(sdlFunctionPtr func, HashTable *faults, HashTable *ptr_map)
+{
+ HashTable *pfaults;
+ sdlFaultPtr *tmp, pfault;
+ ulong index;
+ char *key;
+ uint key_len;
+
+ pfaults = malloc(sizeof(HashTable));
+ zend_hash_init(pfaults, zend_hash_num_elements(faults), NULL, delete_fault_persistent, 1);
+
+ zend_hash_internal_pointer_reset(faults);
+ while (zend_hash_get_current_data(faults, (void**)&tmp) == SUCCESS) {
+ pfault = malloc(sizeof(sdlFault));
+ memset(pfault, 0, sizeof(sdlFault));
+ *pfault = **tmp;
+
+ if (pfault->name) {
+ pfault->name = strdup(pfault->name);
+ }
+ if (pfault->details) {
+ pfault->details = make_persistent_sdl_parameters(pfault->details, ptr_map);
+ }
+
+ if (func->binding->bindingType == BINDING_SOAP && pfault->bindingAttributes) {
+ sdlSoapBindingFunctionFaultPtr soap_binding;
+
+ soap_binding = malloc(sizeof(sdlSoapBindingFunctionFault));
+ memset(soap_binding, 0, sizeof(sdlSoapBindingFunctionFault));
+ *soap_binding = *(sdlSoapBindingFunctionFaultPtr)pfault->bindingAttributes;
+ if (soap_binding->ns) {
+ soap_binding->ns = strdup(soap_binding->ns);
+ }
+ pfault->bindingAttributes = soap_binding;
+ }
+
+ if (zend_hash_get_current_key_ex(faults, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(pfaults, key, key_len, (void*)&pfault, sizeof(sdlParamPtr), NULL);
+ } else {
+ zend_hash_next_index_insert(pfaults, (void*)&pfault, sizeof(sdlParamPtr), NULL);
+ }
+
+ zend_hash_move_forward(faults);
+ }
+
+
+ return pfaults;
+}
+
+
+static sdlAttributePtr make_persistent_sdl_attribute(sdlAttributePtr attr, HashTable *ptr_map, HashTable *bp_types, HashTable *bp_encoders)
+{
+ sdlAttributePtr pattr;
+ ulong index;
+ char *key;
+ uint key_len;
+
+ pattr = malloc(sizeof(sdlAttribute));
+ memset(pattr, 0, sizeof(sdlAttribute));
+
+ *pattr = *attr;
+
+ if (pattr->name) {
+ pattr->name = strdup(pattr->name);
+ }
+ if (pattr->namens) {
+ pattr->namens = strdup(pattr->namens);
+ }
+ if (pattr->ref) {
+ pattr->ref = strdup(pattr->ref);
+ }
+ if (pattr->def) {
+ pattr->def = strdup(pattr->def);
+ }
+ if (pattr->fixed) {
+ pattr->fixed = strdup(pattr->fixed);
+ }
+
+ /* we do not want to process defaultEncoding's here */
+ if (pattr->encode) {
+ make_persistent_sdl_encoder_ref(&pattr->encode, ptr_map, bp_encoders);
+ }
+
+ if (pattr->extraAttributes) {
+ sdlExtraAttributePtr *tmp, pextra;
+
+ pattr->extraAttributes = malloc(sizeof(HashTable));
+ zend_hash_init(pattr->extraAttributes, zend_hash_num_elements(attr->extraAttributes), NULL, delete_extra_attribute_persistent, 1);
+
+ zend_hash_internal_pointer_reset(pattr->extraAttributes);
+ while (zend_hash_get_current_data(attr->extraAttributes, (void**)&tmp) == SUCCESS) {
+ pextra = malloc(sizeof(sdlExtraAttribute));
+ memset(pextra, 0, sizeof(sdlExtraAttribute));
+ if ((*tmp)->ns) {
+ pextra->ns = strdup((*tmp)->ns);
+ }
+ if ((*tmp)->val) {
+ pextra->val = strdup((*tmp)->val);
+ }
+
+ if (zend_hash_get_current_key_ex(attr->extraAttributes, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(pattr->extraAttributes, key, key_len, (void*)&pextra, sizeof(sdlExtraAttributePtr), NULL);
+ }
+
+ zend_hash_move_forward(attr->extraAttributes);
+ }
+ }
+
+ return pattr;
+}
+
+
+static sdlContentModelPtr make_persistent_sdl_model(sdlContentModelPtr model, HashTable *ptr_map, HashTable *bp_types, HashTable *bp_encoders)
+{
+ sdlContentModelPtr pmodel;
+ sdlContentModelPtr *tmp, pcontent;
+
+ pmodel = malloc(sizeof(sdlContentModel));
+ memset(pmodel, 0, sizeof(sdlContentModel));
+ *pmodel = *model;
+
+ switch (pmodel->kind) {
+ case XSD_CONTENT_ELEMENT:
+ if (pmodel->u.element) {
+ make_persistent_sdl_type_ref(&pmodel->u.element, ptr_map, bp_types);
+ }
+ break;
+
+ case XSD_CONTENT_SEQUENCE:
+ case XSD_CONTENT_ALL:
+ case XSD_CONTENT_CHOICE:
+ pmodel->u.content = malloc(sizeof(HashTable));
+ zend_hash_init(pmodel->u.content, zend_hash_num_elements(model->u.content), NULL, delete_model_persistent, 1);
+
+ zend_hash_internal_pointer_reset(model->u.content);
+ while (zend_hash_get_current_data(model->u.content, (void**)&tmp) == SUCCESS) {
+ pcontent = make_persistent_sdl_model(*tmp, ptr_map, bp_types, bp_encoders);
+ zend_hash_next_index_insert(pmodel->u.content, (void*)&pcontent, sizeof(sdlContentModelPtr), NULL);
+ zend_hash_move_forward(model->u.content);
+ }
+ break;
+
+ case XSD_CONTENT_GROUP_REF:
+ if (pmodel->u.group_ref) {
+ pmodel->u.group_ref = strdup(pmodel->u.group_ref);
+ }
+ break;
+
+ case XSD_CONTENT_GROUP:
+ if (pmodel->u.group) {
+ make_persistent_sdl_type_ref(&pmodel->u.group, ptr_map, bp_types);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return pmodel;
+}
+
+
+static sdlTypePtr make_persistent_sdl_type(sdlTypePtr type, HashTable *ptr_map, HashTable *bp_types, HashTable *bp_encoders)
+{
+ ulong index;
+ char *key;
+ uint key_len;
+ sdlTypePtr ptype = NULL;
+
+ ptype = malloc(sizeof(sdlType));
+ memset(ptype, 0, sizeof(sdlType));
+
+ *ptype = *type;
+
+ if (ptype->name) {
+ ptype->name = strdup(ptype->name);
+ }
+ if (ptype->namens) {
+ ptype->namens = strdup(ptype->namens);
+ }
+ if (ptype->def) {
+ ptype->def = strdup(ptype->def);
+ }
+ if (ptype->fixed) {
+ ptype->fixed = strdup(ptype->fixed);
+ }
+ if (ptype->ref) {
+ ptype->ref = strdup(ptype->ref);
+ }
+
+ /* we do not want to process defaultEncoding's here */
+ if (ptype->encode) {
+ make_persistent_sdl_encoder_ref(&ptype->encode, ptr_map, bp_encoders);
+ }
+
+ if (ptype->restrictions) {
+ ptype->restrictions = malloc(sizeof(sdlRestrictions));
+ memset(ptype->restrictions, 0, sizeof(sdlRestrictions));
+ *ptype->restrictions = *type->restrictions;
+
+ if (ptype->restrictions->minExclusive) {
+ make_persistent_restriction_int(&ptype->restrictions->minExclusive);
+ }
+ if (ptype->restrictions->maxExclusive) {
+ make_persistent_restriction_int(&ptype->restrictions->maxExclusive);
+ }
+ if (ptype->restrictions->minInclusive) {
+ make_persistent_restriction_int(&ptype->restrictions->minInclusive);
+ }
+ if (ptype->restrictions->maxInclusive) {
+ make_persistent_restriction_int(&ptype->restrictions->maxInclusive);
+ }
+ if (ptype->restrictions->totalDigits) {
+ make_persistent_restriction_int(&ptype->restrictions->totalDigits);
+ }
+ if (ptype->restrictions->fractionDigits) {
+ make_persistent_restriction_int(&ptype->restrictions->fractionDigits);
+ }
+ if (ptype->restrictions->length) {
+ make_persistent_restriction_int(&ptype->restrictions->length);
+ }
+ if (ptype->restrictions->minLength) {
+ make_persistent_restriction_int(&ptype->restrictions->minLength);
+ }
+ if (ptype->restrictions->maxLength) {
+ make_persistent_restriction_int(&ptype->restrictions->maxLength);
+ }
+ if (ptype->restrictions->whiteSpace) {
+ make_persistent_restriction_char(&ptype->restrictions->whiteSpace);
+ }
+ if (ptype->restrictions->pattern) {
+ make_persistent_restriction_char(&ptype->restrictions->pattern);
+ }
+
+ if (type->restrictions->enumeration) {
+ sdlRestrictionCharPtr tmp;
+
+ ptype->restrictions->enumeration = malloc(sizeof(HashTable));
+ zend_hash_init(ptype->restrictions->enumeration, zend_hash_num_elements(type->restrictions->enumeration), NULL, delete_restriction_var_char_persistent, 1);
+ zend_hash_copy(ptype->restrictions->enumeration, type->restrictions->enumeration, make_persistent_restriction_char, (void*)&tmp, sizeof(sdlRestrictionCharPtr));
+ }
+ }
+
+ if (ptype->elements) {
+ sdlTypePtr *tmp, pelem;
+
+ ptype->elements = malloc(sizeof(HashTable));
+ zend_hash_init(ptype->elements, zend_hash_num_elements(type->elements), NULL, delete_type_persistent, 1);
+
+ zend_hash_internal_pointer_reset(type->elements);
+ while (zend_hash_get_current_data(type->elements, (void **)&tmp) == SUCCESS) {
+ pelem = make_persistent_sdl_type(*tmp, ptr_map, bp_types, bp_encoders);
+ if (zend_hash_get_current_key_ex(type->elements, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(ptype->elements, key, key_len, (void*)&pelem, sizeof(sdlTypePtr), NULL);
+ } else {
+ zend_hash_next_index_insert(ptype->elements, (void*)&pelem, sizeof(sdlTypePtr), NULL);
+ }
+ zend_hash_add(ptr_map, (char*)tmp, sizeof(*tmp), (void*)&pelem, sizeof(sdlTypePtr), NULL);
+ zend_hash_move_forward(type->elements);
+ }
+ }
+
+ if (ptype->attributes) {
+ sdlAttributePtr *tmp, pattr;
+
+ ptype->attributes = malloc(sizeof(HashTable));
+ zend_hash_init(ptype->attributes, zend_hash_num_elements(type->attributes), NULL, delete_attribute_persistent, 1);
+
+ zend_hash_internal_pointer_reset(type->attributes);
+ while (zend_hash_get_current_data(type->attributes, (void **)&tmp) == SUCCESS) {
+ pattr = make_persistent_sdl_attribute(*tmp, ptr_map, bp_types, bp_encoders);
+ if (zend_hash_get_current_key_ex(type->attributes, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(ptype->attributes, key, key_len, (void*)&pattr, sizeof(sdlAttributePtr), NULL);
+ } else {
+ zend_hash_next_index_insert(ptype->attributes, (void*)&pattr, sizeof(sdlAttributePtr), NULL);
+ }
+ zend_hash_move_forward(type->attributes);
+ }
+ }
+
+ if (type->model) {
+ ptype->model = make_persistent_sdl_model(ptype->model, ptr_map, bp_types, bp_encoders);
+ }
+
+ return ptype;
+}
+
+static encodePtr make_persistent_sdl_encoder(encodePtr enc, HashTable *ptr_map, HashTable *bp_types, HashTable *bp_encoders)
+{
+ encodePtr penc = NULL;
+
+ penc = malloc(sizeof(encode));
+ memset(penc, 0, sizeof(encode));
+
+ *penc = *enc;
+
+ if (penc->details.type_str) {
+ penc->details.type_str = strdup(penc->details.type_str);
+ }
+ if (penc->details.ns) {
+ penc->details.ns = strdup(penc->details.ns);
+ }
+
+ if (penc->details.sdl_type) {
+ make_persistent_sdl_type_ref(&penc->details.sdl_type, ptr_map, bp_types);
+ }
+
+ return penc;
+}
+
+static sdlBindingPtr make_persistent_sdl_binding(sdlBindingPtr bind, HashTable *ptr_map)
+{
+ sdlBindingPtr pbind = NULL;
+
+ pbind = malloc(sizeof(sdlBinding));
+ memset(pbind, 0, sizeof(sdlBinding));
+
+ *pbind = *bind;
+
+ if (pbind->name) {
+ pbind->name = strdup(pbind->name);
+ }
+ if (pbind->location) {
+ pbind->location = strdup(pbind->location);
+ }
+
+ if (pbind->bindingType == BINDING_SOAP && pbind->bindingAttributes) {
+ sdlSoapBindingPtr soap_binding;
+
+ soap_binding = malloc(sizeof(sdlSoapBinding));
+ memset(soap_binding, 0, sizeof(sdlSoapBinding));
+ *soap_binding = *(sdlSoapBindingPtr)pbind->bindingAttributes;
+ pbind->bindingAttributes = soap_binding;
+ }
+
+ return pbind;
+}
+
+static sdlFunctionPtr make_persistent_sdl_function(sdlFunctionPtr func, HashTable *ptr_map)
+{
+ sdlFunctionPtr pfunc = NULL;
+
+ pfunc = malloc(sizeof(sdlFunction));
+ memset(pfunc, 0, sizeof(sdlFunction));
+
+ *pfunc = *func;
+
+ if (pfunc->functionName) {
+ pfunc->functionName = strdup(pfunc->functionName);
+ }
+ if (pfunc->requestName) {
+ pfunc->requestName = strdup(pfunc->requestName);
+ }
+ if (pfunc->responseName) {
+ pfunc->responseName = strdup(pfunc->responseName);
+ }
+
+ if (pfunc->binding) {
+ sdlBindingPtr *tmp;
+
+ if (zend_hash_find(ptr_map, (char*)&pfunc->binding, sizeof(pfunc->binding), (void**)&tmp) == FAILURE) {
+ assert(0);
+ }
+ pfunc->binding = *tmp;
+
+ if (pfunc->binding->bindingType == BINDING_SOAP && pfunc->bindingAttributes) {
+ sdlSoapBindingFunctionPtr soap_binding;
+
+ soap_binding = malloc(sizeof(sdlSoapBindingFunction));
+ memset(soap_binding, 0, sizeof(sdlSoapBindingFunction));
+ *soap_binding = *(sdlSoapBindingFunctionPtr)pfunc->bindingAttributes;
+ if (soap_binding->soapAction) {
+ soap_binding->soapAction = strdup(soap_binding->soapAction);
+ }
+ make_persistent_sdl_soap_body(&soap_binding->input, ptr_map);
+ make_persistent_sdl_soap_body(&soap_binding->output, ptr_map);
+ pfunc->bindingAttributes = soap_binding;
+ }
+
+ if (pfunc->requestParameters) {
+ pfunc->requestParameters = make_persistent_sdl_parameters(pfunc->requestParameters, ptr_map);
+ }
+ if (pfunc->responseParameters) {
+ pfunc->responseParameters = make_persistent_sdl_parameters(pfunc->responseParameters, ptr_map);
+ }
+ if (pfunc->faults) {
+ pfunc->faults = make_persistent_sdl_function_faults(pfunc, pfunc->faults, ptr_map);
+ }
+ }
+
+ return pfunc;
+}
+
+static sdlPtr make_persistent_sdl(sdlPtr sdl TSRMLS_DC)
+{
+ sdlPtr psdl = NULL;
+ HashTable ptr_map;
+ HashTable bp_types, bp_encoders;
+ ulong index;
+ char *key;
+ uint key_len;
+
+ zend_hash_init(&bp_types, 0, NULL, NULL, 0);
+ zend_hash_init(&bp_encoders, 0, NULL, NULL, 0);
+ zend_hash_init(&ptr_map, 0, NULL, NULL, 0);
+
+ psdl = malloc(sizeof(*sdl));
+ memset(psdl, 0, sizeof(*sdl));
+
+ if (sdl->source) {
+ psdl->source = strdup(sdl->source);
+ }
+ if (sdl->target_ns) {
+ psdl->target_ns = strdup(sdl->target_ns);
+ }
+
+ if (sdl->groups) {
+ sdlTypePtr *tmp;
+ sdlTypePtr ptype;
+
+ psdl->groups = malloc(sizeof(HashTable));
+ zend_hash_init(psdl->groups, zend_hash_num_elements(sdl->groups), NULL, delete_type_persistent, 1);
+
+ zend_hash_internal_pointer_reset(sdl->groups);
+ while (zend_hash_get_current_data(sdl->groups, (void **)&tmp) == SUCCESS) {
+ ptype = make_persistent_sdl_type(*tmp, &ptr_map, &bp_types, &bp_encoders);
+ if (zend_hash_get_current_key_ex(sdl->groups, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(psdl->groups, key, key_len, (void*)&ptype, sizeof(sdlTypePtr), NULL);
+ } else {
+ zend_hash_next_index_insert(psdl->groups, (void*)&ptype, sizeof(sdlTypePtr), NULL);
+ }
+ zend_hash_add(&ptr_map, (char*)tmp, sizeof(*tmp), (void*)&ptype, sizeof(sdlTypePtr), NULL);
+ zend_hash_move_forward(sdl->groups);
+ }
+ }
+
+ if (sdl->types) {
+ sdlTypePtr *tmp;
+ sdlTypePtr ptype;
+
+ psdl->types = malloc(sizeof(HashTable));
+ zend_hash_init(psdl->types, zend_hash_num_elements(sdl->types), NULL, delete_type_persistent, 1);
+
+ zend_hash_internal_pointer_reset(sdl->types);
+ while (zend_hash_get_current_data(sdl->types, (void **)&tmp) == SUCCESS) {
+ ptype = make_persistent_sdl_type(*tmp, &ptr_map, &bp_types, &bp_encoders);
+ if (zend_hash_get_current_key_ex(sdl->types, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(psdl->types, key, key_len, (void*)&ptype, sizeof(sdlTypePtr), NULL);
+ } else {
+ zend_hash_next_index_insert(psdl->types, (void*)&ptype, sizeof(sdlTypePtr), NULL);
+ }
+ zend_hash_add(&ptr_map, (char*)tmp, sizeof(*tmp), (void*)&ptype, sizeof(sdlTypePtr), NULL);
+ zend_hash_move_forward(sdl->types);
+ }
+ }
+
+ if (sdl->elements) {
+ sdlTypePtr *tmp;
+ sdlTypePtr ptype;
+
+ psdl->elements = malloc(sizeof(HashTable));
+ zend_hash_init(psdl->elements, zend_hash_num_elements(sdl->elements), NULL, delete_type_persistent, 1);
+
+ zend_hash_internal_pointer_reset(sdl->elements);
+ while (zend_hash_get_current_data(sdl->elements, (void **)&tmp) == SUCCESS) {
+ ptype = make_persistent_sdl_type(*tmp, &ptr_map, &bp_types, &bp_encoders);
+ if (zend_hash_get_current_key_ex(sdl->elements, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(psdl->elements, key, key_len, (void*)&ptype, sizeof(sdlTypePtr), NULL);
+ } else {
+ zend_hash_next_index_insert(psdl->elements, (void*)&ptype, sizeof(sdlTypePtr), NULL);
+ }
+ zend_hash_add(&ptr_map, (char*)tmp, sizeof(*tmp), (void*)&ptype, sizeof(sdlTypePtr), NULL);
+ zend_hash_move_forward(sdl->elements);
+ }
+ }
+
+ if (sdl->encoders) {
+ encodePtr *tmp;
+ encodePtr penc;
+
+ psdl->encoders = malloc(sizeof(HashTable));
+ zend_hash_init(psdl->encoders, zend_hash_num_elements(sdl->encoders), NULL, delete_encoder_persistent, 1);
+
+ zend_hash_internal_pointer_reset(sdl->encoders);
+ while (zend_hash_get_current_data(sdl->encoders, (void **)&tmp) == SUCCESS) {
+ penc = make_persistent_sdl_encoder(*tmp, &ptr_map, &bp_types, &bp_encoders);
+ if (zend_hash_get_current_key_ex(sdl->encoders, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(psdl->encoders, key, key_len, (void*)&penc, sizeof(encodePtr), NULL);
+ } else {
+ zend_hash_next_index_insert(psdl->encoders, (void*)&penc, sizeof(encodePtr), NULL);
+ }
+ zend_hash_add(&ptr_map, (char*)tmp, sizeof(*tmp), (void*)&penc, sizeof(encodePtr), NULL);
+ zend_hash_move_forward(sdl->encoders);
+ }
+ }
+
+ /* do backpatching here */
+ if (zend_hash_num_elements(&bp_types)) {
+ sdlTypePtr **tmp, *ptype = NULL;
+
+ zend_hash_internal_pointer_reset(&bp_types);
+ while (zend_hash_get_current_data(&bp_types, (void**)&tmp) == SUCCESS) {
+ if (zend_hash_find(&ptr_map, (char*)(*tmp), sizeof(**tmp), (void**)&ptype) == FAILURE) {
+ assert(0);
+ }
+ **tmp = *ptype;
+ zend_hash_move_forward(&bp_types);
+ }
+ }
+ if (zend_hash_num_elements(&bp_encoders)) {
+ encodePtr **tmp, *penc = NULL;
+
+ zend_hash_internal_pointer_reset(&bp_encoders);
+ while (zend_hash_get_current_data(&bp_encoders, (void**)&tmp) == SUCCESS) {
+ if (zend_hash_find(&ptr_map, (char*)(*tmp), sizeof(**tmp), (void**)&penc) == FAILURE) {
+ assert(0);
+ }
+ **tmp = *penc;
+ zend_hash_move_forward(&bp_encoders);
+ }
+ }
+
+
+ if (sdl->bindings) {
+ sdlBindingPtr *tmp;
+ sdlBindingPtr pbind;
+
+ psdl->bindings = malloc(sizeof(HashTable));
+ zend_hash_init(psdl->bindings, zend_hash_num_elements(sdl->bindings), NULL, delete_binding_persistent, 1);
+
+ zend_hash_internal_pointer_reset(sdl->bindings);
+ while (zend_hash_get_current_data(sdl->bindings, (void **)&tmp) == SUCCESS) {
+ pbind = make_persistent_sdl_binding(*tmp, &ptr_map);
+ if (zend_hash_get_current_key_ex(sdl->bindings, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(psdl->bindings, key, key_len, (void*)&pbind, sizeof(sdlBindingPtr), NULL);
+ } else {
+ zend_hash_next_index_insert(psdl->bindings, (void*)&pbind, sizeof(sdlBindingPtr), NULL);
+ }
+ zend_hash_add(&ptr_map, (char*)tmp, sizeof(*tmp), (void*)&pbind, sizeof(sdlBindingPtr), NULL);
+ zend_hash_move_forward(sdl->bindings);
+ }
+ }
+
+ zend_hash_init(&psdl->functions, zend_hash_num_elements(&sdl->functions), NULL, delete_function_persistent, 1);
+ if (zend_hash_num_elements(&sdl->functions)) {
+ sdlFunctionPtr *tmp;
+ sdlFunctionPtr pfunc;
+
+ zend_hash_internal_pointer_reset(&sdl->functions);
+ while (zend_hash_get_current_data(&sdl->functions, (void **)&tmp) == SUCCESS) {
+ pfunc = make_persistent_sdl_function(*tmp, &ptr_map);
+ if (zend_hash_get_current_key_ex(&sdl->functions, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(&psdl->functions, key, key_len, (void*)&pfunc, sizeof(sdlFunctionPtr), NULL);
+ } else {
+ zend_hash_next_index_insert(&psdl->functions, (void*)&pfunc, sizeof(sdlFunctionPtr), NULL);
+ }
+ zend_hash_add(&ptr_map, (char*)tmp, sizeof(*tmp), (void*)&pfunc, sizeof(sdlFunctionPtr), NULL);
+ zend_hash_move_forward(&sdl->functions);
+ }
+ }
+
+ if (sdl->requests) {
+ sdlFunctionPtr *tmp;
+ sdlFunctionPtr *preq;
+
+ psdl->requests = malloc(sizeof(HashTable));
+ zend_hash_init(psdl->requests, zend_hash_num_elements(sdl->requests), NULL, NULL, 1);
+
+ zend_hash_internal_pointer_reset(sdl->requests);
+ while (zend_hash_get_current_data(sdl->requests, (void **)&tmp) == SUCCESS) {
+ if (zend_hash_find(&ptr_map, (char*)tmp, sizeof(*tmp), (void**)&preq) == FAILURE) {
+ assert(0);
+ }
+ *tmp = *preq;
+ if (zend_hash_get_current_key_ex(sdl->requests, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
+ zend_hash_add(psdl->requests, key, key_len, (void*)&preq, sizeof(sdlFunctionPtr), NULL);
+ }
+ zend_hash_move_forward(sdl->requests);
+ }
+ }
+
+ zend_hash_destroy(&ptr_map);
+ zend_hash_destroy(&bp_encoders);
+ zend_hash_destroy(&bp_types);
+
+ return psdl;
+}
+
+typedef struct _sdl_cache_bucket {
+ sdlPtr sdl;
+ time_t time;
+} sdl_cache_bucket;
+
+static void delete_psdl(void *data)
+{
+ sdl_cache_bucket *p = (sdl_cache_bucket*)data;
+ sdlPtr tmp = p->sdl;
+
+ zend_hash_destroy(&tmp->functions);
+ if (tmp->source) {
+ free(tmp->source);
+ }
+ if (tmp->target_ns) {
+ free(tmp->target_ns);
+ }
+ if (tmp->elements) {
+ zend_hash_destroy(tmp->elements);
+ free(tmp->elements);
+ }
+ if (tmp->encoders) {
+ zend_hash_destroy(tmp->encoders);
+ free(tmp->encoders);
+ }
+ if (tmp->types) {
+ zend_hash_destroy(tmp->types);
+ free(tmp->types);
+ }
+ if (tmp->groups) {
+ zend_hash_destroy(tmp->groups);
+ free(tmp->groups);
+ }
+ if (tmp->bindings) {
+ zend_hash_destroy(tmp->bindings);
+ free(tmp->bindings);
+ }
+ if (tmp->requests) {
+ zend_hash_destroy(tmp->requests);
+ free(tmp->requests);
+ }
+ free(tmp);
+}
+
+sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
+{
+ char fn[MAXPATHLEN];
+ sdlPtr sdl = NULL;
+ char* old_error_code = SOAP_GLOBAL(error_code);
+ int uri_len = 0;
+ php_stream_context *context=NULL;
+ zval **tmp, **proxy_host, **proxy_port, *orig_context = NULL, *new_context = NULL;
+ smart_str headers = {0};
+ char* key = NULL;
+ time_t t = time(0);
+ zend_bool has_proxy_authorization = 0;
+ zend_bool has_authorization = 0;
+
+ if (strchr(uri,':') != NULL || IS_ABSOLUTE_PATH(uri, uri_len)) {
+ uri_len = strlen(uri);
+ } else if (VCWD_REALPATH(uri, fn) == NULL) {
+ cache_wsdl = WSDL_CACHE_NONE;
+ } else {
+ uri = fn;
+ uri_len = strlen(uri);
+ }
+
+ if ((cache_wsdl & WSDL_CACHE_MEMORY) && SOAP_GLOBAL(mem_cache)) {
+ sdl_cache_bucket *p;
+
+ if (SUCCESS == zend_hash_find(SOAP_GLOBAL(mem_cache), uri, uri_len+1, (void*)&p)) {
+ if (p->time < t - SOAP_GLOBAL(cache_ttl)) {
+ /* in-memory cache entry is expired */
+ zend_hash_del(&EG(persistent_list), uri, uri_len+1);
+ } else {
+ return p->sdl;
+ }
+ }
+ }
+
+ if ((cache_wsdl & WSDL_CACHE_DISK) && (uri_len < MAXPATHLEN)) {
+ time_t t = time(0);
+ char md5str[33];
+ PHP_MD5_CTX context;
+ unsigned char digest[16];
+ int len = strlen(SOAP_GLOBAL(cache_dir));
+ time_t cached;
+ char *user = php_get_current_user(TSRMLS_C);
+ int user_len = user ? strlen(user) + 1 : 0;
+
+ md5str[0] = '\0';
+ PHP_MD5Init(&context);
+ PHP_MD5Update(&context, (unsigned char*)uri, uri_len);
+ PHP_MD5Final(digest, &context);
+ make_digest(md5str, digest);
+ key = emalloc(len+sizeof("/wsdl-")-1+user_len+sizeof(md5str));
+ memcpy(key,SOAP_GLOBAL(cache_dir),len);
+ memcpy(key+len,"/wsdl-",sizeof("/wsdl-")-1);
+ len += sizeof("/wsdl-")-1;
+ if (user_len) {
+ memcpy(key+len, user, user_len-1);
+ len += user_len-1;
+ key[len++] = '-';
+ }
+ memcpy(key+len,md5str,sizeof(md5str));
+
+ if ((sdl = get_sdl_from_cache(key, uri, t-SOAP_GLOBAL(cache_ttl), &cached TSRMLS_CC)) != NULL) {
+ t = cached;
+ efree(key);
+ goto cache_in_memory;
+ }
+ }
+
+ if (SUCCESS == zend_hash_find(Z_OBJPROP_P(this_ptr),
+ "_stream_context", sizeof("_stream_context"), (void**)&tmp)) {
+ context = php_stream_context_from_zval(*tmp, 0);
+ } else {
+ context = php_stream_context_alloc(TSRMLS_C);
+ }
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", sizeof("_user_agent"), (void **) &tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING && Z_STRLEN_PP(tmp) > 0) {
+ smart_str_appends(&headers, "User-Agent: ");
+ smart_str_appends(&headers, Z_STRVAL_PP(tmp));
+ smart_str_appends(&headers, "\r\n");
+ }
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_host", sizeof("_proxy_host"), (void **) &proxy_host) == SUCCESS &&
+ Z_TYPE_PP(proxy_host) == IS_STRING &&
+ zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_port", sizeof("_proxy_port"), (void **) &proxy_port) == SUCCESS &&
+ Z_TYPE_PP(proxy_port) == IS_LONG) {
+ zval str_port, *str_proxy;
+ smart_str proxy = {0};
+ str_port = **proxy_port;
+ zval_copy_ctor(&str_port);
+ convert_to_string(&str_port);
+ smart_str_appends(&proxy,"tcp://");
+ smart_str_appends(&proxy,Z_STRVAL_PP(proxy_host));
+ smart_str_appends(&proxy,":");
+ smart_str_appends(&proxy,Z_STRVAL(str_port));
+ smart_str_0(&proxy);
+ zval_dtor(&str_port);
+ MAKE_STD_ZVAL(str_proxy);
+ ZVAL_STRING(str_proxy, proxy.c, 1);
+ smart_str_free(&proxy);
+
+ if (!context) {
+ context = php_stream_context_alloc(TSRMLS_C);
+ }
+ php_stream_context_set_option(context, "http", "proxy", str_proxy);
+ zval_ptr_dtor(&str_proxy);
+
+ if (uri_len < sizeof("https://")-1 ||
+ strncasecmp(uri, "https://", sizeof("https://")-1) != 0) {
+ MAKE_STD_ZVAL(str_proxy);
+ ZVAL_BOOL(str_proxy, 1);
+ php_stream_context_set_option(context, "http", "request_fulluri", str_proxy);
+ zval_ptr_dtor(&str_proxy);
+ }
+
+ has_proxy_authorization = proxy_authentication(this_ptr, &headers TSRMLS_CC);
+ }
+
+ has_authorization = basic_authentication(this_ptr, &headers TSRMLS_CC);
+
+ /* Use HTTP/1.1 with "Connection: close" by default */
+ if (php_stream_context_get_option(context, "http", "protocol_version", &tmp) == FAILURE) {
+ zval *http_version;
+ MAKE_STD_ZVAL(http_version);
+ ZVAL_DOUBLE(http_version, 1.1);
+ php_stream_context_set_option(context, "http", "protocol_version", http_version);
+ zval_ptr_dtor(&http_version);
+ smart_str_appendl(&headers, "Connection: close\r\n", sizeof("Connection: close\r\n")-1);
+ }
+
+ if (headers.len > 0) {
+ zval *str_headers;
+
+ if (!context) {
+ context = php_stream_context_alloc(TSRMLS_C);
+ } else {
+ http_context_headers(context, has_authorization, has_proxy_authorization, 0, &headers TSRMLS_CC);
+ }
+
+ smart_str_0(&headers);
+ MAKE_STD_ZVAL(str_headers);
+ ZVAL_STRING(str_headers, headers.c, 1);
+ php_stream_context_set_option(context, "http", "header", str_headers);
+ smart_str_free(&headers);
+ zval_ptr_dtor(&str_headers);
+ }
+
+ if (context) {
+ MAKE_STD_ZVAL(new_context);
+ php_stream_context_to_zval(context, new_context);
+ orig_context = php_libxml_switch_context(new_context TSRMLS_CC);
+ }
+
+ SOAP_GLOBAL(error_code) = "WSDL";
+
+ sdl = load_wsdl(this_ptr, uri TSRMLS_CC);
+ if (sdl) {
+ sdl->is_persistent = 0;
+ }
+
+ SOAP_GLOBAL(error_code) = old_error_code;
+
+ if (context) {
+ php_libxml_switch_context(orig_context TSRMLS_CC);
+ zval_ptr_dtor(&new_context);
+ }
+
+ if ((cache_wsdl & WSDL_CACHE_DISK) && key) {
+ if (sdl) {
+ add_sdl_to_cache(key, uri, t, sdl TSRMLS_CC);
+ }
+ efree(key);
+ }
+
+cache_in_memory:
+ if (cache_wsdl & WSDL_CACHE_MEMORY) {
+ if (sdl) {
+ sdlPtr psdl;
+ sdl_cache_bucket p;
+
+ if (SOAP_GLOBAL(mem_cache) == NULL) {
+ SOAP_GLOBAL(mem_cache) = malloc(sizeof(HashTable));
+ zend_hash_init(SOAP_GLOBAL(mem_cache), 0, NULL, delete_psdl, 1);
+ } else if (SOAP_GLOBAL(cache_limit) > 0 &&
+ SOAP_GLOBAL(cache_limit) <= zend_hash_num_elements(SOAP_GLOBAL(mem_cache))) {
+ /* in-memory cache overflow */
+ sdl_cache_bucket *q;
+ HashPosition pos;
+ time_t latest = t;
+ char *key = NULL;
+ uint key_len;
+ ulong idx;
+
+ for (zend_hash_internal_pointer_reset_ex(SOAP_GLOBAL(mem_cache), &pos);
+ zend_hash_get_current_data_ex(SOAP_GLOBAL(mem_cache), (void **) &q, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(SOAP_GLOBAL(mem_cache), &pos)) {
+ if (q->time < latest) {
+ latest = q->time;
+ zend_hash_get_current_key_ex(SOAP_GLOBAL(mem_cache), &key, &key_len, &idx, 0, &pos);
+ }
+ }
+ if (key) {
+ zend_hash_del(SOAP_GLOBAL(mem_cache), key, key_len);
+ } else {
+ return sdl;
+ }
+ }
+
+ psdl = make_persistent_sdl(sdl TSRMLS_CC);
+ psdl->is_persistent = 1;
+ p.time = t;
+ p.sdl = psdl;
+
+ if (SUCCESS == zend_hash_update(SOAP_GLOBAL(mem_cache), uri,
+ uri_len+1, (void*)&p, sizeof(sdl_cache_bucket), NULL)) {
+ /* remove non-persitent sdl structure */
+ delete_sdl_impl(sdl);
+ /* and replace it with persistent one */
+ sdl = psdl;
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to register persistent entry");
+ /* clean up persistent sdl */
+ delete_psdl(&p);
+ /* keep non-persistent sdl and return it */
+ }
+ }
+ }
+
+ return sdl;
+}
+
+/* Deletes */
+void delete_sdl_impl(void *handle)
+{
+ sdlPtr tmp = (sdlPtr)handle;
+
+ zend_hash_destroy(&tmp->functions);
+ if (tmp->source) {
+ efree(tmp->source);
+ }
+ if (tmp->target_ns) {
+ efree(tmp->target_ns);
+ }
+ if (tmp->elements) {
+ zend_hash_destroy(tmp->elements);
+ efree(tmp->elements);
+ }
+ if (tmp->encoders) {
+ zend_hash_destroy(tmp->encoders);
+ efree(tmp->encoders);
+ }
+ if (tmp->types) {
+ zend_hash_destroy(tmp->types);
+ efree(tmp->types);
+ }
+ if (tmp->groups) {
+ zend_hash_destroy(tmp->groups);
+ efree(tmp->groups);
+ }
+ if (tmp->bindings) {
+ zend_hash_destroy(tmp->bindings);
+ efree(tmp->bindings);
+ }
+ if (tmp->requests) {
+ zend_hash_destroy(tmp->requests);
+ efree(tmp->requests);
+ }
+ efree(tmp);
+}
+
+void delete_sdl(void *handle)
+{
+ sdlPtr tmp = (sdlPtr)handle;
+
+ if (!tmp->is_persistent) {
+ delete_sdl_impl(tmp);
+ }
+}
+
+static void delete_binding(void *data)
+{
+ sdlBindingPtr binding = *((sdlBindingPtr*)data);
+
+ if (binding->location) {
+ efree(binding->location);
+ }
+ if (binding->name) {
+ efree(binding->name);
+ }
+
+ if (binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingPtr soapBind = binding->bindingAttributes;
+ if (soapBind) {
+ efree(soapBind);
+ }
+ }
+ efree(binding);
+}
+
+static void delete_binding_persistent(void *data)
+{
+ sdlBindingPtr binding = *((sdlBindingPtr*)data);
+
+ if (binding->location) {
+ free(binding->location);
+ }
+ if (binding->name) {
+ free(binding->name);
+ }
+
+ if (binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingPtr soapBind = binding->bindingAttributes;
+ if (soapBind) {
+ free(soapBind);
+ }
+ }
+ free(binding);
+}
+
+static void delete_sdl_soap_binding_function_body(sdlSoapBindingFunctionBody body)
+{
+ if (body.ns) {
+ efree(body.ns);
+ }
+ if (body.headers) {
+ zend_hash_destroy(body.headers);
+ efree(body.headers);
+ }
+}
+
+static void delete_sdl_soap_binding_function_body_persistent(sdlSoapBindingFunctionBody body)
+{
+ if (body.ns) {
+ free(body.ns);
+ }
+ if (body.headers) {
+ zend_hash_destroy(body.headers);
+ free(body.headers);
+ }
+}
+
+static void delete_function(void *data)
+{
+ sdlFunctionPtr function = *((sdlFunctionPtr*)data);
+
+ if (function->functionName) {
+ efree(function->functionName);
+ }
+ if (function->requestName) {
+ efree(function->requestName);
+ }
+ if (function->responseName) {
+ efree(function->responseName);
+ }
+ if (function->requestParameters) {
+ zend_hash_destroy(function->requestParameters);
+ efree(function->requestParameters);
+ }
+ if (function->responseParameters) {
+ zend_hash_destroy(function->responseParameters);
+ efree(function->responseParameters);
+ }
+ if (function->faults) {
+ zend_hash_destroy(function->faults);
+ efree(function->faults);
+ }
+
+ if (function->bindingAttributes &&
+ function->binding && function->binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionPtr soapFunction = function->bindingAttributes;
+ if (soapFunction->soapAction) {
+ efree(soapFunction->soapAction);
+ }
+ delete_sdl_soap_binding_function_body(soapFunction->input);
+ delete_sdl_soap_binding_function_body(soapFunction->output);
+ efree(soapFunction);
+ }
+ efree(function);
+}
+
+static void delete_function_persistent(void *data)
+{
+ sdlFunctionPtr function = *((sdlFunctionPtr*)data);
+
+ if (function->functionName) {
+ free(function->functionName);
+ }
+ if (function->requestName) {
+ free(function->requestName);
+ }
+ if (function->responseName) {
+ free(function->responseName);
+ }
+ if (function->requestParameters) {
+ zend_hash_destroy(function->requestParameters);
+ free(function->requestParameters);
+ }
+ if (function->responseParameters) {
+ zend_hash_destroy(function->responseParameters);
+ free(function->responseParameters);
+ }
+ if (function->faults) {
+ zend_hash_destroy(function->faults);
+ free(function->faults);
+ }
+
+ if (function->bindingAttributes &&
+ function->binding && function->binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionPtr soapFunction = function->bindingAttributes;
+ if (soapFunction->soapAction) {
+ free(soapFunction->soapAction);
+ }
+ delete_sdl_soap_binding_function_body_persistent(soapFunction->input);
+ delete_sdl_soap_binding_function_body_persistent(soapFunction->output);
+ free(soapFunction);
+ }
+ free(function);
+}
+
+static void delete_parameter(void *data)
+{
+ sdlParamPtr param = *((sdlParamPtr*)data);
+ if (param->paramName) {
+ efree(param->paramName);
+ }
+ efree(param);
+}
+
+static void delete_parameter_persistent(void *data)
+{
+ sdlParamPtr param = *((sdlParamPtr*)data);
+ if (param->paramName) {
+ free(param->paramName);
+ }
+ free(param);
+}
+
+static void delete_header(void *data)
+{
+ sdlSoapBindingFunctionHeaderPtr hdr = *((sdlSoapBindingFunctionHeaderPtr*)data);
+ if (hdr->name) {
+ efree(hdr->name);
+ }
+ if (hdr->ns) {
+ efree(hdr->ns);
+ }
+ if (hdr->headerfaults) {
+ zend_hash_destroy(hdr->headerfaults);
+ efree(hdr->headerfaults);
+ }
+ efree(hdr);
+}
+
+static void delete_header_persistent(void *data)
+{
+ sdlSoapBindingFunctionHeaderPtr hdr = *((sdlSoapBindingFunctionHeaderPtr*)data);
+ if (hdr->name) {
+ free(hdr->name);
+ }
+ if (hdr->ns) {
+ free(hdr->ns);
+ }
+ if (hdr->headerfaults) {
+ zend_hash_destroy(hdr->headerfaults);
+ free(hdr->headerfaults);
+ }
+ free(hdr);
+}
+
+static void delete_fault(void *data)
+{
+ sdlFaultPtr fault = *((sdlFaultPtr*)data);
+ if (fault->name) {
+ efree(fault->name);
+ }
+ if (fault->details) {
+ zend_hash_destroy(fault->details);
+ efree(fault->details);
+ }
+ if (fault->bindingAttributes) {
+ sdlSoapBindingFunctionFaultPtr binding = (sdlSoapBindingFunctionFaultPtr)fault->bindingAttributes;
+
+ if (binding->ns) {
+ efree(binding->ns);
+ }
+ efree(fault->bindingAttributes);
+ }
+ efree(fault);
+}
+
+static void delete_fault_persistent(void *data)
+{
+ sdlFaultPtr fault = *((sdlFaultPtr*)data);
+ if (fault->name) {
+ free(fault->name);
+ }
+ if (fault->details) {
+ zend_hash_destroy(fault->details);
+ free(fault->details);
+ }
+ if (fault->bindingAttributes) {
+ sdlSoapBindingFunctionFaultPtr binding = (sdlSoapBindingFunctionFaultPtr)fault->bindingAttributes;
+
+ if (binding->ns) {
+ free(binding->ns);
+ }
+ free(fault->bindingAttributes);
+ }
+ free(fault);
+}
+
+static void delete_document(void *doc_ptr)
+{
+ xmlDocPtr doc = *((xmlDocPtr*)doc_ptr);
+ xmlFreeDoc(doc);
+}
+
diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h
new file mode 100644
index 0000000..78757d1
--- /dev/null
+++ b/ext/soap/php_sdl.h
@@ -0,0 +1,272 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#ifndef PHP_SDL_H
+#define PHP_SDL_H
+
+#define XSD_WHITESPACE_COLLAPSE 1
+#define XSD_WHITESPACE_PRESERVE 1
+#define XSD_WHITESPACE_REPLACE 1
+
+typedef enum _sdlBindingType {
+ BINDING_SOAP = 1,
+ BINDING_HTTP = 2
+} sdlBindingType;
+
+typedef enum _sdlEncodingStyle {
+ SOAP_RPC = 1,
+ SOAP_DOCUMENT = 2
+} sdlEncodingStyle;
+
+typedef enum _sdlRpcEncodingStyle {
+ SOAP_ENCODING_DEFAULT = 0,
+ SOAP_ENCODING_1_1 = 1,
+ SOAP_ENCODING_1_2 = 2
+} sdlRpcEncodingStyle;
+
+typedef enum _sdlEncodingUse {
+ SOAP_ENCODED = 1,
+ SOAP_LITERAL = 2
+} sdlEncodingUse;
+
+typedef enum _sdlTransport {
+ SOAP_TRANSPORT_HTTP = 1
+} sdlTransport;
+
+struct _sdl {
+ HashTable functions; /* array of sdlFunction */
+ HashTable *types; /* array of sdlTypesPtr */
+ HashTable *elements; /* array of sdlTypesPtr */
+ HashTable *encoders; /* array of encodePtr */
+ HashTable *bindings; /* array of sdlBindings (key'd by name) */
+ HashTable *requests; /* array of sdlFunction (references) */
+ HashTable *groups; /* array of sdlTypesPtr */
+ char *target_ns;
+ char *source;
+ zend_bool is_persistent;
+};
+
+typedef struct sdlCtx {
+ sdlPtr sdl;
+
+ HashTable docs; /* array of xmlDocPtr */
+
+ HashTable messages; /* array of xmlNodePtr */
+ HashTable bindings; /* array of xmlNodePtr */
+ HashTable portTypes; /* array of xmlNodePtr */
+ HashTable services; /* array of xmlNodePtr */
+
+ HashTable *attributes; /* array of sdlAttributePtr */
+ HashTable *attributeGroups; /* array of sdlTypesPtr */
+ php_stream_context *context;
+ zval *old_header;
+} sdlCtx;
+
+struct _sdlBinding {
+ char *name;
+ char *location;
+ sdlBindingType bindingType;
+ void *bindingAttributes; /* sdlSoapBindingPtr */
+};
+
+/* Soap Binding Specfic stuff */
+struct _sdlSoapBinding {
+ sdlEncodingStyle style;
+ sdlTransport transport; /* not implemented yet */
+};
+
+typedef struct _sdlSoapBindingFunctionHeader {
+ char *name;
+ char *ns;
+ sdlEncodingUse use;
+ sdlTypePtr element;
+ encodePtr encode;
+ sdlRpcEncodingStyle encodingStyle; /* not implemented yet */
+ HashTable *headerfaults; /* array of sdlSoapBindingFunctionHeaderPtr */
+} sdlSoapBindingFunctionHeader, *sdlSoapBindingFunctionHeaderPtr;
+
+typedef struct _sdlSoapBindingFunctionFault {
+ char *ns;
+ sdlEncodingUse use;
+ sdlRpcEncodingStyle encodingStyle; /* not implemented yet */
+} sdlSoapBindingFunctionFault, *sdlSoapBindingFunctionFaultPtr;
+
+struct _sdlSoapBindingFunctionBody {
+ char *ns;
+ sdlEncodingUse use;
+ sdlRpcEncodingStyle encodingStyle; /* not implemented yet */
+ HashTable *headers; /* array of sdlSoapBindingFunctionHeaderPtr */
+};
+
+struct _sdlSoapBindingFunction {
+ char *soapAction;
+ sdlEncodingStyle style;
+
+ sdlSoapBindingFunctionBody input;
+ sdlSoapBindingFunctionBody output;
+};
+
+struct _sdlRestrictionInt {
+ int value;
+ char fixed;
+};
+
+struct _sdlRestrictionChar {
+ char *value;
+ char fixed;
+};
+
+struct _sdlRestrictions {
+ HashTable *enumeration; /* array of sdlRestrictionCharPtr */
+ sdlRestrictionIntPtr minExclusive;
+ sdlRestrictionIntPtr minInclusive;
+ sdlRestrictionIntPtr maxExclusive;
+ sdlRestrictionIntPtr maxInclusive;
+ sdlRestrictionIntPtr totalDigits;
+ sdlRestrictionIntPtr fractionDigits;
+ sdlRestrictionIntPtr length;
+ sdlRestrictionIntPtr minLength;
+ sdlRestrictionIntPtr maxLength;
+ sdlRestrictionCharPtr whiteSpace;
+ sdlRestrictionCharPtr pattern;
+};
+
+typedef enum _sdlContentKind {
+ XSD_CONTENT_ELEMENT,
+ XSD_CONTENT_SEQUENCE,
+ XSD_CONTENT_ALL,
+ XSD_CONTENT_CHOICE,
+ XSD_CONTENT_GROUP_REF,
+ XSD_CONTENT_GROUP,
+ XSD_CONTENT_ANY
+} sdlContentKind;
+
+
+typedef struct _sdlContentModel sdlContentModel, *sdlContentModelPtr;
+
+struct _sdlContentModel {
+ sdlContentKind kind;
+ int min_occurs;
+ int max_occurs;
+ union {
+ sdlTypePtr element; /* pointer to element */
+ sdlTypePtr group; /* pointer to group */
+ HashTable *content; /* array of sdlContentModel for sequnce,all,choice*/
+ char *group_ref; /* reference to group */
+ } u;
+};
+
+typedef enum _sdlTypeKind {
+ XSD_TYPEKIND_SIMPLE,
+ XSD_TYPEKIND_LIST,
+ XSD_TYPEKIND_UNION,
+ XSD_TYPEKIND_COMPLEX,
+ XSD_TYPEKIND_RESTRICTION,
+ XSD_TYPEKIND_EXTENSION
+} sdlTypeKind;
+
+typedef enum _sdlUse {
+ XSD_USE_DEFAULT,
+ XSD_USE_OPTIONAL,
+ XSD_USE_PROHIBITED,
+ XSD_USE_REQUIRED
+} sdlUse;
+
+typedef enum _sdlForm {
+ XSD_FORM_DEFAULT,
+ XSD_FORM_QUALIFIED,
+ XSD_FORM_UNQUALIFIED
+} sdlForm;
+
+struct _sdlType {
+ sdlTypeKind kind;
+ char *name;
+ char *namens;
+ char nillable;
+ HashTable *elements; /* array of sdlTypePtr */
+ HashTable *attributes; /* array of sdlAttributePtr */
+ sdlRestrictionsPtr restrictions;
+ encodePtr encode;
+ sdlContentModelPtr model;
+ char *def;
+ char *fixed;
+ char *ref;
+ sdlForm form;
+};
+
+struct _sdlParam {
+ int order;
+ sdlTypePtr element;
+ encodePtr encode;
+ char *paramName;
+};
+
+typedef struct _sdlFault {
+ char *name;
+ HashTable *details; /* array of sdlParamPtr */
+ void *bindingAttributes; /* sdlSoapBindingFunctionFaultPtr */
+} sdlFault, *sdlFaultPtr;
+
+struct _sdlFunction {
+ char *functionName;
+ char *requestName;
+ char *responseName;
+ HashTable *requestParameters; /* array of sdlParamPtr */
+ HashTable *responseParameters; /* array of sdlParamPtr (this should only be one) */
+ struct _sdlBinding *binding;
+ void *bindingAttributes; /* sdlSoapBindingFunctionPtr */
+ HashTable *faults; /* array of sdlFaultPtr */
+};
+
+typedef struct _sdlExtraAttribute {
+ char *ns;
+ char *val;
+} sdlExtraAttribute, *sdlExtraAttributePtr;
+
+struct _sdlAttribute {
+ char *name;
+ char *namens;
+ char *ref;
+ char *def;
+ char *fixed;
+ sdlForm form;
+ sdlUse use;
+ HashTable *extraAttributes; /* array of sdlExtraAttribute */
+ encodePtr encode;
+};
+
+
+sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC);
+
+encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const xmlChar *type);
+encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
+encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len);
+
+sdlBindingPtr get_binding_from_type(sdlPtr sdl, int type);
+sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns);
+
+void delete_sdl(void *handle);
+void delete_sdl_impl(void *handle);
+
+void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC);
+void sdl_restore_uri_credentials(sdlCtx *ctx TSRMLS_DC);
+
+#endif
diff --git a/ext/soap/php_soap.dsp b/ext/soap/php_soap.dsp
new file mode 100644
index 0000000..4157c63
--- /dev/null
+++ b/ext/soap/php_soap.dsp
@@ -0,0 +1,156 @@
+# Microsoft Developer Studio Project File - Name="php_soap" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=php_soap - Win32 Debug_TS
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "php_soap.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "php_soap.mak" CFG="php_soap - Win32 Debug_TS"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "php_soap - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "php_soap - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "php_soap - Win32 Release_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_TS"
+# PROP BASE Intermediate_Dir "Release_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_TS"
+# PROP Intermediate_Dir "Release_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\libxml2-2.4.12\include" /I "..\..\bind" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTSWS" /D "PHP_SOAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "ZTS" /D ZEND_DEBUG=0 /D "COMPILE_DL_SOAP" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib libxml2.lib wsock32.lib resolv.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS\php_soap.dll" /libpath:"..\..\\" /libpath:"..\..\..\libxml2-2.4.12\lib" /libpath:"..\..\Release_TS"
+
+!ELSEIF "$(CFG)" == "php_soap - Win32 Debug_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug_TS"
+# PROP BASE Intermediate_Dir "Debug_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_TS"
+# PROP Intermediate_Dir "Debug_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\libxml2-2.4.12\include" /I "..\..\bind" /D "WS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "ZTS" /D ZEND_DEBUG=1 /D "COMPILE_DL_SOAP" /FR"Debug_TS/" /Fp"Debug_TS/soap.pch" /YX /Fo"Debug_TS/" /Fd"Debug_TS/" /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib libxml2.lib wsock32.lib resolv.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS\php_soap.dll" /pdbtype:sept /libpath:"..\..\\" /libpath:"..\..\..\libxml2-2.4.12\lib" /libpath:"..\..\Debug_TS"
+# SUBTRACT LINK32 /pdb:none /incremental:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "php_soap - Win32 Release_TS"
+# Name "php_soap - Win32 Debug_TS"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\php_encoding.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\php_http.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\php_packet_soap.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\php_schema.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\php_sdl.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\php_xml.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\soap.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\php_encoding.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\php_http.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\php_packet_soap.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\php_schema.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\php_sdl.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\php_soap.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\php_xml.h
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h
new file mode 100644
index 0000000..0e37db5
--- /dev/null
+++ b/ext/soap/php_soap.h
@@ -0,0 +1,210 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#ifndef PHP_SOAP_H
+#define PHP_SOAP_H
+
+#include "php.h"
+#include "php_globals.h"
+#include "ext/standard/info.h"
+#include "ext/standard/php_standard.h"
+#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
+#include "ext/session/php_session.h"
+#endif
+#include "ext/standard/php_smart_str.h"
+#include "php_ini.h"
+#include "SAPI.h"
+#include <libxml/parser.h>
+#include <libxml/xpath.h>
+
+#ifndef PHP_HAVE_STREAMS
+# error You lose - must be compiled against PHP 4.3.0 or later
+#endif
+
+#ifndef PHP_WIN32
+# define TRUE 1
+# define FALSE 0
+# define stricmp strcasecmp
+#endif
+
+extern int le_url;
+
+typedef struct _encodeType encodeType, *encodeTypePtr;
+typedef struct _encode encode, *encodePtr;
+
+typedef struct _sdl sdl, *sdlPtr;
+typedef struct _sdlRestrictionInt sdlRestrictionInt, *sdlRestrictionIntPtr;
+typedef struct _sdlRestrictionChar sdlRestrictionChar, *sdlRestrictionCharPtr;
+typedef struct _sdlRestrictions sdlRestrictions, *sdlRestrictionsPtr;
+typedef struct _sdlType sdlType, *sdlTypePtr;
+typedef struct _sdlParam sdlParam, *sdlParamPtr;
+typedef struct _sdlFunction sdlFunction, *sdlFunctionPtr;
+typedef struct _sdlAttribute sdlAttribute, *sdlAttributePtr;
+typedef struct _sdlBinding sdlBinding, *sdlBindingPtr;
+typedef struct _sdlSoapBinding sdlSoapBinding, *sdlSoapBindingPtr;
+typedef struct _sdlSoapBindingFunction sdlSoapBindingFunction, *sdlSoapBindingFunctionPtr;
+typedef struct _sdlSoapBindingFunctionBody sdlSoapBindingFunctionBody, *sdlSoapBindingFunctionBodyPtr;
+
+typedef struct _soapMapping soapMapping, *soapMappingPtr;
+typedef struct _soapService soapService, *soapServicePtr;
+
+#include "php_xml.h"
+#include "php_encoding.h"
+#include "php_sdl.h"
+#include "php_schema.h"
+#include "php_http.h"
+#include "php_packet_soap.h"
+
+struct _soapMapping {
+ zval *to_xml;
+ zval *to_zval;
+};
+
+struct _soapHeader;
+
+struct _soapService {
+ sdlPtr sdl;
+
+ struct _soap_functions {
+ HashTable *ft;
+ int functions_all;
+ } soap_functions;
+
+ struct _soap_class {
+ zend_class_entry *ce;
+ zval **argv;
+ int argc;
+ int persistance;
+ } soap_class;
+
+ zval *soap_object;
+
+ HashTable *typemap;
+ int version;
+ int type;
+ char *actor;
+ char *uri;
+ xmlCharEncodingHandlerPtr encoding;
+ HashTable *class_map;
+ int features;
+ struct _soapHeader **soap_headers_ptr;
+ int send_errors;
+};
+
+#define SOAP_CLASS 1
+#define SOAP_FUNCTIONS 2
+#define SOAP_OBJECT 3
+#define SOAP_FUNCTIONS_ALL 999
+
+#define SOAP_MAP_FUNCTION 1
+#define SOAP_MAP_CLASS 2
+
+#define SOAP_PERSISTENCE_SESSION 1
+#define SOAP_PERSISTENCE_REQUEST 2
+
+#define SOAP_1_1 1
+#define SOAP_1_2 2
+
+#define SOAP_ACTOR_NEXT 1
+#define SOAP_ACTOR_NONE 2
+#define SOAP_ACTOR_UNLIMATERECEIVER 3
+
+#define SOAP_1_1_ACTOR_NEXT "http://schemas.xmlsoap.org/soap/actor/next"
+
+#define SOAP_1_2_ACTOR_NEXT "http://www.w3.org/2003/05/soap-envelope/role/next"
+#define SOAP_1_2_ACTOR_NONE "http://www.w3.org/2003/05/soap-envelope/role/none"
+#define SOAP_1_2_ACTOR_UNLIMATERECEIVER "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
+
+#define SOAP_COMPRESSION_ACCEPT 0x20
+#define SOAP_COMPRESSION_GZIP 0x00
+#define SOAP_COMPRESSION_DEFLATE 0x10
+
+#define SOAP_AUTHENTICATION_BASIC 0
+#define SOAP_AUTHENTICATION_DIGEST 1
+
+#define SOAP_SINGLE_ELEMENT_ARRAYS (1<<0)
+#define SOAP_WAIT_ONE_WAY_CALLS (1<<1)
+#define SOAP_USE_XSI_ARRAY_TYPE (1<<2)
+
+#define WSDL_CACHE_NONE 0x0
+#define WSDL_CACHE_DISK 0x1
+#define WSDL_CACHE_MEMORY 0x2
+#define WSDL_CACHE_BOTH 0x3
+
+ZEND_BEGIN_MODULE_GLOBALS(soap)
+ HashTable defEncNs; /* mapping of default namespaces to prefixes */
+ HashTable defEnc;
+ HashTable defEncIndex;
+ HashTable *typemap;
+ int cur_uniq_ns;
+ int soap_version;
+ sdlPtr sdl;
+ zend_bool use_soap_error_handler;
+ char* error_code;
+ zval* error_object;
+ char cache;
+ char cache_mode;
+ char cache_enabled;
+ char* cache_dir;
+ long cache_ttl;
+ long cache_limit;
+ HashTable *mem_cache;
+ xmlCharEncodingHandlerPtr encoding;
+ HashTable *class_map;
+ int features;
+ HashTable wsdl_cache;
+ int cur_uniq_ref;
+ HashTable *ref_map;
+ZEND_END_MODULE_GLOBALS(soap)
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+extern zend_module_entry soap_module_entry;
+#define soap_module_ptr &soap_module_entry
+#define phpext_soap_ptr soap_module_ptr
+
+ZEND_EXTERN_MODULE_GLOBALS(soap)
+
+#ifdef ZTS
+# define SOAP_GLOBAL(v) TSRMG(soap_globals_id, zend_soap_globals *, v)
+#else
+# define SOAP_GLOBAL(v) (soap_globals.v)
+#endif
+
+extern zend_class_entry* soap_var_class_entry;
+
+zval* add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC);
+
+#define soap_error0(severity, format) \
+ php_error(severity, "SOAP-ERROR: " format)
+
+#define soap_error1(severity, format, param1) \
+ php_error(severity, "SOAP-ERROR: " format, param1)
+
+#define soap_error2(severity, format, param1, param2) \
+ php_error(severity, "SOAP-ERROR: " format, param1, param2)
+
+#define soap_error3(severity, format, param1, param2, param3) \
+ php_error(severity, "SOAP-ERROR: " format, param1, param2, param3)
+
+#endif
diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c
new file mode 100644
index 0000000..9393855
--- /dev/null
+++ b/ext/soap/php_xml.c
@@ -0,0 +1,328 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#include "php_soap.h"
+#include "ext/libxml/php_libxml.h"
+#include "libxml/parser.h"
+#include "libxml/parserInternals.h"
+
+/* Channel libxml file io layer through the PHP streams subsystem.
+ * This allows use of ftps:// and https:// urls */
+
+static int is_blank(const xmlChar* str)
+{
+ while (*str != '\0') {
+ if (*str != ' ' && *str != 0x9 && *str != 0xa && *str != 0xd) {
+ return 0;
+ }
+ str++;
+ }
+ return 1;
+}
+
+/* removes all empty text, comments and other insignoficant nodes */
+static void cleanup_xml_node(xmlNodePtr node)
+{
+ xmlNodePtr trav;
+ xmlNodePtr del = NULL;
+
+ trav = node->children;
+ while (trav != NULL) {
+ if (del != NULL) {
+ xmlUnlinkNode(del);
+ xmlFreeNode(del);
+ del = NULL;
+ }
+ if (trav->type == XML_TEXT_NODE) {
+ if (is_blank(trav->content)) {
+ del = trav;
+ }
+ } else if ((trav->type != XML_ELEMENT_NODE) &&
+ (trav->type != XML_CDATA_SECTION_NODE)) {
+ del = trav;
+ } else if (trav->children != NULL) {
+ cleanup_xml_node(trav);
+ }
+ trav = trav->next;
+ }
+ if (del != NULL) {
+ xmlUnlinkNode(del);
+ xmlFreeNode(del);
+ }
+}
+
+static void soap_ignorableWhitespace(void *ctx, const xmlChar *ch, int len)
+{
+}
+
+static void soap_Comment(void *ctx, const xmlChar *value)
+{
+}
+
+xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC)
+{
+ xmlParserCtxtPtr ctxt = NULL;
+ xmlDocPtr ret;
+ zend_bool old_allow_url_fopen;
+
+/*
+ xmlInitParser();
+*/
+
+ old_allow_url_fopen = PG(allow_url_fopen);
+ PG(allow_url_fopen) = 1;
+ ctxt = xmlCreateFileParserCtxt(filename);
+ PG(allow_url_fopen) = old_allow_url_fopen;
+ if (ctxt) {
+ zend_bool old;
+
+ ctxt->keepBlanks = 0;
+ ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;
+ ctxt->sax->comment = soap_Comment;
+ ctxt->sax->warning = NULL;
+ ctxt->sax->error = NULL;
+ /*ctxt->sax->fatalError = NULL;*/
+ old = php_libxml_disable_entity_loader(1 TSRMLS_CC);
+ xmlParseDocument(ctxt);
+ php_libxml_disable_entity_loader(old TSRMLS_CC);
+ if (ctxt->wellFormed) {
+ ret = ctxt->myDoc;
+ if (ret->URL == NULL && ctxt->directory != NULL) {
+ ret->URL = xmlCharStrdup(ctxt->directory);
+ }
+ } else {
+ ret = NULL;
+ xmlFreeDoc(ctxt->myDoc);
+ ctxt->myDoc = NULL;
+ }
+ xmlFreeParserCtxt(ctxt);
+ } else {
+ ret = NULL;
+ }
+
+/*
+ xmlCleanupParser();
+*/
+
+ if (ret) {
+ cleanup_xml_node((xmlNodePtr)ret);
+ }
+ return ret;
+}
+
+xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
+{
+ xmlParserCtxtPtr ctxt = NULL;
+ xmlDocPtr ret;
+
+ TSRMLS_FETCH();
+
+/*
+ xmlInitParser();
+*/
+ ctxt = xmlCreateMemoryParserCtxt(buf, buf_size);
+ if (ctxt) {
+ zend_bool old;
+
+ ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;
+ ctxt->sax->comment = soap_Comment;
+ ctxt->sax->warning = NULL;
+ ctxt->sax->error = NULL;
+ /*ctxt->sax->fatalError = NULL;*/
+#if LIBXML_VERSION >= 20703
+ ctxt->options |= XML_PARSE_HUGE;
+#endif
+ old = php_libxml_disable_entity_loader(1 TSRMLS_CC);
+ xmlParseDocument(ctxt);
+ php_libxml_disable_entity_loader(old TSRMLS_CC);
+ if (ctxt->wellFormed) {
+ ret = ctxt->myDoc;
+ if (ret->URL == NULL && ctxt->directory != NULL) {
+ ret->URL = xmlCharStrdup(ctxt->directory);
+ }
+ } else {
+ ret = NULL;
+ xmlFreeDoc(ctxt->myDoc);
+ ctxt->myDoc = NULL;
+ }
+ xmlFreeParserCtxt(ctxt);
+ } else {
+ ret = NULL;
+ }
+
+/*
+ xmlCleanupParser();
+*/
+
+/*
+ if (ret) {
+ cleanup_xml_node((xmlNodePtr)ret);
+ }
+*/
+ return ret;
+}
+
+xmlNsPtr attr_find_ns(xmlAttrPtr node)
+{
+ if (node->ns) {
+ return node->ns;
+ } else if (node->parent->ns) {
+ return node->parent->ns;
+ } else {
+ return xmlSearchNs(node->doc, node->parent, NULL);
+ }
+}
+
+xmlNsPtr node_find_ns(xmlNodePtr node)
+{
+ if (node->ns) {
+ return node->ns;
+ } else {
+ return xmlSearchNs(node->doc, node, NULL);
+ }
+}
+
+int attr_is_equal_ex(xmlAttrPtr node, char *name, char *ns)
+{
+ if (name == NULL || strcmp((char*)node->name, name) == 0) {
+ if (ns) {
+ xmlNsPtr nsPtr = attr_find_ns(node);
+ if (nsPtr) {
+ return (strcmp((char*)nsPtr->href, ns) == 0);
+ } else {
+ return FALSE;
+ }
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+int node_is_equal_ex(xmlNodePtr node, char *name, char *ns)
+{
+ if (name == NULL || strcmp((char*)node->name, name) == 0) {
+ if (ns) {
+ xmlNsPtr nsPtr = node_find_ns(node);
+ if (nsPtr) {
+ return (strcmp((char*)nsPtr->href, ns) == 0);
+ } else {
+ return FALSE;
+ }
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+xmlAttrPtr get_attribute_ex(xmlAttrPtr node, char *name, char *ns)
+{
+ while (node!=NULL) {
+ if (attr_is_equal_ex(node, name, ns)) {
+ return node;
+ }
+ node = node->next;
+ }
+ return NULL;
+}
+
+xmlNodePtr get_node_ex(xmlNodePtr node, char *name, char *ns)
+{
+ while (node!=NULL) {
+ if (node_is_equal_ex(node, name, ns)) {
+ return node;
+ }
+ node = node->next;
+ }
+ return NULL;
+}
+
+xmlNodePtr get_node_recurisve_ex(xmlNodePtr node, char *name, char *ns)
+{
+ while (node != NULL) {
+ if (node_is_equal_ex(node, name, ns)) {
+ return node;
+ } else if (node->children != NULL) {
+ xmlNodePtr tmp = get_node_recurisve_ex(node->children, name, ns);
+ if (tmp) {
+ return tmp;
+ }
+ }
+ node = node->next;
+ }
+ return NULL;
+}
+
+xmlNodePtr get_node_with_attribute_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns)
+{
+ xmlAttrPtr attr;
+
+ while (node != NULL) {
+ if (name != NULL) {
+ node = get_node_ex(node, name, name_ns);
+ if (node==NULL) {
+ return NULL;
+ }
+ }
+
+ attr = get_attribute_ex(node->properties, attribute, attr_ns);
+ if (attr != NULL && strcmp((char*)attr->children->content, value) == 0) {
+ return node;
+ }
+ node = node->next;
+ }
+ return NULL;
+}
+
+xmlNodePtr get_node_with_attribute_recursive_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns)
+{
+ while (node != NULL) {
+ if (node_is_equal_ex(node, name, name_ns)) {
+ xmlAttrPtr attr = get_attribute_ex(node->properties, attribute, attr_ns);
+ if (attr != NULL && strcmp((char*)attr->children->content, value) == 0) {
+ return node;
+ }
+ }
+ if (node->children != NULL) {
+ xmlNodePtr tmp = get_node_with_attribute_recursive_ex(node->children, name, name_ns, attribute, value, attr_ns);
+ if (tmp) {
+ return tmp;
+ }
+ }
+ node = node->next;
+ }
+ return NULL;
+}
+
+int parse_namespace(const xmlChar *inval, char **value, char **namespace)
+{
+ char *found = strrchr((char*)inval, ':');
+
+ if (found != NULL && found != (char*)inval) {
+ (*namespace) = estrndup((char*)inval, found - (char*)inval);
+ (*value) = estrdup(++found);
+ } else {
+ (*value) = estrdup((char*)inval);
+ (*namespace) = NULL;
+ }
+
+ return FALSE;
+}
diff --git a/ext/soap/php_xml.h b/ext/soap/php_xml.h
new file mode 100644
index 0000000..61c0feb
--- /dev/null
+++ b/ext/soap/php_xml.h
@@ -0,0 +1,79 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#ifndef PHP_SOAP_XML_H
+#define PHP_SOAP_XML_H
+
+#define get_attribute(node, name) get_attribute_ex(node, name, NULL)
+#define get_node(node, name) get_node_ex(node, name, NULL)
+#define get_node_recursive(node, name) get_node_recursive_ex(node, name, NULL)
+#define get_node_with_attribute(node, name, attr, val) get_node_with_attribute_ex(node, name, NULL, attr, val, NULL)
+#define get_node_with_attribute_recursive(node, name, attr, val) get_node_with_attribute_recursive_ex(node, name, NULL, attr, val, NULL)
+#define node_is_equal(node, name) node_is_equal_ex(node, name, NULL)
+#define attr_is_equal(node, name) attr_is_equal_ex(node, name, NULL)
+
+xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC);
+xmlDocPtr soap_xmlParseMemory(const void *buf, size_t size);
+
+xmlNsPtr attr_find_ns(xmlAttrPtr node);
+xmlNsPtr node_find_ns(xmlNodePtr node);
+int attr_is_equal_ex(xmlAttrPtr node, char *name, char *ns);
+int node_is_equal_ex(xmlNodePtr node, char *name, char *ns);
+xmlAttrPtr get_attribute_ex(xmlAttrPtr node,char *name, char *ns);
+xmlNodePtr get_node_ex(xmlNodePtr node,char *name, char *ns);
+xmlNodePtr get_node_recursive_ex(xmlNodePtr node,char *name, char *ns);
+xmlNodePtr get_node_with_attribute_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns);
+xmlNodePtr get_node_with_attribute_recursive_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns);
+int parse_namespace(const xmlChar *inval,char **value,char **namespace);
+
+#define FOREACHATTRNODE(n,c,i) FOREACHATTRNODEEX(n,c,NULL,i)
+#define FOREACHATTRNODEEX(n,c,ns,i) \
+ do { \
+ if (n == NULL) { \
+ break; \
+ } \
+ if (c) { \
+ i = get_attribute_ex(n,c,ns); \
+ } else { \
+ i = n; \
+ } \
+ if (i != NULL) { \
+ n = i;
+
+#define FOREACHNODE(n,c,i) FOREACHNODEEX(n,c,NULL,i)
+#define FOREACHNODEEX(n,c,ns,i) \
+ do { \
+ if (n == NULL) { \
+ break; \
+ } \
+ if (c) { \
+ i = get_node_ex(n,c,NULL); \
+ } else { \
+ i = n; \
+ } \
+ if(i != NULL) { \
+ n = i;
+
+#define ENDFOREACH(n) \
+ } \
+ } while ((n = n->next));
+
+#endif
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
new file mode 100644
index 0000000..7df84e5
--- /dev/null
+++ b/ext/soap/soap.c
@@ -0,0 +1,4847 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
+ | Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+/* $Id$ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "php_soap.h"
+#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
+#include "ext/session/php_session.h"
+#endif
+#include "zend_exceptions.h"
+
+
+static int le_sdl = 0;
+int le_url = 0;
+static int le_service = 0;
+static int le_typemap = 0;
+
+typedef struct _soapHeader {
+ sdlFunctionPtr function;
+ zval function_name;
+ int mustUnderstand;
+ int num_params;
+ zval **parameters;
+ zval retval;
+ sdlSoapBindingFunctionHeaderPtr hdr;
+ struct _soapHeader *next;
+} soapHeader;
+
+/* Local functions */
+static void function_to_string(sdlFunctionPtr function, smart_str *buf);
+static void type_to_string(sdlTypePtr type, smart_str *buf, int level);
+
+static void clear_soap_fault(zval *obj TSRMLS_DC);
+static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, char *name TSRMLS_DC);
+static void soap_server_fault(char* code, char* string, char *actor, zval* details, char *name TSRMLS_DC);
+static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader* hdr TSRMLS_DC);
+
+static sdlParamPtr get_param(sdlFunctionPtr function, char *param_name, int index, int);
+static sdlFunctionPtr get_function(sdlPtr sdl, const char *function_name);
+static sdlFunctionPtr get_doc_function(sdlPtr sdl, xmlNodePtr node);
+
+static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval **parameters[], int *version, soapHeader **headers TSRMLS_DC);
+static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function_name,char *uri,zval *ret, soapHeader *headers, int version TSRMLS_DC);
+static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval **arguments, int arg_count, int version, HashTable *soap_headers TSRMLS_DC);
+static xmlNodePtr serialize_parameter(sdlParamPtr param,zval *param_val,int index,char *name, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent TSRMLS_DC);
+
+static void delete_service(void *service);
+static void delete_url(void *handle);
+static void delete_hashtable(void *hashtable);
+
+static void soap_error_handler(int error_num, const char *error_filename, const uint error_lineno, const char *format, va_list args);
+
+#define SOAP_SERVER_BEGIN_CODE() \
+ zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\
+ char* _old_error_code = SOAP_GLOBAL(error_code);\
+ zval* _old_error_object = SOAP_GLOBAL(error_object);\
+ int _old_soap_version = SOAP_GLOBAL(soap_version);\
+ SOAP_GLOBAL(use_soap_error_handler) = 1;\
+ SOAP_GLOBAL(error_code) = "Server";\
+ SOAP_GLOBAL(error_object) = this_ptr;
+
+#define SOAP_SERVER_END_CODE() \
+ SOAP_GLOBAL(use_soap_error_handler) = _old_handler;\
+ SOAP_GLOBAL(error_code) = _old_error_code;\
+ SOAP_GLOBAL(error_object) = _old_error_object;\
+ SOAP_GLOBAL(soap_version) = _old_soap_version;
+
+#define SOAP_CLIENT_BEGIN_CODE() \
+ zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\
+ char* _old_error_code = SOAP_GLOBAL(error_code);\
+ zval* _old_error_object = SOAP_GLOBAL(error_object);\
+ int _old_soap_version = SOAP_GLOBAL(soap_version);\
+ zend_bool _old_in_compilation = CG(in_compilation); \
+ zend_bool _old_in_execution = EG(in_execution); \
+ zend_execute_data *_old_current_execute_data = EG(current_execute_data); \
+ void **_old_stack_top = EG(argument_stack)->top; \
+ int _bailout = 0;\
+ SOAP_GLOBAL(use_soap_error_handler) = 1;\
+ SOAP_GLOBAL(error_code) = "Client";\
+ SOAP_GLOBAL(error_object) = this_ptr;\
+ zend_try {
+
+#define SOAP_CLIENT_END_CODE() \
+ } zend_catch {\
+ CG(in_compilation) = _old_in_compilation; \
+ EG(in_execution) = _old_in_execution; \
+ EG(current_execute_data) = _old_current_execute_data; \
+ if (EG(exception) == NULL || \
+ Z_TYPE_P(EG(exception)) != IS_OBJECT || \
+ !instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {\
+ _bailout = 1;\
+ }\
+ if (_old_stack_top != EG(argument_stack)->top) { \
+ while (EG(argument_stack)->prev != NULL && \
+ ((char*)_old_stack_top < (char*)EG(argument_stack) || \
+ (char*) _old_stack_top > (char*)EG(argument_stack)->end)) { \
+ zend_vm_stack tmp = EG(argument_stack)->prev; \
+ efree(EG(argument_stack)); \
+ EG(argument_stack) = tmp; \
+ } \
+ EG(argument_stack)->top = _old_stack_top; \
+ } \
+ } zend_end_try();\
+ SOAP_GLOBAL(use_soap_error_handler) = _old_handler;\
+ SOAP_GLOBAL(error_code) = _old_error_code;\
+ SOAP_GLOBAL(error_object) = _old_error_object;\
+ SOAP_GLOBAL(soap_version) = _old_soap_version;\
+ if (_bailout) {\
+ zend_bailout();\
+ }
+
+#define FETCH_THIS_SDL(ss) \
+ { \
+ zval **__tmp; \
+ if(FIND_SDL_PROPERTY(this_ptr,__tmp) != FAILURE) { \
+ FETCH_SDL_RES(ss,__tmp); \
+ } else { \
+ ss = NULL; \
+ } \
+ }
+
+#define FIND_SDL_PROPERTY(ss,tmp) zend_hash_find(Z_OBJPROP_P(ss), "sdl", sizeof("sdl"), (void **)&tmp)
+#define FETCH_SDL_RES(ss,tmp) ss = (sdlPtr) zend_fetch_resource(tmp TSRMLS_CC, -1, "sdl", NULL, 1, le_sdl)
+
+#define FIND_TYPEMAP_PROPERTY(ss,tmp) zend_hash_find(Z_OBJPROP_P(ss), "typemap", sizeof("typemap"), (void **)&tmp)
+#define FETCH_TYPEMAP_RES(ss,tmp) ss = (HashTable*) zend_fetch_resource(tmp TSRMLS_CC, -1, "typemap", NULL, 1, le_typemap)
+
+#define FETCH_THIS_SERVICE(ss) \
+ { \
+ zval **tmp; \
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr),"service", sizeof("service"), (void **)&tmp) != FAILURE) { \
+ ss = (soapServicePtr)zend_fetch_resource(tmp TSRMLS_CC, -1, "service", NULL, 1, le_service); \
+ } else { \
+ ss = NULL; \
+ } \
+ }
+
+static zend_class_entry* soap_class_entry;
+static zend_class_entry* soap_server_class_entry;
+static zend_class_entry* soap_fault_class_entry;
+static zend_class_entry* soap_header_class_entry;
+static zend_class_entry* soap_param_class_entry;
+zend_class_entry* soap_var_class_entry;
+
+ZEND_DECLARE_MODULE_GLOBALS(soap)
+
+static void (*old_error_handler)(int, const char *, const uint, const char*, va_list);
+
+#ifdef va_copy
+#define call_old_error_handler(error_num, error_filename, error_lineno, format, args) \
+{ \
+ va_list copy; \
+ va_copy(copy, args); \
+ old_error_handler(error_num, error_filename, error_lineno, format, copy); \
+ va_end(copy); \
+}
+#else
+#define call_old_error_handler(error_num, error_filename, error_lineno, format, args) \
+{ \
+ old_error_handler(error_num, error_filename, error_lineno, format, args); \
+}
+#endif
+
+#define PHP_SOAP_SERVER_CLASSNAME "SoapServer"
+#define PHP_SOAP_CLIENT_CLASSNAME "SoapClient"
+#define PHP_SOAP_VAR_CLASSNAME "SoapVar"
+#define PHP_SOAP_FAULT_CLASSNAME "SoapFault"
+#define PHP_SOAP_PARAM_CLASSNAME "SoapParam"
+#define PHP_SOAP_HEADER_CLASSNAME "SoapHeader"
+
+PHP_RINIT_FUNCTION(soap);
+PHP_MINIT_FUNCTION(soap);
+PHP_MSHUTDOWN_FUNCTION(soap);
+PHP_MINFO_FUNCTION(soap);
+
+/*
+ Registry Functions
+ TODO: this!
+*/
+PHP_FUNCTION(soap_encode_to_xml);
+PHP_FUNCTION(soap_encode_to_zval);
+PHP_FUNCTION(use_soap_error_handler);
+PHP_FUNCTION(is_soap_fault);
+
+
+/* Server Functions */
+PHP_METHOD(SoapServer, SoapServer);
+PHP_METHOD(SoapServer, setClass);
+PHP_METHOD(SoapServer, setObject);
+PHP_METHOD(SoapServer, addFunction);
+PHP_METHOD(SoapServer, getFunctions);
+PHP_METHOD(SoapServer, handle);
+PHP_METHOD(SoapServer, setPersistence);
+PHP_METHOD(SoapServer, fault);
+PHP_METHOD(SoapServer, addSoapHeader);
+
+/* Client Functions */
+PHP_METHOD(SoapClient, SoapClient);
+PHP_METHOD(SoapClient, __call);
+PHP_METHOD(SoapClient, __getLastRequest);
+PHP_METHOD(SoapClient, __getLastResponse);
+PHP_METHOD(SoapClient, __getLastRequestHeaders);
+PHP_METHOD(SoapClient, __getLastResponseHeaders);
+PHP_METHOD(SoapClient, __getFunctions);
+PHP_METHOD(SoapClient, __getTypes);
+PHP_METHOD(SoapClient, __doRequest);
+PHP_METHOD(SoapClient, __setCookie);
+PHP_METHOD(SoapClient, __setLocation);
+PHP_METHOD(SoapClient, __setSoapHeaders);
+
+/* SoapVar Functions */
+PHP_METHOD(SoapVar, SoapVar);
+
+/* SoapFault Functions */
+PHP_METHOD(SoapFault, SoapFault);
+PHP_METHOD(SoapFault, __toString);
+
+/* SoapParam Functions */
+PHP_METHOD(SoapParam, SoapParam);
+
+/* SoapHeader Functions */
+PHP_METHOD(SoapHeader, SoapHeader);
+
+#define SOAP_CTOR(class_name, func_name, arginfo, flags) PHP_ME(class_name, func_name, arginfo, flags)
+
+/* {{{ arginfo */
+ZEND_BEGIN_ARG_INFO(arginfo_soap__void, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapparam_soapparam, 0, 0, 2)
+ ZEND_ARG_INFO(0, data)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapheader_soapheader, 0, 0, 2)
+ ZEND_ARG_INFO(0, namespace)
+ ZEND_ARG_INFO(0, name)
+ ZEND_ARG_INFO(0, data)
+ ZEND_ARG_INFO(0, mustunderstand)
+ ZEND_ARG_INFO(0, actor)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapfault_soapfault, 0, 0, 2)
+ ZEND_ARG_INFO(0, faultcode)
+ ZEND_ARG_INFO(0, faultstring)
+ ZEND_ARG_INFO(0, faultactor)
+ ZEND_ARG_INFO(0, detail)
+ ZEND_ARG_INFO(0, faultname)
+ ZEND_ARG_INFO(0, headerfault)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapvar_soapvar, 0, 0, 2)
+ ZEND_ARG_INFO(0, data)
+ ZEND_ARG_INFO(0, encoding)
+ ZEND_ARG_INFO(0, type_name)
+ ZEND_ARG_INFO(0, type_namespace)
+ ZEND_ARG_INFO(0, node_name)
+ ZEND_ARG_INFO(0, node_namespace)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapserver_fault, 0, 0, 2)
+ ZEND_ARG_INFO(0, code)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(0, actor)
+ ZEND_ARG_INFO(0, details)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapserver_addsoapheader, 0, 0, 1)
+ ZEND_ARG_INFO(0, object)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapserver_soapserver, 0, 0, 1)
+ ZEND_ARG_INFO(0, wsdl)
+ ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapserver_setpersistence, 0, 0, 1)
+ ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapserver_setclass, 0, 0, 1)
+ ZEND_ARG_INFO(0, class_name)
+ ZEND_ARG_INFO(0, args)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapserver_setobject, 0, 0, 1)
+ ZEND_ARG_INFO(0, object)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_soapserver_getfunctions, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapserver_addfunction, 0, 0, 1)
+ ZEND_ARG_INFO(0, functions)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapserver_handle, 0, 0, 0)
+ ZEND_ARG_INFO(0, soap_request)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapclient_soapclient, 0, 0, 1)
+ ZEND_ARG_INFO(0, wsdl)
+ ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapclient___call, 0, 0, 2)
+ ZEND_ARG_INFO(0, function_name)
+ ZEND_ARG_INFO(0, arguments)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapclient___soapcall, 0, 0, 2)
+ ZEND_ARG_INFO(0, function_name)
+ ZEND_ARG_INFO(0, arguments)
+ ZEND_ARG_INFO(0, options)
+ ZEND_ARG_INFO(0, input_headers)
+ ZEND_ARG_INFO(1, output_headers)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_soapclient___getfunctions, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_soapclient___gettypes, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_soapclient___getlastrequest, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_soapclient___getlastresponse, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_soapclient___getlastrequestheaders, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_soapclient___getlastresponseheaders, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapclient___dorequest, 0, 0, 4)
+ ZEND_ARG_INFO(0, request)
+ ZEND_ARG_INFO(0, location)
+ ZEND_ARG_INFO(0, action)
+ ZEND_ARG_INFO(0, version)
+ ZEND_ARG_INFO(0, one_way)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapclient___setcookie, 0, 0, 1)
+ ZEND_ARG_INFO(0, name)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapclient___setsoapheaders, 0, 0, 1)
+ ZEND_ARG_INFO(0, soapheaders)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soapclient___setlocation, 0, 0, 0)
+ ZEND_ARG_INFO(0, new_location)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soap_use_soap_error_handler, 0, 0, 0)
+ ZEND_ARG_INFO(0, handler)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_soap_is_soap_fault, 0, 0, 1)
+ ZEND_ARG_INFO(0, object)
+ZEND_END_ARG_INFO()
+/* }}} */
+
+static const zend_function_entry soap_functions[] = {
+ PHP_FE(use_soap_error_handler, arginfo_soap_use_soap_error_handler)
+ PHP_FE(is_soap_fault, arginfo_soap_is_soap_fault)
+ PHP_FE_END
+};
+
+static const zend_function_entry soap_fault_functions[] = {
+ SOAP_CTOR(SoapFault, SoapFault, arginfo_soapfault_soapfault, 0)
+ PHP_ME(SoapFault, __toString, arginfo_soap__void, 0)
+ PHP_FE_END
+};
+
+static const zend_function_entry soap_server_functions[] = {
+ SOAP_CTOR(SoapServer, SoapServer, arginfo_soapserver_soapserver, 0)
+ PHP_ME(SoapServer, setPersistence, arginfo_soapserver_setpersistence, 0)
+ PHP_ME(SoapServer, setClass, arginfo_soapserver_setclass, 0)
+ PHP_ME(SoapServer, setObject, arginfo_soapserver_setobject, 0)
+ PHP_ME(SoapServer, addFunction, arginfo_soapserver_addfunction, 0)
+ PHP_ME(SoapServer, getFunctions, arginfo_soapserver_getfunctions, 0)
+ PHP_ME(SoapServer, handle, arginfo_soapserver_handle, 0)
+ PHP_ME(SoapServer, fault, arginfo_soapserver_fault, 0)
+ PHP_ME(SoapServer, addSoapHeader, arginfo_soapserver_addsoapheader, 0)
+ PHP_FE_END
+};
+
+static const zend_function_entry soap_client_functions[] = {
+ SOAP_CTOR(SoapClient, SoapClient, arginfo_soapclient_soapclient, 0)
+ PHP_ME(SoapClient, __call, arginfo_soapclient___call, 0)
+ ZEND_NAMED_ME(__soapCall, ZEND_MN(SoapClient___call), arginfo_soapclient___soapcall, 0)
+ PHP_ME(SoapClient, __getLastRequest, arginfo_soapclient___getlastrequest, 0)
+ PHP_ME(SoapClient, __getLastResponse, arginfo_soapclient___getlastresponse, 0)
+ PHP_ME(SoapClient, __getLastRequestHeaders, arginfo_soapclient___getlastrequestheaders, 0)
+ PHP_ME(SoapClient, __getLastResponseHeaders, arginfo_soapclient___getlastresponseheaders, 0)
+ PHP_ME(SoapClient, __getFunctions, arginfo_soapclient___getfunctions, 0)
+ PHP_ME(SoapClient, __getTypes, arginfo_soapclient___gettypes, 0)
+ PHP_ME(SoapClient, __doRequest, arginfo_soapclient___dorequest, 0)
+ PHP_ME(SoapClient, __setCookie, arginfo_soapclient___setcookie, 0)
+ PHP_ME(SoapClient, __setLocation, arginfo_soapclient___setlocation, 0)
+ PHP_ME(SoapClient, __setSoapHeaders, arginfo_soapclient___setsoapheaders, 0)
+ PHP_FE_END
+};
+
+static const zend_function_entry soap_var_functions[] = {
+ SOAP_CTOR(SoapVar, SoapVar, arginfo_soapvar_soapvar, 0)
+ PHP_FE_END
+};
+
+static const zend_function_entry soap_param_functions[] = {
+ SOAP_CTOR(SoapParam, SoapParam, arginfo_soapparam_soapparam, 0)
+ PHP_FE_END
+};
+
+static const zend_function_entry soap_header_functions[] = {
+ SOAP_CTOR(SoapHeader, SoapHeader, arginfo_soapheader_soapheader, 0)
+ PHP_FE_END
+};
+
+zend_module_entry soap_module_entry = {
+#ifdef STANDARD_MODULE_HEADER
+ STANDARD_MODULE_HEADER,
+#endif
+ "soap",
+ soap_functions,
+ PHP_MINIT(soap),
+ PHP_MSHUTDOWN(soap),
+ PHP_RINIT(soap),
+ NULL,
+ PHP_MINFO(soap),
+#ifdef STANDARD_MODULE_HEADER
+ NO_VERSION_YET,
+#endif
+ STANDARD_MODULE_PROPERTIES,
+};
+
+#ifdef COMPILE_DL_SOAP
+ZEND_GET_MODULE(soap)
+#endif
+
+ZEND_INI_MH(OnUpdateCacheMode)
+{
+ char *p;
+#ifndef ZTS
+ char *base = (char *) mh_arg2;
+#else
+ char *base = (char *) ts_resource(*((int *) mh_arg2));
+#endif
+
+ p = (char*) (base+(size_t) mh_arg1);
+
+ *p = (char)atoi(new_value);
+
+ return SUCCESS;
+}
+
+static PHP_INI_MH(OnUpdateCacheDir)
+{
+ /* Only do the open_basedir check at runtime */
+ if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) {
+ char *p;
+
+ if (memchr(new_value, '\0', new_value_length) != NULL) {
+ return FAILURE;
+ }
+
+ /* we do not use zend_memrchr() since path can contain ; itself */
+ if ((p = strchr(new_value, ';'))) {
+ char *p2;
+ p++;
+ if ((p2 = strchr(p, ';'))) {
+ p = p2 + 1;
+ }
+ } else {
+ p = new_value;
+ }
+
+ if (PG(open_basedir) && *p && php_check_open_basedir(p TSRMLS_CC)) {
+ return FAILURE;
+ }
+ }
+
+ OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return SUCCESS;
+}
+
+PHP_INI_BEGIN()
+STD_PHP_INI_ENTRY("soap.wsdl_cache_enabled", "1", PHP_INI_ALL, OnUpdateBool,
+ cache_enabled, zend_soap_globals, soap_globals)
+STD_PHP_INI_ENTRY("soap.wsdl_cache_dir", "/tmp", PHP_INI_ALL, OnUpdateCacheDir,
+ cache_dir, zend_soap_globals, soap_globals)
+STD_PHP_INI_ENTRY("soap.wsdl_cache_ttl", "86400", PHP_INI_ALL, OnUpdateLong,
+ cache_ttl, zend_soap_globals, soap_globals)
+STD_PHP_INI_ENTRY("soap.wsdl_cache", "1", PHP_INI_ALL, OnUpdateCacheMode,
+ cache_mode, zend_soap_globals, soap_globals)
+STD_PHP_INI_ENTRY("soap.wsdl_cache_limit", "5", PHP_INI_ALL, OnUpdateLong,
+ cache_limit, zend_soap_globals, soap_globals)
+PHP_INI_END()
+
+static HashTable defEnc, defEncIndex, defEncNs;
+
+static void php_soap_prepare_globals()
+{
+ int i;
+ encodePtr enc;
+
+ zend_hash_init(&defEnc, 0, NULL, NULL, 1);
+ zend_hash_init(&defEncIndex, 0, NULL, NULL, 1);
+ zend_hash_init(&defEncNs, 0, NULL, NULL, 1);
+
+ i = 0;
+ do {
+ enc = &defaultEncoding[i];
+
+ /* If has a ns and a str_type then index it */
+ if (defaultEncoding[i].details.type_str) {
+ if (defaultEncoding[i].details.ns != NULL) {
+ char *ns_type;
+ spprintf(&ns_type, 0, "%s:%s", defaultEncoding[i].details.ns, defaultEncoding[i].details.type_str);
+ zend_hash_add(&defEnc, ns_type, strlen(ns_type) + 1, &enc, sizeof(encodePtr), NULL);
+ efree(ns_type);
+ } else {
+ zend_hash_add(&defEnc, defaultEncoding[i].details.type_str, strlen(defaultEncoding[i].details.type_str) + 1, &enc, sizeof(encodePtr), NULL);
+ }
+ }
+ /* Index everything by number */
+ if (!zend_hash_index_exists(&defEncIndex, defaultEncoding[i].details.type)) {
+ zend_hash_index_update(&defEncIndex, defaultEncoding[i].details.type, &enc, sizeof(encodePtr), NULL);
+ }
+ i++;
+ } while (defaultEncoding[i].details.type != END_KNOWN_TYPES);
+
+ /* hash by namespace */
+ zend_hash_add(&defEncNs, XSD_1999_NAMESPACE, sizeof(XSD_1999_NAMESPACE), XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
+ zend_hash_add(&defEncNs, XSD_NAMESPACE, sizeof(XSD_NAMESPACE), XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
+ zend_hash_add(&defEncNs, XSI_NAMESPACE, sizeof(XSI_NAMESPACE), XSI_NS_PREFIX, sizeof(XSI_NS_PREFIX), NULL);
+ zend_hash_add(&defEncNs, XML_NAMESPACE, sizeof(XML_NAMESPACE), XML_NS_PREFIX, sizeof(XML_NS_PREFIX), NULL);
+ zend_hash_add(&defEncNs, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE), SOAP_1_1_ENC_NS_PREFIX, sizeof(SOAP_1_1_ENC_NS_PREFIX), NULL);
+ zend_hash_add(&defEncNs, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE), SOAP_1_2_ENC_NS_PREFIX, sizeof(SOAP_1_2_ENC_NS_PREFIX), NULL);
+}
+
+static void php_soap_init_globals(zend_soap_globals *soap_globals TSRMLS_DC)
+{
+ soap_globals->defEnc = defEnc;
+ soap_globals->defEncIndex = defEncIndex;
+ soap_globals->defEncNs = defEncNs;
+ soap_globals->typemap = NULL;
+ soap_globals->use_soap_error_handler = 0;
+ soap_globals->error_code = NULL;
+ soap_globals->error_object = NULL;
+ soap_globals->sdl = NULL;
+ soap_globals->soap_version = SOAP_1_1;
+ soap_globals->mem_cache = NULL;
+ soap_globals->ref_map = NULL;
+}
+
+PHP_MSHUTDOWN_FUNCTION(soap)
+{
+ zend_error_cb = old_error_handler;
+ zend_hash_destroy(&SOAP_GLOBAL(defEnc));
+ zend_hash_destroy(&SOAP_GLOBAL(defEncIndex));
+ zend_hash_destroy(&SOAP_GLOBAL(defEncNs));
+ if (SOAP_GLOBAL(mem_cache)) {
+ zend_hash_destroy(SOAP_GLOBAL(mem_cache));
+ free(SOAP_GLOBAL(mem_cache));
+ }
+ UNREGISTER_INI_ENTRIES();
+ return SUCCESS;
+}
+
+PHP_RINIT_FUNCTION(soap)
+{
+ SOAP_GLOBAL(typemap) = NULL;
+ SOAP_GLOBAL(use_soap_error_handler) = 0;
+ SOAP_GLOBAL(error_code) = NULL;
+ SOAP_GLOBAL(error_object) = NULL;
+ SOAP_GLOBAL(sdl) = NULL;
+ SOAP_GLOBAL(soap_version) = SOAP_1_1;
+ SOAP_GLOBAL(encoding) = NULL;
+ SOAP_GLOBAL(class_map) = NULL;
+ SOAP_GLOBAL(features) = 0;
+ SOAP_GLOBAL(ref_map) = NULL;
+ return SUCCESS;
+}
+
+PHP_MINIT_FUNCTION(soap)
+{
+ zend_class_entry ce;
+
+ /* TODO: add ini entry for always use soap errors */
+ php_soap_prepare_globals();
+ ZEND_INIT_MODULE_GLOBALS(soap, php_soap_init_globals, NULL);
+ REGISTER_INI_ENTRIES();
+
+ /* Register SoapClient class */
+ /* BIG NOTE : THIS EMITS AN COMPILATION WARNING UNDER ZE2 - handle_function_call deprecated.
+ soap_call_function_handler should be of type struct _zend_function, not (*handle_function_call).
+ */
+ {
+ zend_internal_function fe;
+
+ fe.type = ZEND_INTERNAL_FUNCTION;
+ fe.handler = ZEND_MN(SoapClient___call);
+ fe.function_name = NULL;
+ fe.scope = NULL;
+ fe.fn_flags = 0;
+ fe.prototype = NULL;
+ fe.num_args = 2;
+ fe.arg_info = NULL;
+
+ INIT_OVERLOADED_CLASS_ENTRY(ce, PHP_SOAP_CLIENT_CLASSNAME, soap_client_functions,
+ (zend_function *)&fe, NULL, NULL);
+ soap_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ }
+ /* Register SoapVar class */
+ INIT_CLASS_ENTRY(ce, PHP_SOAP_VAR_CLASSNAME, soap_var_functions);
+ soap_var_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+
+ /* Register SoapServer class */
+ INIT_CLASS_ENTRY(ce, PHP_SOAP_SERVER_CLASSNAME, soap_server_functions);
+ soap_server_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+
+ /* Register SoapFault class */
+ INIT_CLASS_ENTRY(ce, PHP_SOAP_FAULT_CLASSNAME, soap_fault_functions);
+ soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC);
+
+ /* Register SoapParam class */
+ INIT_CLASS_ENTRY(ce, PHP_SOAP_PARAM_CLASSNAME, soap_param_functions);
+ soap_param_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+
+ INIT_CLASS_ENTRY(ce, PHP_SOAP_HEADER_CLASSNAME, soap_header_functions);
+ soap_header_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+
+ le_sdl = register_list_destructors(delete_sdl, NULL);
+ le_url = register_list_destructors(delete_url, NULL);
+ le_service = register_list_destructors(delete_service, NULL);
+ le_typemap = register_list_destructors(delete_hashtable, NULL);
+
+ REGISTER_LONG_CONSTANT("SOAP_1_1", SOAP_1_1, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_1_2", SOAP_1_2, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("SOAP_PERSISTENCE_SESSION", SOAP_PERSISTENCE_SESSION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_PERSISTENCE_REQUEST", SOAP_PERSISTENCE_REQUEST, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_FUNCTIONS_ALL", SOAP_FUNCTIONS_ALL, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("SOAP_ENCODED", SOAP_ENCODED, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_LITERAL", SOAP_LITERAL, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("SOAP_RPC", SOAP_RPC, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_DOCUMENT", SOAP_DOCUMENT, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("SOAP_ACTOR_NEXT", SOAP_ACTOR_NEXT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_ACTOR_NONE", SOAP_ACTOR_NONE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_ACTOR_UNLIMATERECEIVER", SOAP_ACTOR_UNLIMATERECEIVER, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("SOAP_COMPRESSION_ACCEPT", SOAP_COMPRESSION_ACCEPT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_COMPRESSION_GZIP", SOAP_COMPRESSION_GZIP, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_COMPRESSION_DEFLATE", SOAP_COMPRESSION_DEFLATE, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("SOAP_AUTHENTICATION_BASIC", SOAP_AUTHENTICATION_BASIC, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_AUTHENTICATION_DIGEST", SOAP_AUTHENTICATION_DIGEST, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("UNKNOWN_TYPE", UNKNOWN_TYPE, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("XSD_STRING", XSD_STRING, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_BOOLEAN", XSD_BOOLEAN, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_DECIMAL", XSD_DECIMAL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_FLOAT", XSD_FLOAT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_DOUBLE", XSD_DOUBLE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_DURATION", XSD_DURATION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_DATETIME", XSD_DATETIME, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_TIME", XSD_TIME, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_DATE", XSD_DATE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_GYEARMONTH", XSD_GYEARMONTH, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_GYEAR", XSD_GYEAR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_GMONTHDAY", XSD_GMONTHDAY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_GDAY", XSD_GDAY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_GMONTH", XSD_GMONTH, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_HEXBINARY", XSD_HEXBINARY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_BASE64BINARY", XSD_BASE64BINARY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_ANYURI", XSD_ANYURI, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_QNAME", XSD_QNAME, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_NOTATION", XSD_NOTATION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_NORMALIZEDSTRING", XSD_NORMALIZEDSTRING, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_TOKEN", XSD_TOKEN, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_LANGUAGE", XSD_LANGUAGE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_NMTOKEN", XSD_NMTOKEN, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_NAME", XSD_NAME, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_NCNAME", XSD_NCNAME, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_ID", XSD_ID, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_IDREF", XSD_IDREF, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_IDREFS", XSD_IDREFS, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_ENTITY", XSD_ENTITY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_ENTITIES", XSD_ENTITIES, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_INTEGER", XSD_INTEGER, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_NONPOSITIVEINTEGER", XSD_NONPOSITIVEINTEGER, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_NEGATIVEINTEGER", XSD_NEGATIVEINTEGER, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_LONG", XSD_LONG, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_INT", XSD_INT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_SHORT", XSD_SHORT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_BYTE", XSD_BYTE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_NONNEGATIVEINTEGER", XSD_NONNEGATIVEINTEGER, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_UNSIGNEDLONG", XSD_UNSIGNEDLONG, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_UNSIGNEDINT", XSD_UNSIGNEDINT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_UNSIGNEDSHORT", XSD_UNSIGNEDSHORT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_UNSIGNEDBYTE", XSD_UNSIGNEDBYTE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_POSITIVEINTEGER", XSD_POSITIVEINTEGER, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_NMTOKENS", XSD_NMTOKENS, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_ANYTYPE", XSD_ANYTYPE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_ANYXML", XSD_ANYXML, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("APACHE_MAP", APACHE_MAP, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("SOAP_ENC_OBJECT", SOAP_ENC_OBJECT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_ENC_ARRAY", SOAP_ENC_ARRAY, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("XSD_1999_TIMEINSTANT", XSD_1999_TIMEINSTANT, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_STRING_CONSTANT("XSD_NAMESPACE", XSD_NAMESPACE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("XSD_1999_NAMESPACE", XSD_1999_NAMESPACE, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("SOAP_SINGLE_ELEMENT_ARRAYS", SOAP_SINGLE_ELEMENT_ARRAYS, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_WAIT_ONE_WAY_CALLS", SOAP_WAIT_ONE_WAY_CALLS, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SOAP_USE_XSI_ARRAY_TYPE", SOAP_USE_XSI_ARRAY_TYPE, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("WSDL_CACHE_NONE", WSDL_CACHE_NONE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("WSDL_CACHE_DISK", WSDL_CACHE_DISK, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("WSDL_CACHE_MEMORY", WSDL_CACHE_MEMORY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("WSDL_CACHE_BOTH", WSDL_CACHE_BOTH, CONST_CS | CONST_PERSISTENT);
+
+ old_error_handler = zend_error_cb;
+ zend_error_cb = soap_error_handler;
+
+ return SUCCESS;
+}
+
+PHP_MINFO_FUNCTION(soap)
+{
+ php_info_print_table_start();
+ php_info_print_table_row(2, "Soap Client", "enabled");
+ php_info_print_table_row(2, "Soap Server", "enabled");
+ php_info_print_table_end();
+ DISPLAY_INI_ENTRIES();
+}
+
+
+/* {{{ proto object SoapParam::SoapParam ( mixed data, string name)
+ SoapParam constructor */
+PHP_METHOD(SoapParam, SoapParam)
+{
+ zval *data;
+ char *name;
+ int name_length;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &data, &name, &name_length) == FAILURE) {
+ return;
+ }
+ if (name_length == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter name");
+ return;
+ }
+
+ add_property_stringl(this_ptr, "param_name", name, name_length, 1);
+ add_property_zval(this_ptr, "param_data", data);
+}
+/* }}} */
+
+
+/* {{{ proto object SoapHeader::SoapHeader ( string namespace, string name [, mixed data [, bool mustUnderstand [, mixed actor]]])
+ SoapHeader constructor */
+PHP_METHOD(SoapHeader, SoapHeader)
+{
+ zval *data = NULL, *actor = NULL;
+ char *name, *ns;
+ int name_len, ns_len;
+ zend_bool must_understand = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|zbz", &ns, &ns_len, &name, &name_len, &data, &must_understand, &actor) == FAILURE) {
+ return;
+ }
+ if (ns_len == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid namespace");
+ return;
+ }
+ if (name_len == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid header name");
+ return;
+ }
+
+ add_property_stringl(this_ptr, "namespace", ns, ns_len, 1);
+ add_property_stringl(this_ptr, "name", name, name_len, 1);
+ if (data) {
+ add_property_zval(this_ptr, "data", data);
+ }
+ add_property_bool(this_ptr, "mustUnderstand", must_understand);
+ if (actor == NULL) {
+ } else if (Z_TYPE_P(actor) == IS_LONG &&
+ (Z_LVAL_P(actor) == SOAP_ACTOR_NEXT ||
+ Z_LVAL_P(actor) == SOAP_ACTOR_NONE ||
+ Z_LVAL_P(actor) == SOAP_ACTOR_UNLIMATERECEIVER)) {
+ add_property_long(this_ptr, "actor", Z_LVAL_P(actor));
+ } else if (Z_TYPE_P(actor) == IS_STRING && Z_STRLEN_P(actor) > 0) {
+ add_property_stringl(this_ptr, "actor", Z_STRVAL_P(actor), Z_STRLEN_P(actor), 1);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid actor");
+ }
+}
+
+/* {{{ proto object SoapFault::SoapFault ( string faultcode, string faultstring [, string faultactor [, mixed detail [, string faultname [, mixed headerfault]]]])
+ SoapFault constructor */
+PHP_METHOD(SoapFault, SoapFault)
+{
+ char *fault_string = NULL, *fault_code = NULL, *fault_actor = NULL, *name = NULL, *fault_code_ns = NULL;
+ int fault_string_len, fault_actor_len = 0, name_len = 0, fault_code_len = 0;
+ zval *code = NULL, *details = NULL, *headerfault = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|s!z!s!z",
+ &code,
+ &fault_string, &fault_string_len,
+ &fault_actor, &fault_actor_len,
+ &details, &name, &name_len, &headerfault) == FAILURE) {
+ return;
+ }
+
+ if (Z_TYPE_P(code) == IS_NULL) {
+ } else if (Z_TYPE_P(code) == IS_STRING) {
+ fault_code = Z_STRVAL_P(code);
+ fault_code_len = Z_STRLEN_P(code);
+ } else if (Z_TYPE_P(code) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(code)) == 2) {
+ zval **t_ns, **t_code;
+
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(code));
+ zend_hash_get_current_data(Z_ARRVAL_P(code), (void**)&t_ns);
+ zend_hash_move_forward(Z_ARRVAL_P(code));
+ zend_hash_get_current_data(Z_ARRVAL_P(code), (void**)&t_code);
+ if (Z_TYPE_PP(t_ns) == IS_STRING && Z_TYPE_PP(t_code) == IS_STRING) {
+ fault_code_ns = Z_STRVAL_PP(t_ns);
+ fault_code = Z_STRVAL_PP(t_code);
+ fault_code_len = Z_STRLEN_PP(t_code);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fault code");
+ return;
+ }
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fault code");
+ return;
+ }
+ if (fault_code != NULL && fault_code_len == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fault code");
+ return;
+ }
+ if (name != NULL && name_len == 0) {
+ name = NULL;
+ }
+
+ set_soap_fault(this_ptr, fault_code_ns, fault_code, fault_string, fault_actor, details, name TSRMLS_CC);
+ if (headerfault != NULL) {
+ add_property_zval(this_ptr, "headerfault", headerfault);
+ }
+}
+/* }}} */
+
+
+/* {{{ proto object SoapFault::SoapFault ( string faultcode, string faultstring [, string faultactor [, mixed detail [, string faultname [, mixed headerfault]]]])
+ SoapFault constructor */
+PHP_METHOD(SoapFault, __toString)
+{
+ zval *faultcode, *faultstring, *file, *line, *trace;
+ char *str;
+ int len;
+ zend_fcall_info fci;
+ zval fname;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
+ faultcode = zend_read_property(soap_fault_class_entry, this_ptr, "faultcode", sizeof("faultcode")-1, 1 TSRMLS_CC);
+ faultstring = zend_read_property(soap_fault_class_entry, this_ptr, "faultstring", sizeof("faultstring")-1, 1 TSRMLS_CC);
+ file = zend_read_property(soap_fault_class_entry, this_ptr, "file", sizeof("file")-1, 1 TSRMLS_CC);
+ line = zend_read_property(soap_fault_class_entry, this_ptr, "line", sizeof("line")-1, 1 TSRMLS_CC);
+
+ ZVAL_STRINGL(&fname, "gettraceasstring", sizeof("gettraceasstring")-1, 0);
+
+ fci.size = sizeof(fci);
+ fci.function_table = &Z_OBJCE_P(getThis())->function_table;
+ fci.function_name = &fname;
+ fci.symbol_table = NULL;
+ fci.object_ptr = getThis();
+ fci.retval_ptr_ptr = &trace;
+ fci.param_count = 0;
+ fci.params = NULL;
+ fci.no_separation = 1;
+
+ zend_call_function(&fci, NULL TSRMLS_CC);
+
+ len = spprintf(&str, 0, "SoapFault exception: [%s] %s in %s:%ld\nStack trace:\n%s",
+ Z_STRVAL_P(faultcode), Z_STRVAL_P(faultstring), Z_STRVAL_P(file), Z_LVAL_P(line),
+ Z_STRLEN_P(trace) ? Z_STRVAL_P(trace) : "#0 {main}\n");
+
+ zval_ptr_dtor(&trace);
+
+ RETURN_STRINGL(str, len, 0);
+}
+/* }}} */
+
+/* {{{ proto object SoapVar::SoapVar ( mixed data, int encoding [, string type_name [, string type_namespace [, string node_name [, string node_namespace]]]])
+ SoapVar constructor */
+PHP_METHOD(SoapVar, SoapVar)
+{
+ zval *data, *type;
+ char *stype = NULL, *ns = NULL, *name = NULL, *namens = NULL;
+ int stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!z|ssss", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) {
+ return;
+ }
+
+ if (Z_TYPE_P(type) == IS_NULL) {
+ add_property_long(this_ptr, "enc_type", UNKNOWN_TYPE);
+ } else {
+ if (zend_hash_index_exists(&SOAP_GLOBAL(defEncIndex), Z_LVAL_P(type))) {
+ add_property_long(this_ptr, "enc_type", Z_LVAL_P(type));
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type ID");
+ return;
+ }
+ }
+
+ if (data) {
+ add_property_zval(this_ptr, "enc_value", data);
+ }
+
+ if (stype && stype_len > 0) {
+ add_property_stringl(this_ptr, "enc_stype", stype, stype_len, 1);
+ }
+ if (ns && ns_len > 0) {
+ add_property_stringl(this_ptr, "enc_ns", ns, ns_len, 1);
+ }
+ if (name && name_len > 0) {
+ add_property_stringl(this_ptr, "enc_name", name, name_len, 1);
+ }
+ if (namens && namens_len > 0) {
+ add_property_stringl(this_ptr, "enc_namens", namens, namens_len, 1);
+ }
+}
+/* }}} */
+
+
+static HashTable* soap_create_typemap(sdlPtr sdl, HashTable *ht TSRMLS_DC)
+{
+ zval **tmp;
+ HashTable *ht2;
+ HashPosition pos1, pos2;
+ HashTable *typemap = NULL;
+
+ zend_hash_internal_pointer_reset_ex(ht, &pos1);
+ while (zend_hash_get_current_data_ex(ht, (void**)&tmp, &pos1) == SUCCESS) {
+ char *type_name = NULL;
+ char *type_ns = NULL;
+ zval *to_xml = NULL;
+ zval *to_zval = NULL;
+ encodePtr enc, new_enc;
+
+ if (Z_TYPE_PP(tmp) != IS_ARRAY) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong 'typemap' option");
+ return NULL;
+ }
+ ht2 = Z_ARRVAL_PP(tmp);
+
+ zend_hash_internal_pointer_reset_ex(ht2, &pos2);
+ while (zend_hash_get_current_data_ex(ht2, (void**)&tmp, &pos2) == SUCCESS) {
+ char *name = NULL;
+ unsigned int name_len;
+ ulong index;
+
+ zend_hash_get_current_key_ex(ht2, &name, &name_len, &index, 0, &pos2);
+ if (name) {
+ if (name_len == sizeof("type_name") &&
+ strncmp(name, "type_name", sizeof("type_name")-1) == 0) {
+ if (Z_TYPE_PP(tmp) == IS_STRING) {
+ type_name = Z_STRVAL_PP(tmp);
+ } else if (Z_TYPE_PP(tmp) != IS_NULL) {
+ }
+ } else if (name_len == sizeof("type_ns") &&
+ strncmp(name, "type_ns", sizeof("type_ns")-1) == 0) {
+ if (Z_TYPE_PP(tmp) == IS_STRING) {
+ type_ns = Z_STRVAL_PP(tmp);
+ } else if (Z_TYPE_PP(tmp) != IS_NULL) {
+ }
+ } else if (name_len == sizeof("to_xml") &&
+ strncmp(name, "to_xml", sizeof("to_xml")-1) == 0) {
+ to_xml = *tmp;
+ } else if (name_len == sizeof("from_xml") &&
+ strncmp(name, "from_xml", sizeof("from_xml")-1) == 0) {
+ to_zval = *tmp;
+ }
+ }
+ zend_hash_move_forward_ex(ht2, &pos2);
+ }
+
+ if (type_name) {
+ smart_str nscat = {0};
+
+ if (type_ns) {
+ enc = get_encoder(sdl, type_ns, type_name);
+ } else {
+ enc = get_encoder_ex(sdl, type_name, strlen(type_name));
+ }
+
+ new_enc = emalloc(sizeof(encode));
+ memset(new_enc, 0, sizeof(encode));
+
+ if (enc) {
+ new_enc->details.type = enc->details.type;
+ new_enc->details.ns = estrdup(enc->details.ns);
+ new_enc->details.type_str = estrdup(enc->details.type_str);
+ new_enc->details.sdl_type = enc->details.sdl_type;
+ } else {
+ enc = get_conversion(UNKNOWN_TYPE);
+ new_enc->details.type = enc->details.type;
+ if (type_ns) {
+ new_enc->details.ns = estrdup(type_ns);
+ }
+ new_enc->details.type_str = estrdup(type_name);
+ }
+ new_enc->to_xml = enc->to_xml;
+ new_enc->to_zval = enc->to_zval;
+ new_enc->details.map = emalloc(sizeof(soapMapping));
+ memset(new_enc->details.map, 0, sizeof(soapMapping));
+ if (to_xml) {
+ zval_add_ref(&to_xml);
+ new_enc->details.map->to_xml = to_xml;
+ new_enc->to_xml = to_xml_user;
+ } else if (enc->details.map && enc->details.map->to_xml) {
+ zval_add_ref(&enc->details.map->to_xml);
+ new_enc->details.map->to_xml = enc->details.map->to_xml;
+ }
+ if (to_zval) {
+ zval_add_ref(&to_zval);
+ new_enc->details.map->to_zval = to_zval;
+ new_enc->to_zval = to_zval_user;
+ } else if (enc->details.map && enc->details.map->to_zval) {
+ zval_add_ref(&enc->details.map->to_zval);
+ new_enc->details.map->to_zval = enc->details.map->to_zval;
+ }
+ if (!typemap) {
+ typemap = emalloc(sizeof(HashTable));
+ zend_hash_init(typemap, 0, NULL, delete_encoder, 0);
+ }
+
+ if (type_ns) {
+ smart_str_appends(&nscat, type_ns);
+ smart_str_appendc(&nscat, ':');
+ }
+ smart_str_appends(&nscat, type_name);
+ smart_str_0(&nscat);
+ zend_hash_update(typemap, nscat.c, nscat.len + 1, &new_enc, sizeof(encodePtr), NULL);
+ smart_str_free(&nscat);
+ }
+ zend_hash_move_forward_ex(ht, &pos1);
+ }
+ return typemap;
+}
+
+
+/* {{{ proto object SoapServer::SoapServer ( mixed wsdl [, array options])
+ SoapServer constructor */
+PHP_METHOD(SoapServer, SoapServer)
+{
+ soapServicePtr service;
+ zval *wsdl = NULL, *options = NULL;
+ int ret;
+ int version = SOAP_1_1;
+ long cache_wsdl;
+ HashTable *typemap_ht = NULL;
+
+ SOAP_SERVER_BEGIN_CODE();
+
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &wsdl, &options) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+ }
+
+ if (Z_TYPE_P(wsdl) != IS_STRING && Z_TYPE_P(wsdl) != IS_NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+ }
+
+ service = emalloc(sizeof(soapService));
+ memset(service, 0, sizeof(soapService));
+ service->send_errors = 1;
+
+ cache_wsdl = SOAP_GLOBAL(cache_enabled) ? SOAP_GLOBAL(cache_mode) : 0;
+
+ if (options != NULL) {
+ HashTable *ht = Z_ARRVAL_P(options);
+ zval **tmp;
+
+ if (zend_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) {
+ if (Z_TYPE_PP(tmp) == IS_LONG &&
+ (Z_LVAL_PP(tmp) == SOAP_1_1 || Z_LVAL_PP(tmp) == SOAP_1_2)) {
+ version = Z_LVAL_PP(tmp);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "'soap_version' option must be SOAP_1_1 or SOAP_1_2");
+ }
+ }
+
+ if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ service->uri = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ } else if (Z_TYPE_P(wsdl) == IS_NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is required in nonWSDL mode");
+ }
+
+ if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ service->actor = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ }
+
+ if (zend_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ xmlCharEncodingHandlerPtr encoding;
+
+ encoding = xmlFindCharEncodingHandler(Z_STRVAL_PP(tmp));
+ if (encoding == NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid 'encoding' option - '%s'", Z_STRVAL_PP(tmp));
+ } else {
+ service->encoding = encoding;
+ }
+ }
+
+ if (zend_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_ARRAY) {
+ zval *ztmp;
+
+ ALLOC_HASHTABLE(service->class_map);
+ zend_hash_init(service->class_map, zend_hash_num_elements((*tmp)->value.ht), NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(service->class_map, (*tmp)->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &ztmp, sizeof(zval *));
+ }
+
+ if (zend_hash_find(ht, "typemap", sizeof("typemap"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_ARRAY &&
+ zend_hash_num_elements(Z_ARRVAL_PP(tmp)) > 0) {
+ typemap_ht = Z_ARRVAL_PP(tmp);
+ }
+
+ if (zend_hash_find(ht, "features", sizeof("features"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_LONG) {
+ service->features = Z_LVAL_PP(tmp);
+ }
+
+ if (zend_hash_find(ht, "cache_wsdl", sizeof("cache_wsdl"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_LONG) {
+ cache_wsdl = Z_LVAL_PP(tmp);
+ }
+
+ if (zend_hash_find(ht, "send_errors", sizeof("send_errors"), (void**)&tmp) == SUCCESS &&
+ (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG)) {
+ service->send_errors = Z_LVAL_PP(tmp);
+ }
+
+ } else if (Z_TYPE_P(wsdl) == IS_NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is required in nonWSDL mode");
+ }
+
+ service->version = version;
+ service->type = SOAP_FUNCTIONS;
+ service->soap_functions.functions_all = FALSE;
+ service->soap_functions.ft = emalloc(sizeof(HashTable));
+ zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0);
+
+ if (Z_TYPE_P(wsdl) != IS_NULL) {
+ service->sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl), cache_wsdl TSRMLS_CC);
+ if (service->uri == NULL) {
+ if (service->sdl->target_ns) {
+ service->uri = estrdup(service->sdl->target_ns);
+ } else {
+ /*FIXME*/
+ service->uri = estrdup("http://unknown-uri/");
+ }
+ }
+ }
+
+ if (typemap_ht) {
+ service->typemap = soap_create_typemap(service->sdl, typemap_ht TSRMLS_CC);
+ }
+
+ ret = zend_list_insert(service, le_service TSRMLS_CC);
+ add_property_resource(this_ptr, "service", ret);
+
+ SOAP_SERVER_END_CODE();
+}
+/* }}} */
+
+
+/* {{{ proto object SoapServer::setPersistence ( int mode )
+ Sets persistence mode of SoapServer */
+PHP_METHOD(SoapServer, setPersistence)
+{
+ soapServicePtr service;
+ long value;
+
+ SOAP_SERVER_BEGIN_CODE();
+
+ FETCH_THIS_SERVICE(service);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) != FAILURE) {
+ if (service->type == SOAP_CLASS) {
+ if (value == SOAP_PERSISTENCE_SESSION ||
+ value == SOAP_PERSISTENCE_REQUEST) {
+ service->soap_class.persistance = value;
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set persistence with bogus value (%ld)", value);
+ return;
+ }
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set persistence when you are using you SOAP SERVER in function mode, no persistence needed");
+ return;
+ }
+ }
+
+ SOAP_SERVER_END_CODE();
+}
+/* }}} */
+
+
+/* {{{ proto void SoapServer::setClass(string class_name [, mixed args])
+ Sets class which will handle SOAP requests */
+PHP_METHOD(SoapServer, setClass)
+{
+ soapServicePtr service;
+ char *classname;
+ zend_class_entry **ce;
+
+ int classname_len, found, num_args = 0;
+ zval ***argv = NULL;
+
+ SOAP_SERVER_BEGIN_CODE();
+
+ FETCH_THIS_SERVICE(service);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s*", &classname, &classname_len, &argv, &num_args) == FAILURE) {
+ return;
+ }
+
+ found = zend_lookup_class(classname, classname_len, &ce TSRMLS_CC);
+
+ if (found != FAILURE) {
+ service->type = SOAP_CLASS;
+ service->soap_class.ce = *ce;
+
+ service->soap_class.persistance = SOAP_PERSISTENCE_REQUEST;
+ service->soap_class.argc = num_args;
+ if (service->soap_class.argc > 0) {
+ int i;
+ service->soap_class.argv = safe_emalloc(sizeof(zval), service->soap_class.argc, 0);
+ for (i = 0;i < service->soap_class.argc;i++) {
+ service->soap_class.argv[i] = *(argv[i]);
+ zval_add_ref(&service->soap_class.argv[i]);
+ }
+ }
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set a non existant class (%s)", classname);
+ return;
+ }
+
+ if (argv) {
+ efree(argv);
+ }
+
+ SOAP_SERVER_END_CODE();
+}
+/* }}} */
+
+
+/* {{{ proto void SoapServer::setObject(object)
+ Sets object which will handle SOAP requests */
+PHP_METHOD(SoapServer, setObject)
+{
+ soapServicePtr service;
+ zval *obj;
+
+ SOAP_SERVER_BEGIN_CODE();
+
+ FETCH_THIS_SERVICE(service);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ return;
+ }
+
+ service->type = SOAP_OBJECT;
+
+ MAKE_STD_ZVAL(service->soap_object);
+ MAKE_COPY_ZVAL(&obj, service->soap_object);
+
+ SOAP_SERVER_END_CODE();
+}
+/* }}} */
+
+
+/* {{{ proto array SoapServer::getFunctions(void)
+ Returns list of defined functions */
+PHP_METHOD(SoapServer, getFunctions)
+{
+ soapServicePtr service;
+ HashTable *ft = NULL;
+
+ SOAP_SERVER_BEGIN_CODE();
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
+ FETCH_THIS_SERVICE(service);
+
+ array_init(return_value);
+ if (service->type == SOAP_OBJECT) {
+ ft = &(Z_OBJCE_P(service->soap_object)->function_table);
+ } else if (service->type == SOAP_CLASS) {
+ ft = &service->soap_class.ce->function_table;
+ } else if (service->soap_functions.functions_all == TRUE) {
+ ft = EG(function_table);
+ } else if (service->soap_functions.ft != NULL) {
+ zval **name;
+ HashPosition pos;
+
+ zend_hash_internal_pointer_reset_ex(service->soap_functions.ft, &pos);
+ while (zend_hash_get_current_data_ex(service->soap_functions.ft, (void **)&name, &pos) != FAILURE) {
+ add_next_index_string(return_value, Z_STRVAL_PP(name), 1);
+ zend_hash_move_forward_ex(service->soap_functions.ft, &pos);
+ }
+ }
+ if (ft != NULL) {
+ zend_function *f;
+ HashPosition pos;
+ zend_hash_internal_pointer_reset_ex(ft, &pos);
+ while (zend_hash_get_current_data_ex(ft, (void **)&f, &pos) != FAILURE) {
+ if ((service->type != SOAP_OBJECT && service->type != SOAP_CLASS) || (f->common.fn_flags & ZEND_ACC_PUBLIC)) {
+ add_next_index_string(return_value, f->common.function_name, 1);
+ }
+ zend_hash_move_forward_ex(ft, &pos);
+ }
+ }
+
+ SOAP_SERVER_END_CODE();
+}
+/* }}} */
+
+
+/* {{{ proto void SoapServer::addFunction(mixed functions)
+ Adds one or several functions those will handle SOAP requests */
+PHP_METHOD(SoapServer, addFunction)
+{
+ soapServicePtr service;
+ zval *function_name, *function_copy;
+ HashPosition pos;
+
+ SOAP_SERVER_BEGIN_CODE();
+
+ FETCH_THIS_SERVICE(service);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &function_name) == FAILURE) {
+ return;
+ }
+
+ /* TODO: could use zend_is_callable here */
+
+ if (function_name->type == IS_ARRAY) {
+ if (service->type == SOAP_FUNCTIONS) {
+ zval **tmp_function, *function_copy;
+
+ if (service->soap_functions.ft == NULL) {
+ service->soap_functions.functions_all = FALSE;
+ service->soap_functions.ft = emalloc(sizeof(HashTable));
+ zend_hash_init(service->soap_functions.ft, zend_hash_num_elements(Z_ARRVAL_P(function_name)), NULL, ZVAL_PTR_DTOR, 0);
+ }
+
+ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(function_name), &pos);
+ while (zend_hash_get_current_data_ex(Z_ARRVAL_P(function_name), (void **)&tmp_function, &pos) != FAILURE) {
+ char *key;
+ int key_len;
+ zend_function *f;
+
+ if (Z_TYPE_PP(tmp_function) != IS_STRING) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a function that isn't a string");
+ return;
+ }
+
+ key_len = Z_STRLEN_PP(tmp_function);
+ key = emalloc(key_len + 1);
+ zend_str_tolower_copy(key, Z_STRVAL_PP(tmp_function), key_len);
+
+ if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existant function '%s'", Z_STRVAL_PP(tmp_function));
+ return;
+ }
+
+ MAKE_STD_ZVAL(function_copy);
+ ZVAL_STRING(function_copy, f->common.function_name, 1);
+ zend_hash_update(service->soap_functions.ft, key, key_len+1, &function_copy, sizeof(zval *), NULL);
+
+ efree(key);
+ zend_hash_move_forward_ex(Z_ARRVAL_P(function_name), &pos);
+ }
+ }
+ } else if (function_name->type == IS_STRING) {
+ char *key;
+ int key_len;
+ zend_function *f;
+
+ key_len = Z_STRLEN_P(function_name);
+ key = emalloc(key_len + 1);
+ zend_str_tolower_copy(key, Z_STRVAL_P(function_name), key_len);
+
+ if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existant function '%s'", Z_STRVAL_P(function_name));
+ return;
+ }
+ if (service->soap_functions.ft == NULL) {
+ service->soap_functions.functions_all = FALSE;
+ service->soap_functions.ft = emalloc(sizeof(HashTable));
+ zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0);
+ }
+
+ MAKE_STD_ZVAL(function_copy);
+ ZVAL_STRING(function_copy, f->common.function_name, 1);
+ zend_hash_update(service->soap_functions.ft, key, key_len+1, &function_copy, sizeof(zval *), NULL);
+ efree(key);
+ } else if (function_name->type == IS_LONG) {
+ if (Z_LVAL_P(function_name) == SOAP_FUNCTIONS_ALL) {
+ if (service->soap_functions.ft != NULL) {
+ zend_hash_destroy(service->soap_functions.ft);
+ efree(service->soap_functions.ft);
+ service->soap_functions.ft = NULL;
+ }
+ service->soap_functions.functions_all = TRUE;
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value passed");
+ return;
+ }
+ }
+
+ SOAP_SERVER_END_CODE();
+}
+/* }}} */
+
+
+/* {{{ proto void SoapServer::handle ( [string soap_request])
+ Handles a SOAP request */
+PHP_METHOD(SoapServer, handle)
+{
+ int soap_version, old_soap_version;
+ sdlPtr old_sdl = NULL;
+ soapServicePtr service;
+ xmlDocPtr doc_request=NULL, doc_return;
+ zval function_name, **params, *soap_obj, *retval;
+ char *fn_name, cont_len[30];
+ int num_params = 0, size, i, call_status = 0;
+ xmlChar *buf;
+ HashTable *function_table;
+ soapHeader *soap_headers = NULL;
+ sdlFunctionPtr function;
+ char *arg = NULL;
+ int arg_len = 0;
+ xmlCharEncodingHandlerPtr old_encoding;
+ HashTable *old_class_map, *old_typemap;
+ int old_features;
+
+ SOAP_SERVER_BEGIN_CODE();
+
+ FETCH_THIS_SERVICE(service);
+ SOAP_GLOBAL(soap_version) = service->version;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
+ return;
+ }
+
+ if (SG(request_info).request_method &&
+ strcmp(SG(request_info).request_method, "GET") == 0 &&
+ SG(request_info).query_string &&
+ stricmp(SG(request_info).query_string, "wsdl") == 0) {
+
+ if (service->sdl) {
+/*
+ char *hdr = emalloc(sizeof("Location: ")+strlen(service->sdl->source));
+ strcpy(hdr,"Location: ");
+ strcat(hdr,service->sdl->source);
+ sapi_add_header(hdr, sizeof("Location: ")+strlen(service->sdl->source)-1, 1);
+ efree(hdr);
+*/
+ zval readfile, readfile_ret, *param;
+
+ INIT_ZVAL(readfile);
+ INIT_ZVAL(readfile_ret);
+ MAKE_STD_ZVAL(param);
+
+ sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1);
+ ZVAL_STRING(param, service->sdl->source, 1);
+ ZVAL_STRING(&readfile, "readfile", 1);
+ if (call_user_function(EG(function_table), NULL, &readfile, &readfile_ret, 1, &param TSRMLS_CC) == FAILURE) {
+ soap_server_fault("Server", "Couldn't find WSDL", NULL, NULL, NULL TSRMLS_CC);
+ }
+
+ zval_ptr_dtor(&param);
+ zval_dtor(&readfile);
+ zval_dtor(&readfile_ret);
+
+ SOAP_SERVER_END_CODE();
+ return;
+ } else {
+ soap_server_fault("Server", "WSDL generation is not supported yet", NULL, NULL, NULL TSRMLS_CC);
+/*
+ sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8"), 1);
+ PUTS("<?xml version=\"1.0\" ?>\n<definitions\n");
+ PUTS(" xmlns=\"http://schemas.xmlsoap.org/wsdl/\"\n");
+ PUTS(" targetNamespace=\"");
+ PUTS(service->uri);
+ PUTS("\">\n");
+ PUTS("</definitions>");
+*/
+ SOAP_SERVER_END_CODE();
+ return;
+ }
+ }
+
+ ALLOC_INIT_ZVAL(retval);
+
+ if (php_output_start_default(TSRMLS_C) != SUCCESS) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR,"ob_start failed");
+ }
+
+ if (ZEND_NUM_ARGS() == 0) {
+ if (SG(request_info).raw_post_data) {
+ char *post_data = SG(request_info).raw_post_data;
+ int post_data_length = SG(request_info).raw_post_data_length;
+ zval **server_vars, **encoding;
+
+ zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC);
+ if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &server_vars) == SUCCESS &&
+ Z_TYPE_PP(server_vars) == IS_ARRAY &&
+ zend_hash_find(Z_ARRVAL_PP(server_vars), "HTTP_CONTENT_ENCODING", sizeof("HTTP_CONTENT_ENCODING"), (void **) &encoding)==SUCCESS &&
+ Z_TYPE_PP(encoding) == IS_STRING) {
+ zval func;
+ zval retval;
+ zval param;
+ zval *params[1];
+
+ if ((strcmp(Z_STRVAL_PP(encoding),"gzip") == 0 ||
+ strcmp(Z_STRVAL_PP(encoding),"x-gzip") == 0) &&
+ zend_hash_exists(EG(function_table), "gzinflate", sizeof("gzinflate"))) {
+ ZVAL_STRING(&func, "gzinflate", 0);
+ params[0] = &param;
+ ZVAL_STRINGL(params[0], post_data+10, post_data_length-10, 0);
+ INIT_PZVAL(params[0]);
+ } else if (strcmp(Z_STRVAL_PP(encoding),"deflate") == 0 &&
+ zend_hash_exists(EG(function_table), "gzuncompress", sizeof("gzuncompress"))) {
+ ZVAL_STRING(&func, "gzuncompress", 0);
+ params[0] = &param;
+ ZVAL_STRINGL(params[0], post_data, post_data_length, 0);
+ INIT_PZVAL(params[0]);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Request is compressed with unknown compression '%s'",Z_STRVAL_PP(encoding));
+ return;
+ }
+ if (call_user_function(CG(function_table), (zval**)NULL, &func, &retval, 1, params TSRMLS_CC) == SUCCESS &&
+ Z_TYPE(retval) == IS_STRING) {
+ doc_request = soap_xmlParseMemory(Z_STRVAL(retval),Z_STRLEN(retval));
+ zval_dtor(&retval);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Can't uncompress compressed request");
+ return;
+ }
+ } else {
+ doc_request = soap_xmlParseMemory(post_data, post_data_length);
+ }
+ } else {
+ zval_ptr_dtor(&retval);
+ return;
+ }
+ } else {
+ doc_request = soap_xmlParseMemory(arg,arg_len);
+ }
+
+ if (doc_request == NULL) {
+ soap_server_fault("Client", "Bad Request", NULL, NULL, NULL TSRMLS_CC);
+ }
+ if (xmlGetIntSubset(doc_request) != NULL) {
+ xmlNodePtr env = get_node(doc_request->children,"Envelope");
+ if (env && env->ns) {
+ if (strcmp((char*)env->ns->href, SOAP_1_1_ENV_NAMESPACE) == 0) {
+ SOAP_GLOBAL(soap_version) = SOAP_1_1;
+ } else if (strcmp((char*)env->ns->href,SOAP_1_2_ENV_NAMESPACE) == 0) {
+ SOAP_GLOBAL(soap_version) = SOAP_1_2;
+ }
+ }
+ xmlFreeDoc(doc_request);
+ soap_server_fault("Server", "DTD are not supported by SOAP", NULL, NULL, NULL TSRMLS_CC);
+ }
+
+ old_sdl = SOAP_GLOBAL(sdl);
+ SOAP_GLOBAL(sdl) = service->sdl;
+ old_encoding = SOAP_GLOBAL(encoding);
+ SOAP_GLOBAL(encoding) = service->encoding;
+ old_class_map = SOAP_GLOBAL(class_map);
+ SOAP_GLOBAL(class_map) = service->class_map;
+ old_typemap = SOAP_GLOBAL(typemap);
+ SOAP_GLOBAL(typemap) = service->typemap;
+ old_features = SOAP_GLOBAL(features);
+ SOAP_GLOBAL(features) = service->features;
+ old_soap_version = SOAP_GLOBAL(soap_version);
+ function = deserialize_function_call(service->sdl, doc_request, service->actor, &function_name, &num_params, &params, &soap_version, &soap_headers TSRMLS_CC);
+ xmlFreeDoc(doc_request);
+
+ if (EG(exception)) {
+ php_output_discard(TSRMLS_C);
+ if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {
+ soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC);
+ }
+ goto fail;
+ }
+
+ service->soap_headers_ptr = &soap_headers;
+
+ soap_obj = NULL;
+ if (service->type == SOAP_OBJECT) {
+ soap_obj = service->soap_object;
+ function_table = &((Z_OBJCE_P(soap_obj))->function_table);
+ } else if (service->type == SOAP_CLASS) {
+#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
+ /* If persistent then set soap_obj from from the previous created session (if available) */
+ if (service->soap_class.persistance == SOAP_PERSISTENCE_SESSION) {
+ zval **tmp_soap;
+
+ if (PS(session_status) != php_session_active &&
+ PS(session_status) != php_session_disabled) {
+ php_session_start(TSRMLS_C);
+ }
+
+ /* Find the soap object and assign */
+ if (zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), "_bogus_session_name", sizeof("_bogus_session_name"), (void **) &tmp_soap) == SUCCESS &&
+ Z_TYPE_PP(tmp_soap) == IS_OBJECT &&
+ Z_OBJCE_PP(tmp_soap) == service->soap_class.ce) {
+ soap_obj = *tmp_soap;
+ }
+ }
+#endif
+ /* If new session or something wierd happned */
+ if (soap_obj == NULL) {
+ zval *tmp_soap;
+
+ MAKE_STD_ZVAL(tmp_soap);
+ object_init_ex(tmp_soap, service->soap_class.ce);
+
+ /* Call constructor */
+ if (zend_hash_exists(&Z_OBJCE_P(tmp_soap)->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) {
+ zval c_ret, constructor;
+
+ INIT_ZVAL(c_ret);
+ INIT_ZVAL(constructor);
+
+ ZVAL_STRING(&constructor, ZEND_CONSTRUCTOR_FUNC_NAME, 1);
+ if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor");
+ }
+ if (EG(exception)) {
+ php_output_discard(TSRMLS_C);
+ if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {
+ soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC);
+ }
+ zval_dtor(&constructor);
+ zval_dtor(&c_ret);
+ zval_ptr_dtor(&tmp_soap);
+ goto fail;
+ }
+ zval_dtor(&constructor);
+ zval_dtor(&c_ret);
+ } else {
+ int class_name_len = strlen(service->soap_class.ce->name);
+ char *class_name = emalloc(class_name_len+1);
+
+ memcpy(class_name, service->soap_class.ce->name,class_name_len+1);
+ if (zend_hash_exists(&Z_OBJCE_P(tmp_soap)->function_table, php_strtolower(class_name, class_name_len), class_name_len+1)) {
+ zval c_ret, constructor;
+
+ INIT_ZVAL(c_ret);
+ INIT_ZVAL(constructor);
+
+ ZVAL_STRING(&constructor, service->soap_class.ce->name, 1);
+ if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor");
+ }
+
+ if (EG(exception)) {
+ php_output_discard(TSRMLS_C);
+ if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {
+ soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC);
+ }
+ zval_dtor(&constructor);
+ zval_dtor(&c_ret);
+ efree(class_name);
+ zval_ptr_dtor(&tmp_soap);
+ goto fail;
+ }
+
+ zval_dtor(&constructor);
+ zval_dtor(&c_ret);
+ }
+ efree(class_name);
+ }
+#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
+ /* If session then update session hash with new object */
+ if (service->soap_class.persistance == SOAP_PERSISTENCE_SESSION) {
+ zval **tmp_soap_pp;
+ if (zend_hash_update(Z_ARRVAL_P(PS(http_session_vars)), "_bogus_session_name", sizeof("_bogus_session_name"), &tmp_soap, sizeof(zval *), (void **)&tmp_soap_pp) == SUCCESS) {
+ soap_obj = *tmp_soap_pp;
+ }
+ } else {
+ soap_obj = tmp_soap;
+ }
+#else
+ soap_obj = tmp_soap;
+#endif
+
+ }
+ function_table = &((Z_OBJCE_P(soap_obj))->function_table);
+ } else {
+ if (service->soap_functions.functions_all == TRUE) {
+ function_table = EG(function_table);
+ } else {
+ function_table = service->soap_functions.ft;
+ }
+ }
+
+ doc_return = NULL;
+
+ /* Process soap headers */
+ if (soap_headers != NULL) {
+ soapHeader *header = soap_headers;
+ while (header != NULL) {
+ soapHeader *h = header;
+
+ header = header->next;
+#if 0
+ if (service->sdl && !h->function && !h->hdr) {
+ if (h->mustUnderstand) {
+ soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL TSRMLS_CC);
+ } else {
+ continue;
+ }
+ }
+#endif
+ fn_name = estrndup(Z_STRVAL(h->function_name),Z_STRLEN(h->function_name));
+ if (zend_hash_exists(function_table, php_strtolower(fn_name, Z_STRLEN(h->function_name)), Z_STRLEN(h->function_name) + 1) ||
+ ((service->type == SOAP_CLASS || service->type == SOAP_OBJECT) &&
+ zend_hash_exists(function_table, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)))) {
+ if (service->type == SOAP_CLASS || service->type == SOAP_OBJECT) {
+ call_status = call_user_function(NULL, &soap_obj, &h->function_name, &h->retval, h->num_params, h->parameters TSRMLS_CC);
+ } else {
+ call_status = call_user_function(EG(function_table), NULL, &h->function_name, &h->retval, h->num_params, h->parameters TSRMLS_CC);
+ }
+ if (call_status != SUCCESS) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function '%s' call failed", Z_STRVAL(h->function_name));
+ return;
+ }
+ if (Z_TYPE(h->retval) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE(h->retval), soap_fault_class_entry TSRMLS_CC)) {
+ zval *headerfault = NULL, **tmp;
+
+ if (zend_hash_find(Z_OBJPROP(h->retval), "headerfault", sizeof("headerfault"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) != IS_NULL) {
+ headerfault = *tmp;
+ }
+ php_output_discard(TSRMLS_C);
+ soap_server_fault_ex(function, &h->retval, h TSRMLS_CC);
+ efree(fn_name);
+ if (service->type == SOAP_CLASS && soap_obj) {zval_ptr_dtor(&soap_obj);}
+ goto fail;
+ } else if (EG(exception)) {
+ php_output_discard(TSRMLS_C);
+ if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {
+ zval *headerfault = NULL, **tmp;
+
+ if (zend_hash_find(Z_OBJPROP_P(EG(exception)), "headerfault", sizeof("headerfault"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) != IS_NULL) {
+ headerfault = *tmp;
+ }
+ soap_server_fault_ex(function, EG(exception), h TSRMLS_CC);
+ }
+ efree(fn_name);
+ if (service->type == SOAP_CLASS && soap_obj) {zval_ptr_dtor(&soap_obj);}
+ goto fail;
+ }
+ } else if (h->mustUnderstand) {
+ soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL TSRMLS_CC);
+ }
+ efree(fn_name);
+ }
+ }
+
+ fn_name = estrndup(Z_STRVAL(function_name),Z_STRLEN(function_name));
+ if (zend_hash_exists(function_table, php_strtolower(fn_name, Z_STRLEN(function_name)), Z_STRLEN(function_name) + 1) ||
+ ((service->type == SOAP_CLASS || service->type == SOAP_OBJECT) &&
+ zend_hash_exists(function_table, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)))) {
+ if (service->type == SOAP_CLASS || service->type == SOAP_OBJECT) {
+ call_status = call_user_function(NULL, &soap_obj, &function_name, retval, num_params, params TSRMLS_CC);
+ if (service->type == SOAP_CLASS) {
+#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
+ if (service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
+ zval_ptr_dtor(&soap_obj);
+ soap_obj = NULL;
+ }
+#else
+ zval_ptr_dtor(&soap_obj);
+ soap_obj = NULL;
+#endif
+ }
+ } else {
+ call_status = call_user_function(EG(function_table), NULL, &function_name, retval, num_params, params TSRMLS_CC);
+ }
+ } else {
+ php_error(E_ERROR, "Function '%s' doesn't exist", Z_STRVAL(function_name));
+ }
+ efree(fn_name);
+
+ if (EG(exception)) {
+ php_output_discard(TSRMLS_C);
+ if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {
+ soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC);
+ }
+ if (service->type == SOAP_CLASS) {
+#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
+ if (soap_obj && service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
+#else
+ if (soap_obj) {
+#endif
+ zval_ptr_dtor(&soap_obj);
+ }
+ }
+ goto fail;
+ }
+
+ if (call_status == SUCCESS) {
+ char *response_name;
+
+ if (Z_TYPE_P(retval) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(retval), soap_fault_class_entry TSRMLS_CC)) {
+ php_output_discard(TSRMLS_C);
+ soap_server_fault_ex(function, retval, NULL TSRMLS_CC);
+ goto fail;
+ }
+
+ if (function && function->responseName) {
+ response_name = estrdup(function->responseName);
+ } else {
+ response_name = emalloc(Z_STRLEN(function_name) + sizeof("Response"));
+ memcpy(response_name,Z_STRVAL(function_name),Z_STRLEN(function_name));
+ memcpy(response_name+Z_STRLEN(function_name),"Response",sizeof("Response"));
+ }
+ doc_return = serialize_response_call(function, response_name, service->uri, retval, soap_headers, soap_version TSRMLS_CC);
+ efree(response_name);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function '%s' call failed", Z_STRVAL(function_name));
+ return;
+ }
+
+ if (EG(exception)) {
+ php_output_discard(TSRMLS_C);
+ if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {
+ soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC);
+ }
+ if (service->type == SOAP_CLASS) {
+#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
+ if (soap_obj && service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
+#else
+ if (soap_obj) {
+#endif
+ zval_ptr_dtor(&soap_obj);
+ }
+ }
+ goto fail;
+ }
+
+ /* Flush buffer */
+ php_output_discard(TSRMLS_C);
+
+ if (doc_return) {
+ /* xmlDocDumpMemoryEnc(doc_return, &buf, &size, XML_CHAR_ENCODING_UTF8); */
+ xmlDocDumpMemory(doc_return, &buf, &size);
+
+ if (size == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Dump memory failed");
+ }
+
+ if (soap_version == SOAP_1_2) {
+ sapi_add_header("Content-Type: application/soap+xml; charset=utf-8", sizeof("Content-Type: application/soap+xml; charset=utf-8")-1, 1);
+ } else {
+ sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1);
+ }
+
+ xmlFreeDoc(doc_return);
+
+ if (zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0)) {
+ sapi_add_header("Connection: close", sizeof("Connection: close")-1, 1);
+ } else {
+ snprintf(cont_len, sizeof(cont_len), "Content-Length: %d", size);
+ sapi_add_header(cont_len, strlen(cont_len), 1);
+ }
+ php_write(buf, size TSRMLS_CC);
+ xmlFree(buf);
+ } else {
+ sapi_add_header("HTTP/1.1 202 Accepted", sizeof("HTTP/1.1 202 Accepted")-1, 1);
+ sapi_add_header("Content-Length: 0", sizeof("Content-Length: 0")-1, 1);
+ }
+
+fail:
+ SOAP_GLOBAL(soap_version) = old_soap_version;
+ SOAP_GLOBAL(encoding) = old_encoding;
+ SOAP_GLOBAL(sdl) = old_sdl;
+ SOAP_GLOBAL(class_map) = old_class_map;
+ SOAP_GLOBAL(typemap) = old_typemap;
+ SOAP_GLOBAL(features) = old_features;
+
+ /* Free soap headers */
+ zval_ptr_dtor(&retval);
+ while (soap_headers != NULL) {
+ soapHeader *h = soap_headers;
+ int i;
+
+ soap_headers = soap_headers->next;
+ if (h->parameters) {
+ i = h->num_params;
+ while (i > 0) {
+ zval_ptr_dtor(&h->parameters[--i]);
+ }
+ efree(h->parameters);
+ }
+ zval_dtor(&h->function_name);
+ zval_dtor(&h->retval);
+ efree(h);
+ }
+ service->soap_headers_ptr = NULL;
+
+ /* Free Memory */
+ if (num_params > 0) {
+ for (i = 0; i < num_params;i++) {
+ zval_ptr_dtor(&params[i]);
+ }
+ efree(params);
+ }
+ zval_dtor(&function_name);
+
+ SOAP_SERVER_END_CODE();
+}
+/* }}} */
+
+
+/* {{{ proto SoapServer::fault ( staring code, string string [, string actor [, mixed details [, string name]]] )
+ Issue SoapFault indicating an error */
+PHP_METHOD(SoapServer, fault)
+{
+ char *code, *string, *actor=NULL, *name=NULL;
+ int code_len, string_len, actor_len = 0, name_len = 0;
+ zval* details = NULL;
+ soapServicePtr service;
+ xmlCharEncodingHandlerPtr old_encoding;
+
+ SOAP_SERVER_BEGIN_CODE();
+ FETCH_THIS_SERVICE(service);
+ old_encoding = SOAP_GLOBAL(encoding);
+ SOAP_GLOBAL(encoding) = service->encoding;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|szs",
+ &code, &code_len, &string, &string_len, &actor, &actor_len, &details,
+ &name, &name_len) == FAILURE) {
+ return;
+ }
+
+ soap_server_fault(code, string, actor, details, name TSRMLS_CC);
+
+ SOAP_GLOBAL(encoding) = old_encoding;
+ SOAP_SERVER_END_CODE();
+}
+/* }}} */
+
+PHP_METHOD(SoapServer, addSoapHeader)
+{
+ soapServicePtr service;
+ zval *fault;
+ soapHeader **p;
+
+ SOAP_SERVER_BEGIN_CODE();
+
+ FETCH_THIS_SERVICE(service);
+
+ if (!service || !service->soap_headers_ptr) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The SoapServer::addSoapHeader function may be called only during SOAP request processing");
+ return;
+ }
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &fault, soap_header_class_entry) == FAILURE) {
+ return;
+ }
+
+ p = service->soap_headers_ptr;
+ while (*p != NULL) {
+ p = &(*p)->next;
+ }
+ *p = emalloc(sizeof(soapHeader));
+ memset(*p, 0, sizeof(soapHeader));
+ ZVAL_NULL(&(*p)->function_name);
+ (*p)->retval = *fault;
+ zval_copy_ctor(&(*p)->retval);
+
+ SOAP_SERVER_END_CODE();
+}
+
+static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader *hdr TSRMLS_DC)
+{
+ int soap_version;
+ xmlChar *buf;
+ char cont_len[30];
+ int size;
+ xmlDocPtr doc_return;
+ zval **agent_name;
+ int use_http_error_status = 1;
+
+ soap_version = SOAP_GLOBAL(soap_version);
+
+ doc_return = serialize_response_call(function, NULL, NULL, fault, hdr, soap_version TSRMLS_CC);
+
+ xmlDocDumpMemory(doc_return, &buf, &size);
+
+ zend_is_auto_global("_SERVER", sizeof("_SERVER") - 1 TSRMLS_CC);
+ if (PG(http_globals)[TRACK_VARS_SERVER] &&
+ zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name) == SUCCESS &&
+ Z_TYPE_PP(agent_name) == IS_STRING) {
+ if (strncmp(Z_STRVAL_PP(agent_name), "Shockwave Flash", sizeof("Shockwave Flash")-1) == 0) {
+ use_http_error_status = 0;
+ }
+ }
+ /*
+ Want to return HTTP 500 but apache wants to over write
+ our fault code with their own handling... Figure this out later
+ */
+ if (use_http_error_status) {
+ sapi_add_header("HTTP/1.1 500 Internal Service Error", sizeof("HTTP/1.1 500 Internal Service Error")-1, 1);
+ }
+ if (zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0)) {
+ sapi_add_header("Connection: close", sizeof("Connection: close")-1, 1);
+ } else {
+ snprintf(cont_len, sizeof(cont_len), "Content-Length: %d", size);
+ sapi_add_header(cont_len, strlen(cont_len), 1);
+ }
+ if (soap_version == SOAP_1_2) {
+ sapi_add_header("Content-Type: application/soap+xml; charset=utf-8", sizeof("Content-Type: application/soap+xml; charset=utf-8")-1, 1);
+ } else {
+ sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1);
+ }
+
+ php_write(buf, size TSRMLS_CC);
+
+ xmlFreeDoc(doc_return);
+ xmlFree(buf);
+ zend_clear_exception(TSRMLS_C);
+}
+
+static void soap_server_fault(char* code, char* string, char *actor, zval* details, char* name TSRMLS_DC)
+{
+ zval ret;
+
+ INIT_ZVAL(ret);
+
+ set_soap_fault(&ret, NULL, code, string, actor, details, name TSRMLS_CC);
+ /* TODO: Which function */
+ soap_server_fault_ex(NULL, &ret, NULL TSRMLS_CC);
+ zend_bailout();
+}
+
+static void soap_error_handler(int error_num, const char *error_filename, const uint error_lineno, const char *format, va_list args)
+{
+ zend_bool _old_in_compilation, _old_in_execution;
+ zend_execute_data *_old_current_execute_data;
+ int _old_http_response_code;
+ char *_old_http_status_line;
+ TSRMLS_FETCH();
+
+ _old_in_compilation = CG(in_compilation);
+ _old_in_execution = EG(in_execution);
+ _old_current_execute_data = EG(current_execute_data);
+ _old_http_response_code = SG(sapi_headers).http_response_code;
+ _old_http_status_line = SG(sapi_headers).http_status_line;
+
+ if (!SOAP_GLOBAL(use_soap_error_handler) || !EG(objects_store).object_buckets) {
+ call_old_error_handler(error_num, error_filename, error_lineno, format, args);
+ return;
+ }
+
+ if (SOAP_GLOBAL(error_object) &&
+ Z_TYPE_P(SOAP_GLOBAL(error_object)) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(SOAP_GLOBAL(error_object)), soap_class_entry TSRMLS_CC)) {
+ zval **tmp;
+ int use_exceptions = 0;
+
+ if (zend_hash_find(Z_OBJPROP_P(SOAP_GLOBAL(error_object)), "_exceptions", sizeof("_exceptions"), (void **) &tmp) != SUCCESS ||
+ Z_TYPE_PP(tmp) != IS_BOOL || Z_LVAL_PP(tmp) != 0) {
+ use_exceptions = 1;
+ }
+
+ if ((error_num == E_USER_ERROR ||
+ error_num == E_COMPILE_ERROR ||
+ error_num == E_CORE_ERROR ||
+ error_num == E_ERROR ||
+ error_num == E_PARSE) &&
+ use_exceptions) {
+ zval *fault, *exception;
+ char* code = SOAP_GLOBAL(error_code);
+ char buffer[1024];
+ int buffer_len;
+ zval outbuf, outbuflen;
+#ifdef va_copy
+ va_list argcopy;
+#endif
+ zend_object_store_bucket *old_objects;
+ int old = PG(display_errors);
+
+ INIT_ZVAL(outbuf);
+ INIT_ZVAL(outbuflen);
+#ifdef va_copy
+ va_copy(argcopy, args);
+ buffer_len = vslprintf(buffer, sizeof(buffer)-1, format, argcopy);
+ va_end(argcopy);
+#else
+ buffer_len = vslprintf(buffer, sizeof(buffer)-1, format, args);
+#endif
+ buffer[sizeof(buffer)-1]=0;
+ if (buffer_len > sizeof(buffer) - 1 || buffer_len < 0) {
+ buffer_len = sizeof(buffer) - 1;
+ }
+
+ if (code == NULL) {
+ code = "Client";
+ }
+ fault = add_soap_fault(SOAP_GLOBAL(error_object), code, buffer, NULL, NULL TSRMLS_CC);
+ MAKE_STD_ZVAL(exception);
+ MAKE_COPY_ZVAL(&fault, exception);
+ zend_throw_exception_object(exception TSRMLS_CC);
+
+ old_objects = EG(objects_store).object_buckets;
+ EG(objects_store).object_buckets = NULL;
+ PG(display_errors) = 0;
+ SG(sapi_headers).http_status_line = NULL;
+ zend_try {
+ call_old_error_handler(error_num, error_filename, error_lineno, format, args);
+ } zend_catch {
+ CG(in_compilation) = _old_in_compilation;
+ EG(in_execution) = _old_in_execution;
+ EG(current_execute_data) = _old_current_execute_data;
+ if (SG(sapi_headers).http_status_line) {
+ efree(SG(sapi_headers).http_status_line);
+ }
+ SG(sapi_headers).http_status_line = _old_http_status_line;
+ SG(sapi_headers).http_response_code = _old_http_response_code;
+ } zend_end_try();
+ EG(objects_store).object_buckets = old_objects;
+ PG(display_errors) = old;
+ zend_bailout();
+ } else if (!use_exceptions ||
+ !SOAP_GLOBAL(error_code) ||
+ strcmp(SOAP_GLOBAL(error_code),"WSDL") != 0) {
+ /* Ignore libxml warnings during WSDL parsing */
+ call_old_error_handler(error_num, error_filename, error_lineno, format, args);
+ }
+ } else {
+ int old = PG(display_errors);
+ int fault = 0;
+ zval fault_obj;
+#ifdef va_copy
+ va_list argcopy;
+#endif
+
+ if (error_num == E_USER_ERROR ||
+ error_num == E_COMPILE_ERROR ||
+ error_num == E_CORE_ERROR ||
+ error_num == E_ERROR ||
+ error_num == E_PARSE) {
+
+ char* code = SOAP_GLOBAL(error_code);
+ char buffer[1024];
+ zval *outbuf = NULL;
+ zval **tmp;
+ soapServicePtr service;
+
+ if (code == NULL) {
+ code = "Server";
+ }
+ if (SOAP_GLOBAL(error_object) &&
+ Z_TYPE_P(SOAP_GLOBAL(error_object)) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(SOAP_GLOBAL(error_object)), soap_server_class_entry TSRMLS_CC) &&
+ zend_hash_find(Z_OBJPROP_P(SOAP_GLOBAL(error_object)), "service", sizeof("service"), (void **)&tmp) != FAILURE &&
+ (service = (soapServicePtr)zend_fetch_resource(tmp TSRMLS_CC, -1, "service", NULL, 1, le_service)) &&
+ !service->send_errors) {
+ strcpy(buffer, "Internal Error");
+ } else {
+ int buffer_len;
+ zval outbuflen;
+
+ INIT_ZVAL(outbuflen);
+
+#ifdef va_copy
+ va_copy(argcopy, args);
+ buffer_len = vslprintf(buffer, sizeof(buffer)-1, format, argcopy);
+ va_end(argcopy);
+#else
+ buffer_len = vslprintf(buffer, sizeof(buffer)-1, format, args);
+#endif
+ buffer[sizeof(buffer)-1]=0;
+ if (buffer_len > sizeof(buffer) - 1 || buffer_len < 0) {
+ buffer_len = sizeof(buffer) - 1;
+ }
+
+ /* Get output buffer and send as fault detials */
+ if (php_output_get_length(&outbuflen TSRMLS_CC) != FAILURE && Z_LVAL(outbuflen) != 0) {
+ ALLOC_INIT_ZVAL(outbuf);
+ php_output_get_contents(outbuf TSRMLS_CC);
+ }
+ php_output_discard(TSRMLS_C);
+
+ }
+ INIT_ZVAL(fault_obj);
+ set_soap_fault(&fault_obj, NULL, code, buffer, NULL, outbuf, NULL TSRMLS_CC);
+ fault = 1;
+ }
+
+ PG(display_errors) = 0;
+ SG(sapi_headers).http_status_line = NULL;
+ zend_try {
+ call_old_error_handler(error_num, error_filename, error_lineno, format, args);
+ } zend_catch {
+ CG(in_compilation) = _old_in_compilation;
+ EG(in_execution) = _old_in_execution;
+ EG(current_execute_data) = _old_current_execute_data;
+ if (SG(sapi_headers).http_status_line) {
+ efree(SG(sapi_headers).http_status_line);
+ }
+ SG(sapi_headers).http_status_line = _old_http_status_line;
+ SG(sapi_headers).http_response_code = _old_http_response_code;
+ } zend_end_try();
+ PG(display_errors) = old;
+
+ if (fault) {
+ soap_server_fault_ex(NULL, &fault_obj, NULL TSRMLS_CC);
+ zend_bailout();
+ }
+ }
+}
+
+PHP_FUNCTION(use_soap_error_handler)
+{
+ zend_bool handler = 1;
+
+ ZVAL_BOOL(return_value, SOAP_GLOBAL(use_soap_error_handler));
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &handler) == SUCCESS) {
+ SOAP_GLOBAL(use_soap_error_handler) = handler;
+ }
+}
+
+PHP_FUNCTION(is_soap_fault)
+{
+ zval *fault;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &fault) == SUCCESS &&
+ Z_TYPE_P(fault) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(fault), soap_fault_class_entry TSRMLS_CC)) {
+ RETURN_TRUE;
+ }
+ RETURN_FALSE
+}
+
+/* SoapClient functions */
+
+/* {{{ proto object SoapClient::SoapClient ( mixed wsdl [, array options])
+ SoapClient constructor */
+PHP_METHOD(SoapClient, SoapClient)
+{
+
+ zval *wsdl, *options = NULL;
+ int soap_version = SOAP_1_1;
+ php_stream_context *context = NULL;
+ long cache_wsdl;
+ sdlPtr sdl = NULL;
+ HashTable *typemap_ht = NULL;
+
+ SOAP_CLIENT_BEGIN_CODE();
+
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &wsdl, &options) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+ }
+
+ if (Z_TYPE_P(wsdl) != IS_STRING && Z_TYPE_P(wsdl) != IS_NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "$wsdl must be string or null");
+ }
+
+ cache_wsdl = SOAP_GLOBAL(cache_enabled) ? SOAP_GLOBAL(cache_mode) : 0;
+
+ if (options != NULL) {
+ HashTable *ht = Z_ARRVAL_P(options);
+ zval **tmp;
+
+ if (Z_TYPE_P(wsdl) == IS_NULL) {
+ /* Fetching non-WSDL mode options */
+ if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ add_property_stringl(this_ptr, "uri", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is required in nonWSDL mode");
+ }
+
+ if (zend_hash_find(ht, "style", sizeof("style"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_LONG &&
+ (Z_LVAL_PP(tmp) == SOAP_RPC || Z_LVAL_PP(tmp) == SOAP_DOCUMENT)) {
+ add_property_long(this_ptr, "style", Z_LVAL_PP(tmp));
+ }
+
+ if (zend_hash_find(ht, "use", sizeof("use"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_LONG &&
+ (Z_LVAL_PP(tmp) == SOAP_LITERAL || Z_LVAL_PP(tmp) == SOAP_ENCODED)) {
+ add_property_long(this_ptr, "use", Z_LVAL_PP(tmp));
+ }
+ }
+
+ if (zend_hash_find(ht, "stream_context", sizeof("stream_context"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_RESOURCE) {
+ context = php_stream_context_from_zval(*tmp, 1);
+ zend_list_addref(context->rsrc_id);
+ }
+
+ if (zend_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ add_property_stringl(this_ptr, "location", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ } else if (Z_TYPE_P(wsdl) == IS_NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' option is required in nonWSDL mode");
+ }
+
+ if (zend_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) {
+ if (Z_TYPE_PP(tmp) == IS_LONG ||
+ (Z_LVAL_PP(tmp) == SOAP_1_1 && Z_LVAL_PP(tmp) == SOAP_1_2)) {
+ soap_version = Z_LVAL_PP(tmp);
+ }
+ }
+ if (zend_hash_find(ht, "login", sizeof("login"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ add_property_stringl(this_ptr, "_login", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ if (zend_hash_find(ht, "password", sizeof("password"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ add_property_stringl(this_ptr, "_password", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ }
+ if (zend_hash_find(ht, "authentication", sizeof("authentication"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_LONG &&
+ Z_LVAL_PP(tmp) == SOAP_AUTHENTICATION_DIGEST) {
+ add_property_null(this_ptr, "_digest");
+ }
+ }
+ if (zend_hash_find(ht, "proxy_host", sizeof("proxy_host"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ add_property_stringl(this_ptr, "_proxy_host", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ if (zend_hash_find(ht, "proxy_port", sizeof("proxy_port"), (void**)&tmp) == SUCCESS) {
+ convert_to_long(*tmp);
+ add_property_long(this_ptr, "_proxy_port", Z_LVAL_PP(tmp));
+ }
+ if (zend_hash_find(ht, "proxy_login", sizeof("proxy_login"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ add_property_stringl(this_ptr, "_proxy_login", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ if (zend_hash_find(ht, "proxy_password", sizeof("proxy_password"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ add_property_stringl(this_ptr, "_proxy_password", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ }
+ }
+ }
+ if (zend_hash_find(ht, "local_cert", sizeof("local_cert"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ if (!context) {
+ context = php_stream_context_alloc(TSRMLS_C);
+ }
+ php_stream_context_set_option(context, "ssl", "local_cert", *tmp);
+ if (zend_hash_find(ht, "passphrase", sizeof("passphrase"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ php_stream_context_set_option(context, "ssl", "passphrase", *tmp);
+ }
+ }
+ if (zend_hash_find(ht, "trace", sizeof("trace"), (void**)&tmp) == SUCCESS &&
+ (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) &&
+ Z_LVAL_PP(tmp) == 1) {
+ add_property_long(this_ptr, "trace", 1);
+ }
+
+ if (zend_hash_find(ht, "exceptions", sizeof("exceptions"), (void**)&tmp) == SUCCESS &&
+ (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) &&
+ Z_LVAL_PP(tmp) == 0) {
+ add_property_bool(this_ptr, "_exceptions", 0);
+ }
+
+ if (zend_hash_find(ht, "compression", sizeof("compression"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_LONG &&
+ zend_hash_exists(EG(function_table), "gzinflate", sizeof("gzinflate")) &&
+ zend_hash_exists(EG(function_table), "gzdeflate", sizeof("gzdeflate")) &&
+ zend_hash_exists(EG(function_table), "gzuncompress", sizeof("gzuncompress")) &&
+ zend_hash_exists(EG(function_table), "gzcompress", sizeof("gzcompress")) &&
+ zend_hash_exists(EG(function_table), "gzencode", sizeof("gzencode"))) {
+ add_property_long(this_ptr, "compression", Z_LVAL_PP(tmp));
+ }
+ if (zend_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ xmlCharEncodingHandlerPtr encoding;
+
+ encoding = xmlFindCharEncodingHandler(Z_STRVAL_PP(tmp));
+ if (encoding == NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid 'encoding' option - '%s'", Z_STRVAL_PP(tmp));
+ } else {
+ xmlCharEncCloseFunc(encoding);
+ add_property_stringl(this_ptr, "_encoding", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ }
+ }
+ if (zend_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_ARRAY) {
+ zval *class_map;
+
+ MAKE_STD_ZVAL(class_map);
+ MAKE_COPY_ZVAL(tmp, class_map);
+ Z_DELREF_P(class_map);
+
+ add_property_zval(this_ptr, "_classmap", class_map);
+ }
+
+ if (zend_hash_find(ht, "typemap", sizeof("typemap"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_ARRAY &&
+ zend_hash_num_elements(Z_ARRVAL_PP(tmp)) > 0) {
+ typemap_ht = Z_ARRVAL_PP(tmp);
+ }
+
+ if (zend_hash_find(ht, "features", sizeof("features"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_LONG) {
+ add_property_long(this_ptr, "_features", Z_LVAL_PP(tmp));
+ }
+
+ if (zend_hash_find(ht, "connection_timeout", sizeof("connection_timeout"), (void**)&tmp) == SUCCESS) {
+ convert_to_long(*tmp);
+ if (Z_LVAL_PP(tmp) > 0) {
+ add_property_long(this_ptr, "_connection_timeout", Z_LVAL_PP(tmp));
+ }
+ }
+
+ if (context) {
+ add_property_resource(this_ptr, "_stream_context", context->rsrc_id);
+ }
+
+ if (zend_hash_find(ht, "cache_wsdl", sizeof("cache_wsdl"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_LONG) {
+ cache_wsdl = Z_LVAL_PP(tmp);
+ }
+
+ if (zend_hash_find(ht, "user_agent", sizeof("user_agent"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ add_property_stringl(this_ptr, "_user_agent", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ }
+
+ if (zend_hash_find(ht, "keep_alive", sizeof("keep_alive"), (void**)&tmp) == SUCCESS &&
+ (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) && Z_LVAL_PP(tmp) == 0) {
+ add_property_long(this_ptr, "_keep_alive", 0);
+ }
+ } else if (Z_TYPE_P(wsdl) == IS_NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' and 'uri' options are required in nonWSDL mode");
+ }
+
+ add_property_long(this_ptr, "_soap_version", soap_version);
+
+ if (Z_TYPE_P(wsdl) != IS_NULL) {
+ int old_soap_version, ret;
+
+ old_soap_version = SOAP_GLOBAL(soap_version);
+ SOAP_GLOBAL(soap_version) = soap_version;
+
+ sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl), cache_wsdl TSRMLS_CC);
+ ret = zend_list_insert(sdl, le_sdl TSRMLS_CC);
+
+ add_property_resource(this_ptr, "sdl", ret);
+
+ SOAP_GLOBAL(soap_version) = old_soap_version;
+ }
+
+ if (typemap_ht) {
+ HashTable *typemap = soap_create_typemap(sdl, typemap_ht TSRMLS_CC);
+ if (typemap) {
+ int ret;
+
+ ret = zend_list_insert(typemap, le_typemap TSRMLS_CC);
+ add_property_resource(this_ptr, "typemap", ret);
+ }
+ }
+ SOAP_CLIENT_END_CODE();
+}
+/* }}} */
+
+static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, int one_way, zval *response TSRMLS_DC)
+{
+ int ret = TRUE;
+ char *buf;
+ int buf_size;
+ zval func, param0, param1, param2, param3, param4;
+ zval *params[5];
+ zval **trace;
+ zval **fault;
+
+ INIT_ZVAL(*response);
+
+ xmlDocDumpMemory(request, (xmlChar**)&buf, &buf_size);
+ if (!buf) {
+ add_soap_fault(this_ptr, "HTTP", "Error build soap request", NULL, NULL TSRMLS_CC);
+ return FALSE;
+ }
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS &&
+ Z_LVAL_PP(trace) > 0) {
+ add_property_stringl(this_ptr, "__last_request", buf, buf_size, 1);
+ }
+
+ INIT_ZVAL(func);
+ ZVAL_STRINGL(&func,"__doRequest",sizeof("__doRequest")-1,0);
+ INIT_ZVAL(param0);
+ params[0] = &param0;
+ ZVAL_STRINGL(params[0], buf, buf_size, 0);
+ INIT_ZVAL(param1);
+ params[1] = &param1;
+ if (location == NULL) {
+ ZVAL_NULL(params[1]);
+ } else {
+ ZVAL_STRING(params[1], location, 0);
+ }
+ INIT_ZVAL(param2);
+ params[2] = &param2;
+ if (action == NULL) {
+ ZVAL_NULL(params[2]);
+ } else {
+ ZVAL_STRING(params[2], action, 0);
+ }
+ INIT_ZVAL(param3);
+ params[3] = &param3;
+ ZVAL_LONG(params[3], version);
+
+ INIT_ZVAL(param4);
+ params[4] = &param4;
+ ZVAL_LONG(params[4], one_way);
+
+ if (call_user_function(NULL, &this_ptr, &func, response, 5, params TSRMLS_CC) != SUCCESS) {
+ add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() failed", NULL, NULL TSRMLS_CC);
+ ret = FALSE;
+ } else if (Z_TYPE_P(response) != IS_STRING) {
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == FAILURE) {
+ add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() returned non string value", NULL, NULL TSRMLS_CC);
+ }
+ ret = FALSE;
+ } else if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS &&
+ Z_LVAL_PP(trace) > 0) {
+ add_property_stringl(this_ptr, "__last_response", Z_STRVAL_P(response), Z_STRLEN_P(response), 1);
+ }
+ xmlFree(buf);
+ if (ret && zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == SUCCESS) {
+ return FALSE;
+ }
+ return ret;
+}
+
+static void do_soap_call(zval* this_ptr,
+ char* function,
+ int function_len,
+ int arg_count,
+ zval** real_args,
+ zval* return_value,
+ char* location,
+ char* soap_action,
+ char* call_uri,
+ HashTable* soap_headers,
+ zval* output_headers
+ TSRMLS_DC)
+{
+ zval **tmp;
+ zval **trace;
+ sdlPtr sdl = NULL;
+ sdlPtr old_sdl = NULL;
+ sdlFunctionPtr fn;
+ xmlDocPtr request = NULL;
+ int ret = FALSE;
+ int soap_version;
+ zval response;
+ xmlCharEncodingHandlerPtr old_encoding;
+ HashTable *old_class_map;
+ int old_features;
+ HashTable *old_typemap, *typemap = NULL;
+
+ SOAP_CLIENT_BEGIN_CODE();
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS
+ && Z_LVAL_PP(trace) > 0) {
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "__last_request", sizeof("__last_request"));
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "__last_response", sizeof("__last_response"));
+ }
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_soap_version", sizeof("_soap_version"), (void **) &tmp) == SUCCESS
+ && Z_LVAL_PP(tmp) == SOAP_1_2) {
+ soap_version = SOAP_1_2;
+ } else {
+ soap_version = SOAP_1_1;
+ }
+
+ if (location == NULL) {
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "location", sizeof("location"),(void **) &tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ location = Z_STRVAL_PP(tmp);
+ }
+ }
+
+ if (FIND_SDL_PROPERTY(this_ptr,tmp) != FAILURE) {
+ FETCH_SDL_RES(sdl,tmp);
+ }
+ if (FIND_TYPEMAP_PROPERTY(this_ptr,tmp) != FAILURE) {
+ FETCH_TYPEMAP_RES(typemap,tmp);
+ }
+
+ clear_soap_fault(this_ptr TSRMLS_CC);
+
+ SOAP_GLOBAL(soap_version) = soap_version;
+ old_sdl = SOAP_GLOBAL(sdl);
+ SOAP_GLOBAL(sdl) = sdl;
+ old_encoding = SOAP_GLOBAL(encoding);
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_encoding", sizeof("_encoding"), (void **) &tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ SOAP_GLOBAL(encoding) = xmlFindCharEncodingHandler(Z_STRVAL_PP(tmp));
+ } else {
+ SOAP_GLOBAL(encoding) = NULL;
+ }
+ old_class_map = SOAP_GLOBAL(class_map);
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_classmap", sizeof("_classmap"), (void **) &tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_ARRAY) {
+ SOAP_GLOBAL(class_map) = (*tmp)->value.ht;
+ } else {
+ SOAP_GLOBAL(class_map) = NULL;
+ }
+ old_typemap = SOAP_GLOBAL(typemap);
+ SOAP_GLOBAL(typemap) = typemap;
+ old_features = SOAP_GLOBAL(features);
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_features", sizeof("_features"), (void **) &tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_LONG) {
+ SOAP_GLOBAL(features) = Z_LVAL_PP(tmp);
+ } else {
+ SOAP_GLOBAL(features) = 0;
+ }
+
+ if (sdl != NULL) {
+ fn = get_function(sdl, function);
+ if (fn != NULL) {
+ sdlBindingPtr binding = fn->binding;
+ int one_way = 0;
+
+ if (fn->responseName == NULL &&
+ fn->responseParameters == NULL &&
+ soap_headers == NULL) {
+ one_way = 1;
+ }
+
+ if (location == NULL) {
+ location = binding->location;
+ }
+ if (binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes;
+ request = serialize_function_call(this_ptr, fn, NULL, fnb->input.ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
+ ret = do_request(this_ptr, request, location, fnb->soapAction, soap_version, one_way, &response TSRMLS_CC);
+ } else {
+ request = serialize_function_call(this_ptr, fn, NULL, sdl->target_ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
+ ret = do_request(this_ptr, request, location, NULL, soap_version, one_way, &response TSRMLS_CC);
+ }
+
+ xmlFreeDoc(request);
+
+ if (ret && Z_TYPE(response) == IS_STRING) {
+ encode_reset_ns();
+ ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), fn, NULL, return_value, output_headers TSRMLS_CC);
+ encode_finish();
+ }
+
+ zval_dtor(&response);
+
+ } else {
+ smart_str error = {0};
+ smart_str_appends(&error,"Function (\"");
+ smart_str_appends(&error,function);
+ smart_str_appends(&error,"\") is not a valid method for this service");
+ smart_str_0(&error);
+ add_soap_fault(this_ptr, "Client", error.c, NULL, NULL TSRMLS_CC);
+ smart_str_free(&error);
+ }
+ } else {
+ zval **uri;
+ smart_str action = {0};
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "uri", sizeof("uri"), (void *)&uri) == FAILURE) {
+ add_soap_fault(this_ptr, "Client", "Error finding \"uri\" property", NULL, NULL TSRMLS_CC);
+ } else if (location == NULL) {
+ add_soap_fault(this_ptr, "Client", "Error could not find \"location\" property", NULL, NULL TSRMLS_CC);
+ } else {
+ if (call_uri == NULL) {
+ call_uri = Z_STRVAL_PP(uri);
+ }
+ request = serialize_function_call(this_ptr, NULL, function, call_uri, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
+
+ if (soap_action == NULL) {
+ smart_str_appends(&action, call_uri);
+ smart_str_appendc(&action, '#');
+ smart_str_appends(&action, function);
+ } else {
+ smart_str_appends(&action, soap_action);
+ }
+ smart_str_0(&action);
+
+ ret = do_request(this_ptr, request, location, action.c, soap_version, 0, &response TSRMLS_CC);
+
+ smart_str_free(&action);
+ xmlFreeDoc(request);
+
+ if (ret && Z_TYPE(response) == IS_STRING) {
+ encode_reset_ns();
+ ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), NULL, function, return_value, output_headers TSRMLS_CC);
+ encode_finish();
+ }
+
+ zval_dtor(&response);
+ }
+ }
+
+ if (!ret) {
+ zval** fault;
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == SUCCESS) {
+ *return_value = **fault;
+ zval_copy_ctor(return_value);
+ } else {
+ *return_value = *add_soap_fault(this_ptr, "Client", "Unknown Error", NULL, NULL TSRMLS_CC);
+ zval_copy_ctor(return_value);
+ }
+ } else {
+ zval** fault;
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == SUCCESS) {
+ *return_value = **fault;
+ zval_copy_ctor(return_value);
+ }
+ }
+
+ if (!EG(exception) &&
+ Z_TYPE_P(return_value) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(return_value), soap_fault_class_entry TSRMLS_CC) &&
+ (zend_hash_find(Z_OBJPROP_P(this_ptr), "_exceptions", sizeof("_exceptions"), (void **) &tmp) != SUCCESS ||
+ Z_TYPE_PP(tmp) != IS_BOOL || Z_LVAL_PP(tmp) != 0)) {
+ zval *exception;
+
+ MAKE_STD_ZVAL(exception);
+ MAKE_COPY_ZVAL(&return_value, exception);
+ zend_throw_exception_object(exception TSRMLS_CC);
+ }
+
+ if (SOAP_GLOBAL(encoding) != NULL) {
+ xmlCharEncCloseFunc(SOAP_GLOBAL(encoding));
+ }
+ SOAP_GLOBAL(features) = old_features;
+ SOAP_GLOBAL(typemap) = old_typemap;
+ SOAP_GLOBAL(class_map) = old_class_map;
+ SOAP_GLOBAL(encoding) = old_encoding;
+ SOAP_GLOBAL(sdl) = old_sdl;
+ SOAP_CLIENT_END_CODE();
+}
+
+static void verify_soap_headers_array(HashTable *ht TSRMLS_DC)
+{
+ zval **tmp;
+
+ zend_hash_internal_pointer_reset(ht);
+ while (zend_hash_get_current_data(ht, (void**)&tmp) == SUCCESS) {
+ if (Z_TYPE_PP(tmp) != IS_OBJECT ||
+ !instanceof_function(Z_OBJCE_PP(tmp), soap_header_class_entry TSRMLS_CC)) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid SOAP header");
+ }
+ zend_hash_move_forward(ht);
+ }
+}
+
+
+/* {{{ proto mixed SoapClient::__call ( string function_name, array arguments [, array options [, array input_headers [, array output_headers]]])
+ Calls a SOAP function */
+PHP_METHOD(SoapClient, __call)
+{
+ char *function, *location=NULL, *soap_action = NULL, *uri = NULL;
+ int function_len, i = 0;
+ HashTable* soap_headers = NULL;
+ zval *options = NULL;
+ zval *headers = NULL;
+ zval *output_headers = NULL;
+ zval *args;
+ zval **real_args = NULL;
+ zval **param;
+ int arg_count;
+ zval **tmp;
+ zend_bool free_soap_headers = 0;
+
+ HashPosition pos;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa|a!zz",
+ &function, &function_len, &args, &options, &headers, &output_headers) == FAILURE) {
+ return;
+ }
+
+ if (options) {
+ HashTable *hto = Z_ARRVAL_P(options);
+ if (zend_hash_find(hto, "location", sizeof("location"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ location = Z_STRVAL_PP(tmp);
+ }
+
+ if (zend_hash_find(hto, "soapaction", sizeof("soapaction"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ soap_action = Z_STRVAL_PP(tmp);
+ }
+
+ if (zend_hash_find(hto, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ uri = Z_STRVAL_PP(tmp);
+ }
+ }
+
+ if (headers == NULL || Z_TYPE_P(headers) == IS_NULL) {
+ } else if (Z_TYPE_P(headers) == IS_ARRAY) {
+ soap_headers = Z_ARRVAL_P(headers);
+ verify_soap_headers_array(soap_headers TSRMLS_CC);
+ free_soap_headers = 0;
+ } else if (Z_TYPE_P(headers) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(headers), soap_header_class_entry TSRMLS_CC)) {
+ soap_headers = emalloc(sizeof(HashTable));
+ zend_hash_init(soap_headers, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_next_index_insert(soap_headers, &headers, sizeof(zval*), NULL);
+ Z_ADDREF_P(headers);
+ free_soap_headers = 1;
+ } else{
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid SOAP header");
+ return;
+ }
+
+ /* Add default headers */
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers"), (void **) &tmp)==SUCCESS) {
+ HashTable *default_headers = Z_ARRVAL_P(*tmp);
+ if (soap_headers) {
+ if (!free_soap_headers) {
+ HashTable *t = emalloc(sizeof(HashTable));
+ zend_hash_init(t, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(t, soap_headers, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
+ soap_headers = t;
+ free_soap_headers = 1;
+ }
+ zend_hash_internal_pointer_reset(default_headers);
+ while (zend_hash_get_current_data(default_headers, (void**)&tmp) == SUCCESS) {
+ Z_ADDREF_PP(tmp);
+ zend_hash_next_index_insert(soap_headers, tmp, sizeof(zval *), NULL);
+ zend_hash_move_forward(default_headers);
+ }
+ } else {
+ soap_headers = Z_ARRVAL_P(*tmp);
+ free_soap_headers = 0;
+ }
+ }
+
+ arg_count = zend_hash_num_elements(Z_ARRVAL_P(args));
+
+ if (arg_count > 0) {
+ real_args = safe_emalloc(sizeof(zval *), arg_count, 0);
+ for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), &pos);
+ zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **) &param, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(Z_ARRVAL_P(args), &pos)) {
+ /*zval_add_ref(param);*/
+ real_args[i++] = *param;
+ }
+ }
+ if (output_headers) {
+ array_init(output_headers);
+ }
+ do_soap_call(this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers TSRMLS_CC);
+ if (arg_count > 0) {
+ efree(real_args);
+ }
+
+ if (soap_headers && free_soap_headers) {
+ zend_hash_destroy(soap_headers);
+ efree(soap_headers);
+ }
+}
+/* }}} */
+
+
+/* {{{ proto array SoapClient::__getFunctions ( void )
+ Returns list of SOAP functions */
+PHP_METHOD(SoapClient, __getFunctions)
+{
+ sdlPtr sdl;
+ HashPosition pos;
+
+ FETCH_THIS_SDL(sdl);
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
+ if (sdl) {
+ smart_str buf = {0};
+ sdlFunctionPtr *function;
+
+ array_init(return_value);
+ zend_hash_internal_pointer_reset_ex(&sdl->functions, &pos);
+ while (zend_hash_get_current_data_ex(&sdl->functions, (void **)&function, &pos) != FAILURE) {
+ function_to_string((*function), &buf);
+ add_next_index_stringl(return_value, buf.c, buf.len, 1);
+ smart_str_free(&buf);
+ zend_hash_move_forward_ex(&sdl->functions, &pos);
+ }
+ }
+}
+/* }}} */
+
+
+/* {{{ proto array SoapClient::__getTypes ( void )
+ Returns list of SOAP types */
+PHP_METHOD(SoapClient, __getTypes)
+{
+ sdlPtr sdl;
+ HashPosition pos;
+
+ FETCH_THIS_SDL(sdl);
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
+ if (sdl) {
+ sdlTypePtr *type;
+ smart_str buf = {0};
+
+ array_init(return_value);
+ if (sdl->types) {
+ zend_hash_internal_pointer_reset_ex(sdl->types, &pos);
+ while (zend_hash_get_current_data_ex(sdl->types, (void **)&type, &pos) != FAILURE) {
+ type_to_string((*type), &buf, 0);
+ add_next_index_stringl(return_value, buf.c, buf.len, 1);
+ smart_str_free(&buf);
+ zend_hash_move_forward_ex(sdl->types, &pos);
+ }
+ }
+ }
+}
+/* }}} */
+
+
+/* {{{ proto string SoapClient::__getLastRequest ( void )
+ Returns last SOAP request */
+PHP_METHOD(SoapClient, __getLastRequest)
+{
+ zval **tmp;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_request", sizeof("__last_request"), (void **)&tmp) == SUCCESS) {
+ RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ }
+ RETURN_NULL();
+}
+/* }}} */
+
+
+/* {{{ proto object SoapClient::__getLastResponse ( void )
+ Returns last SOAP response */
+PHP_METHOD(SoapClient, __getLastResponse)
+{
+ zval **tmp;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_response", sizeof("__last_response"), (void **)&tmp) == SUCCESS) {
+ RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ }
+ RETURN_NULL();
+}
+/* }}} */
+
+
+/* {{{ proto string SoapClient::__getLastRequestHeaders(void)
+ Returns last SOAP request headers */
+PHP_METHOD(SoapClient, __getLastRequestHeaders)
+{
+ zval **tmp;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_request_headers", sizeof("__last_request_headers"), (void **)&tmp) == SUCCESS) {
+ RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ }
+ RETURN_NULL();
+}
+/* }}} */
+
+
+/* {{{ proto string SoapClient::__getLastResponseHeaders(void)
+ Returns last SOAP response headers */
+PHP_METHOD(SoapClient, __getLastResponseHeaders)
+{
+ zval **tmp;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_response_headers", sizeof("__last_response_headers"), (void **)&tmp) == SUCCESS) {
+ RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ }
+ RETURN_NULL();
+}
+/* }}} */
+
+
+/* {{{ proto string SoapClient::__doRequest()
+ SoapClient::__doRequest() */
+PHP_METHOD(SoapClient, __doRequest)
+{
+ char *buf, *location, *action;
+ int buf_size, location_size, action_size;
+ long version;
+ long one_way = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssl|l",
+ &buf, &buf_size,
+ &location, &location_size,
+ &action, &action_size,
+ &version, &one_way) == FAILURE) {
+ return;
+ }
+ if (SOAP_GLOBAL(features) & SOAP_WAIT_ONE_WAY_CALLS) {
+ one_way = 0;
+ }
+ if (one_way) {
+ if (make_http_soap_request(this_ptr, buf, buf_size, location, action, version, NULL, NULL TSRMLS_CC)) {
+ RETURN_EMPTY_STRING();
+ }
+ } else if (make_http_soap_request(this_ptr, buf, buf_size, location, action, version,
+ &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value) TSRMLS_CC)) {
+ return_value->type = IS_STRING;
+ return;
+ }
+ RETURN_NULL();
+}
+/* }}} */
+
+/* {{{ proto void SoapClient::__setCookie(string name [, strung value])
+ Sets cookie thet will sent with SOAP request.
+ The call to this function will effect all folowing calls of SOAP methods.
+ If value is not specified cookie is removed. */
+PHP_METHOD(SoapClient, __setCookie)
+{
+ char *name;
+ char *val = NULL;
+ int name_len, val_len = 0;
+ zval **cookies;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &name, &name_len, &val, &val_len) == FAILURE) {
+ return;
+ }
+
+ if (val == NULL) {
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == SUCCESS) {
+ zend_hash_del(Z_ARRVAL_PP(cookies), name, name_len+1);
+ }
+ } else {
+ zval *zcookie;
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == FAILURE) {
+ zval *tmp_cookies;
+
+ MAKE_STD_ZVAL(tmp_cookies);
+ array_init(tmp_cookies);
+ zend_hash_update(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), &tmp_cookies, sizeof(zval *), (void **)&cookies);
+ }
+
+ ALLOC_INIT_ZVAL(zcookie);
+ array_init(zcookie);
+ add_index_stringl(zcookie, 0, val, val_len, 1);
+ add_assoc_zval_ex(*cookies, name, name_len+1, zcookie);
+ }
+}
+/* }}} */
+
+/* {{{ proto void SoapClient::__setSoapHeaders(array SoapHeaders)
+ Sets SOAP headers for subsequent calls (replaces any previous
+ values).
+ If no value is specified, all of the headers are removed. */
+PHP_METHOD(SoapClient, __setSoapHeaders)
+{
+ zval *headers = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &headers) == FAILURE) {
+ return;
+ }
+
+ if (headers == NULL || Z_TYPE_P(headers) == IS_NULL) {
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers"));
+ } else if (Z_TYPE_P(headers) == IS_ARRAY) {
+ zval *default_headers;
+
+ verify_soap_headers_array(Z_ARRVAL_P(headers) TSRMLS_CC);
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers"), (void **) &default_headers)==FAILURE) {
+ add_property_zval(this_ptr, "__default_headers", headers);
+ }
+ } else if (Z_TYPE_P(headers) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(headers), soap_header_class_entry TSRMLS_CC)) {
+ zval *default_headers;
+ ALLOC_INIT_ZVAL(default_headers);
+ array_init(default_headers);
+ Z_ADDREF_P(headers);
+ add_next_index_zval(default_headers, headers);
+ Z_DELREF_P(default_headers);
+ add_property_zval(this_ptr, "__default_headers", default_headers);
+ } else{
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid SOAP header");
+ }
+ RETURN_TRUE;
+}
+/* }}} */
+
+
+
+/* {{{ proto string SoapClient::__setLocation([string new_location])
+ Sets the location option (the endpoint URL that will be touched by the
+ following SOAP requests).
+ If new_location is not specified or null then SoapClient will use endpoint
+ from WSDL file.
+ The function returns old value of location options. */
+PHP_METHOD(SoapClient, __setLocation)
+{
+ char *location = NULL;
+ int location_len = 0;
+ zval **tmp;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &location, &location_len) == FAILURE) {
+ return;
+ }
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "location", sizeof("location"),(void **) &tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) {
+ RETVAL_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ } else {
+ RETVAL_NULL();
+ }
+
+ if (location && location_len) {
+ add_property_stringl(this_ptr, "location", location, location_len, 1);
+ } else {
+ zend_hash_del(Z_OBJPROP_P(this_ptr), "location", sizeof("location"));
+ }
+}
+/* }}} */
+
+static void clear_soap_fault(zval *obj TSRMLS_DC)
+{
+ if (obj != NULL && obj->type == IS_OBJECT) {
+ zend_hash_del(Z_OBJPROP_P(obj), "__soap_fault", sizeof("__soap_fault"));
+ }
+}
+
+zval* add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC)
+{
+ zval *fault;
+ ALLOC_INIT_ZVAL(fault);
+ set_soap_fault(fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL TSRMLS_CC);
+ Z_DELREF_P(fault);
+
+ add_property_zval(obj, "__soap_fault", fault);
+ return fault;
+}
+
+static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, char *name TSRMLS_DC)
+{
+ if (Z_TYPE_P(obj) != IS_OBJECT) {
+ object_init_ex(obj, soap_fault_class_entry);
+ }
+
+ add_property_string(obj, "faultstring", fault_string ? fault_string : "", 1);
+ zend_update_property_string(zend_exception_get_default(TSRMLS_C), obj, "message", sizeof("message")-1, (fault_string ? fault_string : "") TSRMLS_CC);
+
+ if (fault_code != NULL) {
+ int soap_version = SOAP_GLOBAL(soap_version);
+
+ if (fault_code_ns) {
+ add_property_string(obj, "faultcode", fault_code, 1);
+ add_property_string(obj, "faultcodens", fault_code_ns, 1);
+ } else {
+ if (soap_version == SOAP_1_1) {
+ add_property_string(obj, "faultcode", fault_code, 1);
+ if (strcmp(fault_code,"Client") == 0 ||
+ strcmp(fault_code,"Server") == 0 ||
+ strcmp(fault_code,"VersionMismatch") == 0 ||
+ strcmp(fault_code,"MustUnderstand") == 0) {
+ add_property_string(obj, "faultcodens", SOAP_1_1_ENV_NAMESPACE, 1);
+ }
+ } else if (soap_version == SOAP_1_2) {
+ if (strcmp(fault_code,"Client") == 0) {
+ add_property_string(obj, "faultcode", "Sender", 1);
+ add_property_string(obj, "faultcodens", SOAP_1_2_ENV_NAMESPACE, 1);
+ } else if (strcmp(fault_code,"Server") == 0) {
+ add_property_string(obj, "faultcode", "Receiver", 1);
+ add_property_string(obj, "faultcodens", SOAP_1_2_ENV_NAMESPACE, 1);
+ } else if (strcmp(fault_code,"VersionMismatch") == 0 ||
+ strcmp(fault_code,"MustUnderstand") == 0 ||
+ strcmp(fault_code,"DataEncodingUnknown") == 0) {
+ add_property_string(obj, "faultcode", fault_code, 1);
+ add_property_string(obj, "faultcodens", SOAP_1_2_ENV_NAMESPACE, 1);
+ } else {
+ add_property_string(obj, "faultcode", fault_code, 1);
+ }
+ }
+ }
+ }
+ if (fault_actor != NULL) {
+ add_property_string(obj, "faultactor", fault_actor, 1);
+ }
+ if (fault_detail != NULL) {
+ add_property_zval(obj, "detail", fault_detail);
+ }
+ if (name != NULL) {
+ add_property_string(obj, "_name", name, 1);
+ }
+}
+
+static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, int *num_params, zval ***parameters TSRMLS_DC)
+{
+ int cur_param = 0,num_of_params = 0;
+ zval **tmp_parameters = NULL;
+
+ if (function != NULL) {
+ sdlParamPtr *param;
+ xmlNodePtr val;
+ int use_names = 0;
+
+ if (function->requestParameters == NULL) {
+ return;
+ }
+ num_of_params = zend_hash_num_elements(function->requestParameters);
+ zend_hash_internal_pointer_reset(function->requestParameters);
+ while (zend_hash_get_current_data(function->requestParameters, (void **)&param) == SUCCESS) {
+ if (get_node(params, (*param)->paramName) != NULL) {
+ use_names = 1;
+ }
+ zend_hash_move_forward(function->requestParameters);
+ }
+ if (use_names) {
+ tmp_parameters = safe_emalloc(num_of_params, sizeof(zval *), 0);
+ zend_hash_internal_pointer_reset(function->requestParameters);
+ while (zend_hash_get_current_data(function->requestParameters, (void **)&param) == SUCCESS) {
+ val = get_node(params, (*param)->paramName);
+ if (!val) {
+ /* TODO: may be "nil" is not OK? */
+ MAKE_STD_ZVAL(tmp_parameters[cur_param]);
+ ZVAL_NULL(tmp_parameters[cur_param]);
+ } else {
+ tmp_parameters[cur_param] = master_to_zval((*param)->encode, val TSRMLS_CC);
+ }
+ cur_param++;
+
+ zend_hash_move_forward(function->requestParameters);
+ }
+ (*parameters) = tmp_parameters;
+ (*num_params) = num_of_params;
+ return;
+ }
+ }
+ if (params) {
+ xmlNodePtr trav;
+
+ num_of_params = 0;
+ trav = params;
+ while (trav != NULL) {
+ if (trav->type == XML_ELEMENT_NODE) {
+ num_of_params++;
+ }
+ trav = trav->next;
+ }
+
+ if (num_of_params == 1 &&
+ function &&
+ function->binding &&
+ function->binding->bindingType == BINDING_SOAP &&
+ ((sdlSoapBindingFunctionPtr)function->bindingAttributes)->style == SOAP_DOCUMENT &&
+ (function->requestParameters == NULL ||
+ zend_hash_num_elements(function->requestParameters) == 0) &&
+ strcmp((char *)params->name, function->functionName) == 0) {
+ num_of_params = 0;
+ } else if (num_of_params > 0) {
+ tmp_parameters = safe_emalloc(num_of_params, sizeof(zval *), 0);
+
+ trav = params;
+ while (trav != 0 && cur_param < num_of_params) {
+ if (trav->type == XML_ELEMENT_NODE) {
+ encodePtr enc;
+ sdlParamPtr *param = NULL;
+ if (function != NULL &&
+ zend_hash_index_find(function->requestParameters, cur_param, (void **)&param) == FAILURE) {
+ TSRMLS_FETCH();
+ soap_server_fault("Client", "Error cannot find parameter", NULL, NULL, NULL TSRMLS_CC);
+ }
+ if (param == NULL) {
+ enc = NULL;
+ } else {
+ enc = (*param)->encode;
+ }
+ tmp_parameters[cur_param] = master_to_zval(enc, trav TSRMLS_CC);
+ cur_param++;
+ }
+ trav = trav->next;
+ }
+ }
+ }
+ if (num_of_params > cur_param) {
+ soap_server_fault("Client","Missing parameter", NULL, NULL, NULL TSRMLS_CC);
+ }
+ (*parameters) = tmp_parameters;
+ (*num_params) = num_of_params;
+}
+
+static sdlFunctionPtr find_function(sdlPtr sdl, xmlNodePtr func, zval* function_name)
+{
+ sdlFunctionPtr function;
+
+ function = get_function(sdl, (char*)func->name);
+ if (function && function->binding && function->binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
+ if (fnb->style == SOAP_DOCUMENT) {
+ if (func->children != NULL ||
+ (function->requestParameters != NULL &&
+ zend_hash_num_elements(function->requestParameters) > 0)) {
+ function = NULL;
+ }
+ }
+ }
+ if (sdl != NULL && function == NULL) {
+ function = get_doc_function(sdl, func);
+ }
+
+ INIT_ZVAL(*function_name);
+ if (function != NULL) {
+ ZVAL_STRING(function_name, (char *)function->functionName, 1);
+ } else {
+ ZVAL_STRING(function_name, (char *)func->name, 1);
+ }
+
+ return function;
+}
+
+static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval ***parameters, int *version, soapHeader **headers TSRMLS_DC)
+{
+ char* envelope_ns = NULL;
+ xmlNodePtr trav,env,head,body,func;
+ xmlAttrPtr attr;
+ sdlFunctionPtr function;
+
+ encode_reset_ns();
+
+ /* Get <Envelope> element */
+ env = NULL;
+ trav = request->children;
+ while (trav != NULL) {
+ if (trav->type == XML_ELEMENT_NODE) {
+ if (env == NULL && node_is_equal_ex(trav,"Envelope",SOAP_1_1_ENV_NAMESPACE)) {
+ env = trav;
+ *version = SOAP_1_1;
+ envelope_ns = SOAP_1_1_ENV_NAMESPACE;
+ SOAP_GLOBAL(soap_version) = SOAP_1_1;
+ } else if (env == NULL && node_is_equal_ex(trav,"Envelope",SOAP_1_2_ENV_NAMESPACE)) {
+ env = trav;
+ *version = SOAP_1_2;
+ envelope_ns = SOAP_1_2_ENV_NAMESPACE;
+ SOAP_GLOBAL(soap_version) = SOAP_1_2;
+ } else {
+ soap_server_fault("VersionMismatch", "Wrong Version", NULL, NULL, NULL TSRMLS_CC);
+ }
+ }
+ trav = trav->next;
+ }
+ if (env == NULL) {
+ soap_server_fault("Client", "looks like we got XML without \"Envelope\" element", NULL, NULL, NULL TSRMLS_CC);
+ }
+
+ attr = env->properties;
+ while (attr != NULL) {
+ if (attr->ns == NULL) {
+ soap_server_fault("Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC);
+ } else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
+ if (*version == SOAP_1_2) {
+ soap_server_fault("Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL, NULL TSRMLS_CC);
+ } else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
+ soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
+ }
+ }
+ attr = attr->next;
+ }
+
+ /* Get <Header> element */
+ head = NULL;
+ trav = env->children;
+ while (trav != NULL && trav->type != XML_ELEMENT_NODE) {
+ trav = trav->next;
+ }
+ if (trav != NULL && node_is_equal_ex(trav,"Header",envelope_ns)) {
+ head = trav;
+ trav = trav->next;
+ }
+
+ /* Get <Body> element */
+ body = NULL;
+ while (trav != NULL && trav->type != XML_ELEMENT_NODE) {
+ trav = trav->next;
+ }
+ if (trav != NULL && node_is_equal_ex(trav,"Body",envelope_ns)) {
+ body = trav;
+ trav = trav->next;
+ }
+ while (trav != NULL && trav->type != XML_ELEMENT_NODE) {
+ trav = trav->next;
+ }
+ if (body == NULL) {
+ soap_server_fault("Client", "Body must be present in a SOAP envelope", NULL, NULL, NULL TSRMLS_CC);
+ }
+ attr = body->properties;
+ while (attr != NULL) {
+ if (attr->ns == NULL) {
+ if (*version == SOAP_1_2) {
+ soap_server_fault("Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC);
+ }
+ } else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
+ if (*version == SOAP_1_2) {
+ soap_server_fault("Client", "encodingStyle cannot be specified on the Body", NULL, NULL, NULL TSRMLS_CC);
+ } else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
+ soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
+ }
+ }
+ attr = attr->next;
+ }
+
+ if (trav != NULL && *version == SOAP_1_2) {
+ soap_server_fault("Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL, NULL TSRMLS_CC);
+ }
+
+ func = NULL;
+ trav = body->children;
+ while (trav != NULL) {
+ if (trav->type == XML_ELEMENT_NODE) {
+/*
+ if (func != NULL) {
+ soap_server_fault("Client", "looks like we got \"Body\" with several functions call", NULL, NULL, NULL TSRMLS_CC);
+ }
+*/
+ func = trav;
+ break; /* FIXME: the rest of body is ignored */
+ }
+ trav = trav->next;
+ }
+ if (func == NULL) {
+ function = get_doc_function(sdl, NULL);
+ if (function != NULL) {
+ INIT_ZVAL(*function_name);
+ ZVAL_STRING(function_name, (char *)function->functionName, 1);
+ } else {
+ soap_server_fault("Client", "looks like we got \"Body\" without function call", NULL, NULL, NULL TSRMLS_CC);
+ }
+ } else {
+ if (*version == SOAP_1_1) {
+ attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE);
+ if (attr && strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
+ soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
+ }
+ } else {
+ attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE);
+ if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
+ soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
+ }
+ }
+ function = find_function(sdl, func, function_name);
+ if (sdl != NULL && function == NULL) {
+ if (*version == SOAP_1_2) {
+ soap_server_fault("rpc:ProcedureNotPresent","Procedure not present", NULL, NULL, NULL TSRMLS_CC);
+ } else {
+ php_error(E_ERROR, "Procedure '%s' not present", func->name);
+ }
+ }
+ }
+
+ *headers = NULL;
+ if (head) {
+ soapHeader *h, *last = NULL;
+
+ attr = head->properties;
+ while (attr != NULL) {
+ if (attr->ns == NULL) {
+ soap_server_fault("Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC);
+ } else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
+ if (*version == SOAP_1_2) {
+ soap_server_fault("Client", "encodingStyle cannot be specified on the Header", NULL, NULL, NULL TSRMLS_CC);
+ } else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
+ soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
+ }
+ }
+ attr = attr->next;
+ }
+ trav = head->children;
+ while (trav != NULL) {
+ if (trav->type == XML_ELEMENT_NODE) {
+ xmlNodePtr hdr_func = trav;
+ int mustUnderstand = 0;
+
+ if (*version == SOAP_1_1) {
+ attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE);
+ if (attr && strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
+ soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
+ }
+ attr = get_attribute_ex(hdr_func->properties,"actor",envelope_ns);
+ if (attr != NULL) {
+ if (strcmp((char*)attr->children->content,SOAP_1_1_ACTOR_NEXT) != 0 &&
+ (actor == NULL || strcmp((char*)attr->children->content,actor) != 0)) {
+ goto ignore_header;
+ }
+ }
+ } else if (*version == SOAP_1_2) {
+ attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE);
+ if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
+ soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
+ }
+ attr = get_attribute_ex(hdr_func->properties,"role",envelope_ns);
+ if (attr != NULL) {
+ if (strcmp((char*)attr->children->content,SOAP_1_2_ACTOR_UNLIMATERECEIVER) != 0 &&
+ strcmp((char*)attr->children->content,SOAP_1_2_ACTOR_NEXT) != 0 &&
+ (actor == NULL || strcmp((char*)attr->children->content,actor) != 0)) {
+ goto ignore_header;
+ }
+ }
+ }
+ attr = get_attribute_ex(hdr_func->properties,"mustUnderstand",envelope_ns);
+ if (attr) {
+ if (strcmp((char*)attr->children->content,"1") == 0 ||
+ strcmp((char*)attr->children->content,"true") == 0) {
+ mustUnderstand = 1;
+ } else if (strcmp((char*)attr->children->content,"0") == 0 ||
+ strcmp((char*)attr->children->content,"false") == 0) {
+ mustUnderstand = 0;
+ } else {
+ soap_server_fault("Client","mustUnderstand value is not boolean", NULL, NULL, NULL TSRMLS_CC);
+ }
+ }
+ h = emalloc(sizeof(soapHeader));
+ memset(h, 0, sizeof(soapHeader));
+ h->mustUnderstand = mustUnderstand;
+ h->function = find_function(sdl, hdr_func, &h->function_name);
+ if (!h->function && sdl && function && function->binding && function->binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionHeaderPtr *hdr;
+ sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
+ if (fnb->input.headers) {
+ smart_str key = {0};
+
+ if (hdr_func->ns) {
+ smart_str_appends(&key, (char*)hdr_func->ns->href);
+ smart_str_appendc(&key, ':');
+ }
+ smart_str_appendl(&key, Z_STRVAL(h->function_name), Z_STRLEN(h->function_name));
+ smart_str_0(&key);
+ if (zend_hash_find(fnb->input.headers, key.c, key.len+1, (void**)&hdr) == SUCCESS) {
+ h->hdr = *hdr;
+ }
+ smart_str_free(&key);
+ }
+ }
+ if (h->hdr) {
+ h->num_params = 1;
+ h->parameters = emalloc(sizeof(zval*));
+ h->parameters[0] = master_to_zval(h->hdr->encode, hdr_func TSRMLS_CC);
+ } else {
+ if (h->function && h->function->binding && h->function->binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)h->function->bindingAttributes;
+ if (fnb->style == SOAP_RPC) {
+ hdr_func = hdr_func->children;
+ }
+ }
+ deserialize_parameters(hdr_func, h->function, &h->num_params, &h->parameters TSRMLS_CC);
+ }
+ INIT_ZVAL(h->retval);
+ if (last == NULL) {
+ *headers = h;
+ } else {
+ last->next = h;
+ }
+ last = h;
+ }
+ignore_header:
+ trav = trav->next;
+ }
+ }
+
+ if (function && function->binding && function->binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
+ if (fnb->style == SOAP_RPC) {
+ func = func->children;
+ }
+ } else {
+ func = func->children;
+ }
+ deserialize_parameters(func, function, num_params, parameters TSRMLS_CC);
+
+ encode_finish();
+
+ return function;
+}
+
+static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, char *function_name, char *uri, zval *ret, int version, int main TSRMLS_DC)
+{
+ xmlNodePtr method = NULL, param;
+ sdlParamPtr parameter = NULL;
+ int param_count;
+ int style, use;
+ xmlNsPtr ns = NULL;
+
+ if (function != NULL && function->binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
+
+ style = fnb->style;
+ use = fnb->output.use;
+ if (style == SOAP_RPC) {
+ ns = encode_add_ns(body, fnb->output.ns);
+ if (function->responseName) {
+ method = xmlNewChild(body, ns, BAD_CAST(function->responseName), NULL);
+ } else if (function->responseParameters) {
+ method = xmlNewChild(body, ns, BAD_CAST(function->functionName), NULL);
+ }
+ }
+ } else {
+ style = main?SOAP_RPC:SOAP_DOCUMENT;
+ use = main?SOAP_ENCODED:SOAP_LITERAL;
+ if (style == SOAP_RPC) {
+ ns = encode_add_ns(body, uri);
+ method = xmlNewChild(body, ns, BAD_CAST(function_name), NULL);
+ }
+ }
+
+ if (function != NULL) {
+ if (function->responseParameters) {
+ param_count = zend_hash_num_elements(function->responseParameters);
+ } else {
+ param_count = 0;
+ }
+ } else {
+ param_count = 1;
+ }
+
+ if (param_count == 1) {
+ parameter = get_param(function, NULL, 0, TRUE);
+
+ if (style == SOAP_RPC) {
+ xmlNode *rpc_result;
+ if (main && version == SOAP_1_2) {
+ xmlNs *rpc_ns = xmlNewNs(body, BAD_CAST(RPC_SOAP12_NAMESPACE), BAD_CAST(RPC_SOAP12_NS_PREFIX));
+ rpc_result = xmlNewChild(method, rpc_ns, BAD_CAST("result"), NULL);
+ param = serialize_parameter(parameter, ret, 0, "return", use, method TSRMLS_CC);
+ xmlNodeSetContent(rpc_result,param->name);
+ } else {
+ param = serialize_parameter(parameter, ret, 0, "return", use, method TSRMLS_CC);
+ }
+ } else {
+ param = serialize_parameter(parameter, ret, 0, "return", use, body TSRMLS_CC);
+ if (function && function->binding->bindingType == BINDING_SOAP) {
+ if (parameter && parameter->element) {
+ ns = encode_add_ns(param, parameter->element->namens);
+ xmlNodeSetName(param, BAD_CAST(parameter->element->name));
+ xmlSetNs(param, ns);
+ }
+ } else if (strcmp((char*)param->name,"return") == 0) {
+ ns = encode_add_ns(param, uri);
+ xmlNodeSetName(param, BAD_CAST(function_name));
+ xmlSetNs(param, ns);
+ }
+ }
+ } else if (param_count > 1 && Z_TYPE_P(ret) == IS_ARRAY) {
+ HashPosition pos;
+ zval **data;
+ int i = 0;
+
+ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(ret), &pos);
+ while (zend_hash_get_current_data_ex(Z_ARRVAL_P(ret), (void **)&data, &pos) != FAILURE) {
+ char *param_name = NULL;
+ unsigned int param_name_len;
+ ulong param_index = i;
+
+ zend_hash_get_current_key_ex(Z_ARRVAL_P(ret), &param_name, &param_name_len, &param_index, 0, &pos);
+ parameter = get_param(function, param_name, param_index, TRUE);
+ if (style == SOAP_RPC) {
+ param = serialize_parameter(parameter, *data, i, param_name, use, method TSRMLS_CC);
+ } else {
+ param = serialize_parameter(parameter, *data, i, param_name, use, body TSRMLS_CC);
+ if (function && function->binding->bindingType == BINDING_SOAP) {
+ if (parameter && parameter->element) {
+ ns = encode_add_ns(param, parameter->element->namens);
+ xmlNodeSetName(param, BAD_CAST(parameter->element->name));
+ xmlSetNs(param, ns);
+ }
+ }
+ }
+
+ zend_hash_move_forward_ex(Z_ARRVAL_P(ret), &pos);
+ i++;
+ }
+ }
+ if (use == SOAP_ENCODED && version == SOAP_1_2 && method != NULL) {
+ xmlSetNsProp(method, body->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE));
+ }
+ return use;
+}
+
+static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function_name, char *uri, zval *ret, soapHeader* headers, int version TSRMLS_DC)
+{
+ xmlDocPtr doc;
+ xmlNodePtr envelope = NULL, body, param;
+ xmlNsPtr ns = NULL;
+ int use = SOAP_LITERAL;
+ xmlNodePtr head = NULL;
+
+ encode_reset_ns();
+
+ doc = xmlNewDoc(BAD_CAST("1.0"));
+ doc->charset = XML_CHAR_ENCODING_UTF8;
+ doc->encoding = xmlCharStrdup("UTF-8");
+
+ if (version == SOAP_1_1) {
+ envelope = xmlNewDocNode(doc, NULL, BAD_CAST("Envelope"), NULL);
+ ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_1_ENV_NAMESPACE), BAD_CAST(SOAP_1_1_ENV_NS_PREFIX));
+ xmlSetNs(envelope,ns);
+ } else if (version == SOAP_1_2) {
+ envelope = xmlNewDocNode(doc, NULL, BAD_CAST("Envelope"), NULL);
+ ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENV_NAMESPACE), BAD_CAST(SOAP_1_2_ENV_NS_PREFIX));
+ xmlSetNs(envelope,ns);
+ } else {
+ soap_server_fault("Server", "Unknown SOAP version", NULL, NULL, NULL TSRMLS_CC);
+ }
+ xmlDocSetRootElement(doc, envelope);
+
+ if (Z_TYPE_P(ret) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(ret), soap_fault_class_entry TSRMLS_CC)) {
+ char *detail_name;
+ HashTable* prop;
+ zval **tmp;
+ sdlFaultPtr fault = NULL;
+ char *fault_ns = NULL;
+
+ prop = Z_OBJPROP_P(ret);
+
+ if (headers &&
+ zend_hash_find(prop, "headerfault", sizeof("headerfault"), (void**)&tmp) == SUCCESS) {
+ encodePtr hdr_enc = NULL;
+ int hdr_use = SOAP_LITERAL;
+ zval *hdr_ret = *tmp;
+ char *hdr_ns = headers->hdr?headers->hdr->ns:NULL;
+ char *hdr_name = Z_STRVAL(headers->function_name);
+
+ head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL);
+ if (Z_TYPE_P(hdr_ret) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(hdr_ret), soap_header_class_entry TSRMLS_CC)) {
+ HashTable* ht = Z_OBJPROP_P(hdr_ret);
+ sdlSoapBindingFunctionHeaderPtr *hdr;
+ smart_str key = {0};
+
+ if (zend_hash_find(ht, "namespace", sizeof("namespace"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ smart_str_appendc(&key, ':');
+ hdr_ns = Z_STRVAL_PP(tmp);
+ }
+ if (zend_hash_find(ht, "name", sizeof("name"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ hdr_name = Z_STRVAL_PP(tmp);
+ }
+ smart_str_0(&key);
+ if (headers->hdr && headers->hdr->headerfaults &&
+ zend_hash_find(headers->hdr->headerfaults, key.c, key.len+1, (void**)&hdr) == SUCCESS) {
+ hdr_enc = (*hdr)->encode;
+ hdr_use = (*hdr)->use;
+ }
+ smart_str_free(&key);
+ if (zend_hash_find(ht, "data", sizeof("data"), (void**)&tmp) == SUCCESS) {
+ hdr_ret = *tmp;
+ } else {
+ hdr_ret = NULL;
+ }
+ }
+
+ if (headers->function) {
+ if (serialize_response_call2(head, headers->function, Z_STRVAL(headers->function_name), uri, hdr_ret, version, 0 TSRMLS_CC) == SOAP_ENCODED) {
+ use = SOAP_ENCODED;
+ }
+ } else {
+ xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head TSRMLS_CC);
+ if (hdr_name) {
+ xmlNodeSetName(xmlHdr, BAD_CAST(hdr_name));
+ }
+ if (hdr_ns) {
+ xmlNsPtr nsptr = encode_add_ns(xmlHdr, hdr_ns);
+ xmlSetNs(xmlHdr, nsptr);
+ }
+ }
+ }
+
+ body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL);
+ param = xmlNewChild(body, ns, BAD_CAST("Fault"), NULL);
+
+ if (zend_hash_find(prop, "faultcodens", sizeof("faultcodens"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) {
+ fault_ns = Z_STRVAL_PP(tmp);
+ }
+ use = SOAP_LITERAL;
+ if (zend_hash_find(prop, "_name", sizeof("_name"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) {
+ sdlFaultPtr *tmp_fault;
+ if (function && function->faults &&
+ zend_hash_find(function->faults, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)+1, (void**)&tmp_fault) == SUCCESS) {
+ fault = *tmp_fault;
+ if (function->binding &&
+ function->binding->bindingType == BINDING_SOAP &&
+ fault->bindingAttributes) {
+ sdlSoapBindingFunctionFaultPtr fb = (sdlSoapBindingFunctionFaultPtr)fault->bindingAttributes;
+ use = fb->use;
+ if (fault_ns == NULL) {
+ fault_ns = fb->ns;
+ }
+ }
+ }
+ } else if (function && function->faults &&
+ zend_hash_num_elements(function->faults) == 1) {
+
+ zend_hash_internal_pointer_reset(function->faults);
+ zend_hash_get_current_data(function->faults, (void**)&fault);
+ fault = *(sdlFaultPtr*)fault;
+ if (function->binding &&
+ function->binding->bindingType == BINDING_SOAP &&
+ fault->bindingAttributes) {
+ sdlSoapBindingFunctionFaultPtr fb = (sdlSoapBindingFunctionFaultPtr)fault->bindingAttributes;
+ use = fb->use;
+ if (fault_ns == NULL) {
+ fault_ns = fb->ns;
+ }
+ }
+ }
+
+ if (fault_ns == NULL &&
+ fault &&
+ fault->details &&
+ zend_hash_num_elements(fault->details) == 1) {
+ sdlParamPtr sparam;
+
+ zend_hash_internal_pointer_reset(fault->details);
+ zend_hash_get_current_data(fault->details, (void**)&sparam);
+ sparam = *(sdlParamPtr*)sparam;
+ if (sparam->element) {
+ fault_ns = sparam->element->namens;
+ }
+ }
+
+ if (version == SOAP_1_1) {
+ if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) {
+ int new_len;
+ xmlNodePtr node = xmlNewNode(NULL, BAD_CAST("faultcode"));
+ char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC);
+ xmlAddChild(param, node);
+ if (fault_ns) {
+ xmlNsPtr nsptr = encode_add_ns(node, fault_ns);
+ xmlChar *code = xmlBuildQName(BAD_CAST(str), nsptr->prefix, NULL, 0);
+ xmlNodeSetContent(node, code);
+ xmlFree(code);
+ } else {
+ xmlNodeSetContentLen(node, BAD_CAST(str), new_len);
+ }
+ efree(str);
+ }
+ if (zend_hash_find(prop, "faultstring", sizeof("faultstring"), (void**)&tmp) == SUCCESS) {
+ xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), *tmp, SOAP_LITERAL, param TSRMLS_CC);
+ xmlNodeSetName(node, BAD_CAST("faultstring"));
+ }
+ if (zend_hash_find(prop, "faultactor", sizeof("faultactor"), (void**)&tmp) == SUCCESS) {
+ xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), *tmp, SOAP_LITERAL, param TSRMLS_CC);
+ xmlNodeSetName(node, BAD_CAST("faultactor"));
+ }
+ detail_name = "detail";
+ } else {
+ if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) {
+ int new_len;
+ xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Code"), NULL);
+ char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC);
+ node = xmlNewChild(node, ns, BAD_CAST("Value"), NULL);
+ if (fault_ns) {
+ xmlNsPtr nsptr = encode_add_ns(node, fault_ns);
+ xmlChar *code = xmlBuildQName(BAD_CAST(str), nsptr->prefix, NULL, 0);
+ xmlNodeSetContent(node, code);
+ xmlFree(code);
+ } else {
+ xmlNodeSetContentLen(node, BAD_CAST(str), new_len);
+ }
+ efree(str);
+ }
+ if (zend_hash_find(prop, "faultstring", sizeof("faultstring"), (void**)&tmp) == SUCCESS) {
+ xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Reason"), NULL);
+ node = master_to_xml(get_conversion(IS_STRING), *tmp, SOAP_LITERAL, node TSRMLS_CC);
+ xmlNodeSetName(node, BAD_CAST("Text"));
+ xmlSetNs(node, ns);
+ }
+ detail_name = SOAP_1_2_ENV_NS_PREFIX":Detail";
+ }
+ if (fault && fault->details && zend_hash_num_elements(fault->details) == 1) {
+ xmlNodePtr node;
+ zval *detail = NULL;
+ sdlParamPtr sparam;
+ xmlNodePtr x;
+
+ if (zend_hash_find(prop, "detail", sizeof("detail"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) != IS_NULL) {
+ detail = *tmp;
+ }
+ node = xmlNewNode(NULL, BAD_CAST(detail_name));
+ xmlAddChild(param, node);
+
+ zend_hash_internal_pointer_reset(fault->details);
+ zend_hash_get_current_data(fault->details, (void**)&sparam);
+ sparam = *(sdlParamPtr*)sparam;
+
+ if (detail &&
+ Z_TYPE_P(detail) == IS_OBJECT &&
+ sparam->element &&
+ zend_hash_num_elements(Z_OBJPROP_P(detail)) == 1 &&
+ zend_hash_find(Z_OBJPROP_P(detail), sparam->element->name, strlen(sparam->element->name)+1, (void**)&tmp) == SUCCESS) {
+ detail = *tmp;
+ }
+
+ x = serialize_parameter(sparam, detail, 1, NULL, use, node TSRMLS_CC);
+
+ if (function &&
+ function->binding &&
+ function->binding->bindingType == BINDING_SOAP &&
+ function->bindingAttributes) {
+ sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
+ if (fnb->style == SOAP_RPC && !sparam->element) {
+ if (fault->bindingAttributes) {
+ sdlSoapBindingFunctionFaultPtr fb = (sdlSoapBindingFunctionFaultPtr)fault->bindingAttributes;
+ if (fb->ns) {
+ xmlNsPtr ns = encode_add_ns(x, fb->ns);
+ xmlSetNs(x, ns);
+ }
+ }
+ } else {
+ if (sparam->element) {
+ ns = encode_add_ns(x, sparam->element->namens);
+ xmlNodeSetName(x, BAD_CAST(sparam->element->name));
+ xmlSetNs(x, ns);
+ }
+ }
+ }
+ if (use == SOAP_ENCODED && version == SOAP_1_2) {
+ xmlSetNsProp(x, envelope->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE));
+ }
+ } else if (zend_hash_find(prop, "detail", sizeof("detail"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) != IS_NULL) {
+ serialize_zval(*tmp, NULL, detail_name, use, param TSRMLS_CC);
+ }
+ } else {
+
+ if (headers) {
+ soapHeader *h;
+
+ head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL);
+ h = headers;
+ while (h != NULL) {
+ if (Z_TYPE(h->retval) != IS_NULL) {
+ encodePtr hdr_enc = NULL;
+ int hdr_use = SOAP_LITERAL;
+ zval *hdr_ret = &h->retval;
+ char *hdr_ns = h->hdr?h->hdr->ns:NULL;
+ char *hdr_name = Z_STRVAL(h->function_name);
+
+
+ if (Z_TYPE(h->retval) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE(h->retval), soap_header_class_entry TSRMLS_CC)) {
+ HashTable* ht = Z_OBJPROP(h->retval);
+ zval **tmp;
+ sdlSoapBindingFunctionHeaderPtr *hdr;
+ smart_str key = {0};
+
+ if (zend_hash_find(ht, "namespace", sizeof("namespace"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ smart_str_appendc(&key, ':');
+ hdr_ns = Z_STRVAL_PP(tmp);
+ }
+ if (zend_hash_find(ht, "name", sizeof("name"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ hdr_name = Z_STRVAL_PP(tmp);
+ }
+ smart_str_0(&key);
+ if (function && function->binding && function->binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
+
+ if (fnb->output.headers &&
+ zend_hash_find(fnb->output.headers, key.c, key.len+1, (void**)&hdr) == SUCCESS) {
+ hdr_enc = (*hdr)->encode;
+ hdr_use = (*hdr)->use;
+ }
+ }
+ smart_str_free(&key);
+ if (zend_hash_find(ht, "data", sizeof("data"), (void**)&tmp) == SUCCESS) {
+ hdr_ret = *tmp;
+ } else {
+ hdr_ret = NULL;
+ }
+ }
+
+ if (h->function) {
+ if (serialize_response_call2(head, h->function, Z_STRVAL(h->function_name), uri, hdr_ret, version, 0 TSRMLS_CC) == SOAP_ENCODED) {
+ use = SOAP_ENCODED;
+ }
+ } else {
+ xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head TSRMLS_CC);
+ if (hdr_name) {
+ xmlNodeSetName(xmlHdr, BAD_CAST(hdr_name));
+ }
+ if (hdr_ns) {
+ xmlNsPtr nsptr = encode_add_ns(xmlHdr,hdr_ns);
+ xmlSetNs(xmlHdr, nsptr);
+ }
+ }
+ }
+ h = h->next;
+ }
+
+ if (head->children == NULL) {
+ xmlUnlinkNode(head);
+ xmlFreeNode(head);
+ }
+ }
+
+ body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL);
+
+ if (serialize_response_call2(body, function, function_name, uri, ret, version, 1 TSRMLS_CC) == SOAP_ENCODED) {
+ use = SOAP_ENCODED;
+ }
+
+ }
+
+ if (use == SOAP_ENCODED) {
+ xmlNewNs(envelope, BAD_CAST(XSD_NAMESPACE), BAD_CAST(XSD_NS_PREFIX));
+ if (version == SOAP_1_1) {
+ xmlNewNs(envelope, BAD_CAST(SOAP_1_1_ENC_NAMESPACE), BAD_CAST(SOAP_1_1_ENC_NS_PREFIX));
+ xmlSetNsProp(envelope, envelope->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_1_ENC_NAMESPACE));
+ } else if (version == SOAP_1_2) {
+ xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENC_NAMESPACE), BAD_CAST(SOAP_1_2_ENC_NS_PREFIX));
+ }
+ }
+
+ encode_finish();
+
+ if (function && function->responseName == NULL &&
+ body->children == NULL && head == NULL) {
+ xmlFreeDoc(doc);
+ return NULL;
+ }
+ return doc;
+}
+
+static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval **arguments, int arg_count, int version, HashTable *soap_headers TSRMLS_DC)
+{
+ xmlDoc *doc;
+ xmlNodePtr envelope = NULL, body, method = NULL, head = NULL;
+ xmlNsPtr ns = NULL;
+ zval **zstyle, **zuse;
+ int i, style, use;
+ HashTable *hdrs = NULL;
+
+ encode_reset_ns();
+
+ doc = xmlNewDoc(BAD_CAST("1.0"));
+ doc->encoding = xmlCharStrdup("UTF-8");
+ doc->charset = XML_CHAR_ENCODING_UTF8;
+ if (version == SOAP_1_1) {
+ envelope = xmlNewDocNode(doc, NULL, BAD_CAST("Envelope"), NULL);
+ ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_1_ENV_NAMESPACE), BAD_CAST(SOAP_1_1_ENV_NS_PREFIX));
+ xmlSetNs(envelope, ns);
+ } else if (version == SOAP_1_2) {
+ envelope = xmlNewDocNode(doc, NULL, BAD_CAST("Envelope"), NULL);
+ ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENV_NAMESPACE), BAD_CAST(SOAP_1_2_ENV_NS_PREFIX));
+ xmlSetNs(envelope, ns);
+ } else {
+ soap_error0(E_ERROR, "Unknown SOAP version");
+ }
+ xmlDocSetRootElement(doc, envelope);
+
+ if (soap_headers) {
+ head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL);
+ }
+
+ body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL);
+
+ if (function && function->binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
+
+ hdrs = fnb->input.headers;
+ style = fnb->style;
+ /*FIXME: how to pass method name if style is SOAP_DOCUMENT */
+ /*style = SOAP_RPC;*/
+ use = fnb->input.use;
+ if (style == SOAP_RPC) {
+ ns = encode_add_ns(body, fnb->input.ns);
+ if (function->requestName) {
+ method = xmlNewChild(body, ns, BAD_CAST(function->requestName), NULL);
+ } else {
+ method = xmlNewChild(body, ns, BAD_CAST(function->functionName), NULL);
+ }
+ }
+ } else {
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "style", sizeof("style"), (void **)&zstyle) == SUCCESS) {
+ style = Z_LVAL_PP(zstyle);
+ } else {
+ style = SOAP_RPC;
+ }
+ /*FIXME: how to pass method name if style is SOAP_DOCUMENT */
+ /*style = SOAP_RPC;*/
+ if (style == SOAP_RPC) {
+ ns = encode_add_ns(body, uri);
+ if (function_name) {
+ method = xmlNewChild(body, ns, BAD_CAST(function_name), NULL);
+ } else if (function && function->requestName) {
+ method = xmlNewChild(body, ns, BAD_CAST(function->requestName), NULL);
+ } else if (function && function->functionName) {
+ method = xmlNewChild(body, ns, BAD_CAST(function->functionName), NULL);
+ } else {
+ method = body;
+ }
+ } else {
+ method = body;
+ }
+
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "use", sizeof("use"), (void **)&zuse) == SUCCESS &&
+ Z_LVAL_PP(zuse) == SOAP_LITERAL) {
+ use = SOAP_LITERAL;
+ } else {
+ use = SOAP_ENCODED;
+ }
+ }
+
+ for (i = 0;i < arg_count;i++) {
+ xmlNodePtr param;
+ sdlParamPtr parameter = get_param(function, NULL, i, FALSE);
+
+ if (style == SOAP_RPC) {
+ param = serialize_parameter(parameter, arguments[i], i, NULL, use, method TSRMLS_CC);
+ } else if (style == SOAP_DOCUMENT) {
+ param = serialize_parameter(parameter, arguments[i], i, NULL, use, body TSRMLS_CC);
+ if (function && function->binding->bindingType == BINDING_SOAP) {
+ if (parameter && parameter->element) {
+ ns = encode_add_ns(param, parameter->element->namens);
+ xmlNodeSetName(param, BAD_CAST(parameter->element->name));
+ xmlSetNs(param, ns);
+ }
+ }
+ }
+ }
+
+ if (function && function->requestParameters) {
+ int n = zend_hash_num_elements(function->requestParameters);
+
+ if (n > arg_count) {
+ for (i = arg_count; i < n; i++) {
+ xmlNodePtr param;
+ sdlParamPtr parameter = get_param(function, NULL, i, FALSE);
+
+ if (style == SOAP_RPC) {
+ param = serialize_parameter(parameter, NULL, i, NULL, use, method TSRMLS_CC);
+ } else if (style == SOAP_DOCUMENT) {
+ param = serialize_parameter(parameter, NULL, i, NULL, use, body TSRMLS_CC);
+ if (function && function->binding->bindingType == BINDING_SOAP) {
+ if (parameter && parameter->element) {
+ ns = encode_add_ns(param, parameter->element->namens);
+ xmlNodeSetName(param, BAD_CAST(parameter->element->name));
+ xmlSetNs(param, ns);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (head) {
+ zval** header;
+
+ zend_hash_internal_pointer_reset(soap_headers);
+ while (zend_hash_get_current_data(soap_headers,(void**)&header) == SUCCESS) {
+ HashTable *ht = Z_OBJPROP_PP(header);
+ zval **name, **ns, **tmp;
+
+ if (zend_hash_find(ht, "name", sizeof("name"), (void**)&name) == SUCCESS &&
+ Z_TYPE_PP(name) == IS_STRING &&
+ zend_hash_find(ht, "namespace", sizeof("namespace"), (void**)&ns) == SUCCESS &&
+ Z_TYPE_PP(ns) == IS_STRING) {
+ xmlNodePtr h;
+ xmlNsPtr nsptr;
+ int hdr_use = SOAP_LITERAL;
+ encodePtr enc = NULL;
+
+ if (hdrs) {
+ smart_str key = {0};
+ sdlSoapBindingFunctionHeaderPtr *hdr;
+
+ smart_str_appendl(&key, Z_STRVAL_PP(ns), Z_STRLEN_PP(ns));
+ smart_str_appendc(&key, ':');
+ smart_str_appendl(&key, Z_STRVAL_PP(name), Z_STRLEN_PP(name));
+ smart_str_0(&key);
+ if (zend_hash_find(hdrs, key.c, key.len+1,(void**)&hdr) == SUCCESS) {
+ hdr_use = (*hdr)->use;
+ enc = (*hdr)->encode;
+ if (hdr_use == SOAP_ENCODED) {
+ use = SOAP_ENCODED;
+ }
+ }
+ smart_str_free(&key);
+ }
+
+ if (zend_hash_find(ht, "data", sizeof("data"), (void**)&tmp) == SUCCESS) {
+ h = master_to_xml(enc, *tmp, hdr_use, head TSRMLS_CC);
+ xmlNodeSetName(h, BAD_CAST(Z_STRVAL_PP(name)));
+ } else {
+ h = xmlNewNode(NULL, BAD_CAST(Z_STRVAL_PP(name)));
+ xmlAddChild(head, h);
+ }
+ nsptr = encode_add_ns(h, Z_STRVAL_PP(ns));
+ xmlSetNs(h, nsptr);
+
+ if (zend_hash_find(ht, "mustUnderstand", sizeof("mustUnderstand"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_BOOL && Z_LVAL_PP(tmp)) {
+ if (version == SOAP_1_1) {
+ xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("1"));
+ } else {
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("true"));
+ }
+ }
+ if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) {
+ if (Z_TYPE_PP(tmp) == IS_STRING) {
+ if (version == SOAP_1_1) {
+ xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(Z_STRVAL_PP(tmp)));
+ } else {
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(Z_STRVAL_PP(tmp)));
+ }
+ } else if (Z_TYPE_PP(tmp) == IS_LONG) {
+ if (version == SOAP_1_1) {
+ if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) {
+ xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(SOAP_1_1_ACTOR_NEXT));
+ }
+ } else {
+ if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) {
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NEXT));
+ } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NONE) {
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NONE));
+ } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_UNLIMATERECEIVER) {
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_UNLIMATERECEIVER));
+ }
+ }
+ }
+ }
+ }
+ zend_hash_move_forward(soap_headers);
+ }
+ }
+
+ if (use == SOAP_ENCODED) {
+ xmlNewNs(envelope, BAD_CAST(XSD_NAMESPACE), BAD_CAST(XSD_NS_PREFIX));
+ if (version == SOAP_1_1) {
+ xmlNewNs(envelope, BAD_CAST(SOAP_1_1_ENC_NAMESPACE), BAD_CAST(SOAP_1_1_ENC_NS_PREFIX));
+ xmlSetNsProp(envelope, envelope->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_1_ENC_NAMESPACE));
+ } else if (version == SOAP_1_2) {
+ xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENC_NAMESPACE), BAD_CAST(SOAP_1_2_ENC_NS_PREFIX));
+ if (method) {
+ xmlSetNsProp(method, envelope->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE));
+ }
+ }
+ }
+
+ encode_finish();
+
+ return doc;
+}
+
+static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int index, char *name, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ char *paramName;
+ xmlNodePtr xmlParam;
+ char paramNameBuf[10];
+
+ if (param_val &&
+ Z_TYPE_P(param_val) == IS_OBJECT &&
+ Z_OBJCE_P(param_val) == soap_param_class_entry) {
+ zval **param_name;
+ zval **param_data;
+
+ if (zend_hash_find(Z_OBJPROP_P(param_val), "param_name", sizeof("param_name"), (void **)&param_name) == SUCCESS &&
+ zend_hash_find(Z_OBJPROP_P(param_val), "param_data", sizeof("param_data"), (void **)&param_data) == SUCCESS) {
+ param_val = *param_data;
+ name = Z_STRVAL_PP(param_name);
+ }
+ }
+
+ if (param != NULL && param->paramName != NULL) {
+ paramName = param->paramName;
+ } else {
+ if (name == NULL) {
+ paramName = paramNameBuf;
+ snprintf(paramName, sizeof(paramNameBuf), "param%d",index);
+ } else {
+ paramName = name;
+ }
+ }
+
+ xmlParam = serialize_zval(param_val, param, paramName, style, parent TSRMLS_CC);
+
+ return xmlParam;
+}
+
+static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent TSRMLS_DC)
+{
+ xmlNodePtr xmlParam;
+ encodePtr enc;
+ zval defval;
+
+ if (param != NULL) {
+ enc = param->encode;
+ if (val == NULL) {
+ if (param->element) {
+ if (param->element->fixed) {
+ ZVAL_STRING(&defval, param->element->fixed, 0);
+ val = &defval;
+ } else if (param->element->def && !param->element->nillable) {
+ ZVAL_STRING(&defval, param->element->def, 0);
+ val = &defval;
+ }
+ }
+ }
+ } else {
+ enc = NULL;
+ }
+ xmlParam = master_to_xml(enc, val, style, parent TSRMLS_CC);
+ if (!strcmp((char*)xmlParam->name, "BOGUS")) {
+ xmlNodeSetName(xmlParam, BAD_CAST(paramName));
+ }
+ return xmlParam;
+}
+
+static sdlParamPtr get_param(sdlFunctionPtr function, char *param_name, int index, int response)
+{
+ sdlParamPtr *tmp;
+ HashTable *ht;
+
+ if (function == NULL) {
+ return NULL;
+ }
+
+ if (response == FALSE) {
+ ht = function->requestParameters;
+ } else {
+ ht = function->responseParameters;
+ }
+
+ if (ht == NULL) {
+ return NULL;
+ }
+
+ if (param_name != NULL) {
+ if (zend_hash_find(ht, param_name, strlen(param_name), (void **)&tmp) != FAILURE) {
+ return *tmp;
+ } else {
+ HashPosition pos;
+
+ zend_hash_internal_pointer_reset_ex(ht, &pos);
+ while (zend_hash_get_current_data_ex(ht, (void **)&tmp, &pos) != FAILURE) {
+ if ((*tmp)->paramName && strcmp(param_name, (*tmp)->paramName) == 0) {
+ return *tmp;
+ }
+ zend_hash_move_forward_ex(ht, &pos);
+ }
+ }
+ } else {
+ if (zend_hash_index_find(ht, index, (void **)&tmp) != FAILURE) {
+ return (*tmp);
+ }
+ }
+ return NULL;
+}
+
+static sdlFunctionPtr get_function(sdlPtr sdl, const char *function_name)
+{
+ sdlFunctionPtr *tmp;
+
+ int len = strlen(function_name);
+ char *str = estrndup(function_name,len);
+ php_strtolower(str,len);
+ if (sdl != NULL) {
+ if (zend_hash_find(&sdl->functions, str, len+1, (void **)&tmp) != FAILURE) {
+ efree(str);
+ return (*tmp);
+ } else if (sdl->requests != NULL && zend_hash_find(sdl->requests, str, len+1, (void **)&tmp) != FAILURE) {
+ efree(str);
+ return (*tmp);
+ }
+ }
+ efree(str);
+ return NULL;
+}
+
+static sdlFunctionPtr get_doc_function(sdlPtr sdl, xmlNodePtr params)
+{
+ if (sdl) {
+ sdlFunctionPtr *tmp;
+ sdlParamPtr *param;
+
+ zend_hash_internal_pointer_reset(&sdl->functions);
+ while (zend_hash_get_current_data(&sdl->functions, (void**)&tmp) == SUCCESS) {
+ if ((*tmp)->binding && (*tmp)->binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)(*tmp)->bindingAttributes;
+ if (fnb->style == SOAP_DOCUMENT) {
+ if (params == NULL) {
+ if ((*tmp)->requestParameters == NULL ||
+ zend_hash_num_elements((*tmp)->requestParameters) == 0) {
+ return *tmp;
+ }
+ } else if ((*tmp)->requestParameters != NULL &&
+ zend_hash_num_elements((*tmp)->requestParameters) > 0) {
+ int ok = 1;
+ xmlNodePtr node = params;
+
+ zend_hash_internal_pointer_reset((*tmp)->requestParameters);
+ while (zend_hash_get_current_data((*tmp)->requestParameters, (void**)&param) == SUCCESS) {
+ if ((*param)->element) {
+ if (strcmp((*param)->element->name, (char*)node->name) != 0) {
+ ok = 0;
+ break;
+ }
+ if ((*param)->element->namens != NULL && node->ns != NULL) {
+ if (strcmp((*param)->element->namens, (char*)node->ns->href) != 0) {
+ ok = 0;
+ break;
+ }
+ } else if ((void*)(*param)->element->namens != (void*)node->ns) {
+ ok = 0;
+ break;
+ }
+ } else if (strcmp((*param)->paramName, (char*)node->name) != 0) {
+ ok = 0;
+ break;
+ }
+ zend_hash_move_forward((*tmp)->requestParameters);
+ node = node->next;
+ }
+ if (ok /*&& node == NULL*/) {
+ return (*tmp);
+ }
+ }
+ }
+ }
+ zend_hash_move_forward(&sdl->functions);
+ }
+ }
+ return NULL;
+}
+
+static void function_to_string(sdlFunctionPtr function, smart_str *buf)
+{
+ int i = 0;
+ HashPosition pos;
+ sdlParamPtr *param;
+
+ if (function->responseParameters &&
+ zend_hash_num_elements(function->responseParameters) > 0) {
+ if (zend_hash_num_elements(function->responseParameters) == 1) {
+ zend_hash_internal_pointer_reset(function->responseParameters);
+ zend_hash_get_current_data(function->responseParameters, (void**)&param);
+ if ((*param)->encode && (*param)->encode->details.type_str) {
+ smart_str_appendl(buf, (*param)->encode->details.type_str, strlen((*param)->encode->details.type_str));
+ smart_str_appendc(buf, ' ');
+ } else {
+ smart_str_appendl(buf, "UNKNOWN ", 8);
+ }
+ } else {
+ i = 0;
+ smart_str_appendl(buf, "list(", 5);
+ zend_hash_internal_pointer_reset_ex(function->responseParameters, &pos);
+ while (zend_hash_get_current_data_ex(function->responseParameters, (void **)&param, &pos) != FAILURE) {
+ if (i > 0) {
+ smart_str_appendl(buf, ", ", 2);
+ }
+ if ((*param)->encode && (*param)->encode->details.type_str) {
+ smart_str_appendl(buf, (*param)->encode->details.type_str, strlen((*param)->encode->details.type_str));
+ } else {
+ smart_str_appendl(buf, "UNKNOWN", 7);
+ }
+ smart_str_appendl(buf, " $", 2);
+ smart_str_appendl(buf, (*param)->paramName, strlen((*param)->paramName));
+ zend_hash_move_forward_ex(function->responseParameters, &pos);
+ i++;
+ }
+ smart_str_appendl(buf, ") ", 2);
+ }
+ } else {
+ smart_str_appendl(buf, "void ", 5);
+ }
+
+ smart_str_appendl(buf, function->functionName, strlen(function->functionName));
+
+ smart_str_appendc(buf, '(');
+ if (function->requestParameters) {
+ i = 0;
+ zend_hash_internal_pointer_reset_ex(function->requestParameters, &pos);
+ while (zend_hash_get_current_data_ex(function->requestParameters, (void **)&param, &pos) != FAILURE) {
+ if (i > 0) {
+ smart_str_appendl(buf, ", ", 2);
+ }
+ if ((*param)->encode && (*param)->encode->details.type_str) {
+ smart_str_appendl(buf, (*param)->encode->details.type_str, strlen((*param)->encode->details.type_str));
+ } else {
+ smart_str_appendl(buf, "UNKNOWN", 7);
+ }
+ smart_str_appendl(buf, " $", 2);
+ smart_str_appendl(buf, (*param)->paramName, strlen((*param)->paramName));
+ zend_hash_move_forward_ex(function->requestParameters, &pos);
+ i++;
+ }
+ }
+ smart_str_appendc(buf, ')');
+ smart_str_0(buf);
+}
+
+static void model_to_string(sdlContentModelPtr model, smart_str *buf, int level)
+{
+ int i;
+
+ switch (model->kind) {
+ case XSD_CONTENT_ELEMENT:
+ type_to_string(model->u.element, buf, level);
+ smart_str_appendl(buf, ";\n", 2);
+ break;
+ case XSD_CONTENT_ANY:
+ for (i = 0;i < level;i++) {
+ smart_str_appendc(buf, ' ');
+ }
+ smart_str_appendl(buf, "<anyXML> any;\n", sizeof("<anyXML> any;\n")-1);
+ break;
+ case XSD_CONTENT_SEQUENCE:
+ case XSD_CONTENT_ALL:
+ case XSD_CONTENT_CHOICE: {
+ sdlContentModelPtr *tmp;
+
+ zend_hash_internal_pointer_reset(model->u.content);
+ while (zend_hash_get_current_data(model->u.content, (void**)&tmp) == SUCCESS) {
+ model_to_string(*tmp, buf, level);
+ zend_hash_move_forward(model->u.content);
+ }
+ break;
+ }
+ case XSD_CONTENT_GROUP:
+ model_to_string(model->u.group->model, buf, level);
+ default:
+ break;
+ }
+}
+
+static void type_to_string(sdlTypePtr type, smart_str *buf, int level)
+{
+ int i;
+ smart_str spaces = {0};
+ HashPosition pos;
+
+ for (i = 0;i < level;i++) {
+ smart_str_appendc(&spaces, ' ');
+ }
+ smart_str_appendl(buf, spaces.c, spaces.len);
+
+ switch (type->kind) {
+ case XSD_TYPEKIND_SIMPLE:
+ if (type->encode) {
+ smart_str_appendl(buf, type->encode->details.type_str, strlen(type->encode->details.type_str));
+ smart_str_appendc(buf, ' ');
+ } else {
+ smart_str_appendl(buf, "anyType ", sizeof("anyType ")-1);
+ }
+ smart_str_appendl(buf, type->name, strlen(type->name));
+ break;
+ case XSD_TYPEKIND_LIST:
+ smart_str_appendl(buf, "list ", 5);
+ smart_str_appendl(buf, type->name, strlen(type->name));
+ if (type->elements) {
+ sdlTypePtr *item_type;
+
+ smart_str_appendl(buf, " {", 2);
+ zend_hash_internal_pointer_reset_ex(type->elements, &pos);
+ if (zend_hash_get_current_data_ex(type->elements, (void **)&item_type, &pos) != FAILURE) {
+ smart_str_appendl(buf, (*item_type)->name, strlen((*item_type)->name));
+ }
+ smart_str_appendc(buf, '}');
+ }
+ break;
+ case XSD_TYPEKIND_UNION:
+ smart_str_appendl(buf, "union ", 6);
+ smart_str_appendl(buf, type->name, strlen(type->name));
+ if (type->elements) {
+ sdlTypePtr *item_type;
+ int first = 0;
+
+ smart_str_appendl(buf, " {", 2);
+ zend_hash_internal_pointer_reset_ex(type->elements, &pos);
+ while (zend_hash_get_current_data_ex(type->elements, (void **)&item_type, &pos) != FAILURE) {
+ if (!first) {
+ smart_str_appendc(buf, ',');
+ first = 0;
+ }
+ smart_str_appendl(buf, (*item_type)->name, strlen((*item_type)->name));
+ zend_hash_move_forward_ex(type->elements, &pos);
+ }
+ smart_str_appendc(buf, '}');
+ }
+ break;
+ case XSD_TYPEKIND_COMPLEX:
+ case XSD_TYPEKIND_RESTRICTION:
+ case XSD_TYPEKIND_EXTENSION:
+ if (type->encode &&
+ (type->encode->details.type == IS_ARRAY ||
+ type->encode->details.type == SOAP_ENC_ARRAY)) {
+ sdlAttributePtr *attr;
+ sdlExtraAttributePtr *ext;
+
+ if (type->attributes &&
+ zend_hash_find(type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType",
+ sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType"),
+ (void **)&attr) == SUCCESS &&
+ zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) {
+ char *end = strchr((*ext)->val, '[');
+ int len;
+ if (end == NULL) {
+ len = strlen((*ext)->val);
+ } else {
+ len = end-(*ext)->val;
+ }
+ if (len == 0) {
+ smart_str_appendl(buf, "anyType", sizeof("anyType")-1);
+ } else {
+ smart_str_appendl(buf, (*ext)->val, len);
+ }
+ smart_str_appendc(buf, ' ');
+ smart_str_appendl(buf, type->name, strlen(type->name));
+ if (end != NULL) {
+ smart_str_appends(buf, end);
+ }
+ } else {
+ sdlTypePtr elementType;
+ if (type->attributes &&
+ zend_hash_find(type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType",
+ sizeof(SOAP_1_2_ENC_NAMESPACE":itemType"),
+ (void **)&attr) == SUCCESS &&
+ zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) {
+ smart_str_appends(buf, (*ext)->val);
+ smart_str_appendc(buf, ' ');
+ } else if (type->elements &&
+ zend_hash_num_elements(type->elements) == 1 &&
+ (zend_hash_internal_pointer_reset(type->elements),
+ zend_hash_get_current_data(type->elements, (void**)&elementType) == SUCCESS) &&
+ (elementType = *(sdlTypePtr*)elementType) != NULL &&
+ elementType->encode && elementType->encode->details.type_str) {
+ smart_str_appends(buf, elementType->encode->details.type_str);
+ smart_str_appendc(buf, ' ');
+ } else {
+ smart_str_appendl(buf, "anyType ", 8);
+ }
+ smart_str_appendl(buf, type->name, strlen(type->name));
+ if (type->attributes &&
+ zend_hash_find(type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize",
+ sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"),
+ (void **)&attr) == SUCCESS &&
+ zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arraySize"), (void **)&ext) == SUCCESS) {
+ smart_str_appendc(buf, '[');
+ smart_str_appends(buf, (*ext)->val);
+ smart_str_appendc(buf, ']');
+ } else {
+ smart_str_appendl(buf, "[]", 2);
+ }
+ }
+ } else {
+ smart_str_appendl(buf, "struct ", 7);
+ smart_str_appendl(buf, type->name, strlen(type->name));
+ smart_str_appendc(buf, ' ');
+ smart_str_appendl(buf, "{\n", 2);
+ if ((type->kind == XSD_TYPEKIND_RESTRICTION ||
+ type->kind == XSD_TYPEKIND_EXTENSION) && type->encode) {
+ encodePtr enc = type->encode;
+ while (enc && enc->details.sdl_type &&
+ enc != enc->details.sdl_type->encode &&
+ enc->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE &&
+ enc->details.sdl_type->kind != XSD_TYPEKIND_LIST &&
+ enc->details.sdl_type->kind != XSD_TYPEKIND_UNION) {
+ enc = enc->details.sdl_type->encode;
+ }
+ if (enc) {
+ smart_str_appendl(buf, spaces.c, spaces.len);
+ smart_str_appendc(buf, ' ');
+ smart_str_appendl(buf, type->encode->details.type_str, strlen(type->encode->details.type_str));
+ smart_str_appendl(buf, " _;\n", 4);
+ }
+ }
+ if (type->model) {
+ model_to_string(type->model, buf, level+1);
+ }
+ if (type->attributes) {
+ sdlAttributePtr *attr;
+
+ zend_hash_internal_pointer_reset_ex(type->attributes, &pos);
+ while (zend_hash_get_current_data_ex(type->attributes, (void **)&attr, &pos) != FAILURE) {
+ smart_str_appendl(buf, spaces.c, spaces.len);
+ smart_str_appendc(buf, ' ');
+ if ((*attr)->encode && (*attr)->encode->details.type_str) {
+ smart_str_appends(buf, (*attr)->encode->details.type_str);
+ smart_str_appendc(buf, ' ');
+ } else {
+ smart_str_appendl(buf, "UNKNOWN ", 8);
+ }
+ smart_str_appends(buf, (*attr)->name);
+ smart_str_appendl(buf, ";\n", 2);
+ zend_hash_move_forward_ex(type->attributes, &pos);
+ }
+ }
+ smart_str_appendl(buf, spaces.c, spaces.len);
+ smart_str_appendc(buf, '}');
+ }
+ break;
+ default:
+ break;
+ }
+ smart_str_free(&spaces);
+ smart_str_0(buf);
+}
+
+static void delete_url(void *handle)
+{
+ php_url_free((php_url*)handle);
+}
+
+static void delete_service(void *data)
+{
+ soapServicePtr service = (soapServicePtr)data;
+
+ if (service->soap_functions.ft) {
+ zend_hash_destroy(service->soap_functions.ft);
+ efree(service->soap_functions.ft);
+ }
+
+ if (service->typemap) {
+ zend_hash_destroy(service->typemap);
+ efree(service->typemap);
+ }
+
+ if (service->soap_class.argc) {
+ int i;
+ for (i = 0; i < service->soap_class.argc;i++) {
+ zval_ptr_dtor(&service->soap_class.argv[i]);
+ }
+ efree(service->soap_class.argv);
+ }
+
+ if (service->actor) {
+ efree(service->actor);
+ }
+ if (service->uri) {
+ efree(service->uri);
+ }
+ if (service->sdl) {
+ delete_sdl(service->sdl);
+ }
+ if (service->encoding) {
+ xmlCharEncCloseFunc(service->encoding);
+ }
+ if (service->class_map) {
+ zend_hash_destroy(service->class_map);
+ FREE_HASHTABLE(service->class_map);
+ }
+ if (service->soap_object) {
+ zval_ptr_dtor(&service->soap_object);
+ }
+ efree(service);
+}
+
+static void delete_hashtable(void *data)
+{
+ HashTable *ht = (HashTable*)data;
+ zend_hash_destroy(ht);
+ efree(ht);
+}
diff --git a/ext/soap/tests/any.phpt b/ext/soap/tests/any.phpt
new file mode 100644
index 0000000..93a0e66
--- /dev/null
+++ b/ext/soap/tests/any.phpt
@@ -0,0 +1,92 @@
+--TEST--
+SOAP handling of <any>
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+
+function echoAnyElement($x) {
+ global $g;
+
+ $g = $x;
+ $struct = $x->inputAny->any["SOAPComplexType"];
+ if ($struct instanceof SOAPComplexType) {
+ return array("return" => array("any" => array("SOAPComplexType"=>new SoapVar($struct, SOAP_ENC_OBJECT, "SOAPComplexType", "http://soapinterop.org/xsd", "SOAPComplexType", "http://soapinterop.org/"))));
+ } else {
+ return "?";
+ }
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('echoAnyElement');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+}
+
+$client = new TestSoapClient(dirname(__FILE__)."/interop/Round4/GroupI/round4_groupI_xsd.wsdl",
+ array("trace"=>1,"exceptions"=>0,
+ 'classmap' => array('SOAPComplexType'=>'SOAPComplexType')));
+$ret = $client->echoAnyElement(
+ array(
+ "inputAny"=>array(
+ "any"=>new SoapVar($struct, SOAP_ENC_OBJECT, "SOAPComplexType", "http://soapinterop.org/xsd", "SOAPComplexType", "http://soapinterop.org/")
+ )));
+var_dump($g);
+var_dump($ret);
+?>
+--EXPECT--
+object(stdClass)#5 (1) {
+ ["inputAny"]=>
+ object(stdClass)#6 (1) {
+ ["any"]=>
+ array(1) {
+ ["SOAPComplexType"]=>
+ object(SOAPComplexType)#7 (3) {
+ ["varInt"]=>
+ int(34)
+ ["varString"]=>
+ string(3) "arg"
+ ["varFloat"]=>
+ float(325.325)
+ }
+ }
+ }
+}
+object(stdClass)#8 (1) {
+ ["return"]=>
+ object(stdClass)#9 (1) {
+ ["any"]=>
+ array(1) {
+ ["SOAPComplexType"]=>
+ object(SOAPComplexType)#10 (3) {
+ ["varInt"]=>
+ int(34)
+ ["varString"]=>
+ string(3) "arg"
+ ["varFloat"]=>
+ float(325.325)
+ }
+ }
+ }
+}
diff --git a/ext/soap/tests/bug46760.phpt b/ext/soap/tests/bug46760.phpt
new file mode 100644
index 0000000..95cb588
--- /dev/null
+++ b/ext/soap/tests/bug46760.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #46760 (SoapClient doRequest fails when proxy is used)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+$client = new SoapClient(null, array('proxy_host' => "localhost",
+ 'proxy_port' => '8080',
+ 'login' => "user",
+ 'password' => "test",
+ 'uri' => 'mo:http://www.w3.org/',
+ 'location' => 'http://some.url'));
+var_dump($client->_proxy_port);
+
+?>
+--EXPECT--
+int(8080)
diff --git a/ext/soap/tests/bug48557.phpt b/ext/soap/tests/bug48557.phpt
new file mode 100644
index 0000000..0724579
--- /dev/null
+++ b/ext/soap/tests/bug48557.phpt
@@ -0,0 +1,73 @@
+--TEST--
+Bug #48557 (Numeric string keys in Apache Hashmaps are not cast to integers)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+error_reporting(E_ALL);
+ini_set('display_errors', 1);
+ini_set("soap.wsdl_cache_enabled", 0);
+
+function test($map) {
+ var_dump($map, $map[1], $map[2]);die;
+}
+
+$y = new SoapServer(dirname(__FILE__) . '/bug48557.wsdl');
+$y->addfunction("test");
+$request = <<<XML
+<?xml version="1.0"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+ <SOAP-ENV:Body>
+ <ns1:test>
+ <testParam xsi:type="ns2:Map">
+ <item>
+ <key xsi:type="xsd:int">1</key>
+ <value xsi:type="xsd:int">123</value>
+ </item>
+ <item>
+ <key xsi:type="xsd:int">-1000</key>
+ <value xsi:type="xsd:string">123</value>
+ </item>
+ <item>
+ <key xsi:type="xsd:string">2</key>
+ <value xsi:type="xsd:float">123.5</value>
+ </item>
+ <item>
+ <key xsi:type="xsd:string">-2000</key>
+ <value xsi:type="xsd:float">123.5</value>
+ </item>
+ <item>
+ <key xsi:type="xsd:string">011</key>
+ <value xsi:type="xsd:float">123.5</value>
+ </item>
+ <item>
+ <key xsi:type="xsd:int">012</key>
+ <value xsi:type="xsd:float">123.5</value>
+ </item>
+ </testParam>
+ </ns1:test>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+XML;
+
+$y->handle($request);
+
+?>
+===DONE===
+--EXPECTF--
+array(6) {
+ [1]=>
+ int(123)
+ [-1000]=>
+ %string|unicode%(3) "123"
+ [2]=>
+ float(123.5)
+ [-2000]=>
+ float(123.5)
+ [%u|b%"011"]=>
+ float(123.5)
+ [12]=>
+ float(123.5)
+}
+int(123)
+float(123.5)
diff --git a/ext/soap/tests/bug48557.wsdl b/ext/soap/tests/bug48557.wsdl
new file mode 100644
index 0000000..dfab543
--- /dev/null
+++ b/ext/soap/tests/bug48557.wsdl
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://test-uri/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="InteropTest" targetNamespace="http://test-uri/">
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test-uri/">
+ <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
+ </schema>
+ </types>
+ <message name="testMessage">
+ <part xmlns:apache="http://xml.apache.org/xml-soap" name="testParam" type="apache:Map"/>
+ </message>
+ <portType name="testPortType">
+ <operation name="test">
+ <input message="testMessage"/>
+ </operation>
+ </portType>
+ <binding name="testBinding" type="testPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="test">
+ <soap:operation soapAction="#test" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://test-uri/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ </operation>
+ </binding>
+ <service name="testService">
+ <port name="testPort" binding="tns:testBinding">
+ <soap:address location="test://"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug27722.phpt b/ext/soap/tests/bugs/bug27722.phpt
new file mode 100644
index 0000000..d6d933b
--- /dev/null
+++ b/ext/soap/tests/bugs/bug27722.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #27722 (Segfault on schema without targetNamespace)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--GET--
+wsdl
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$x = new SoapClient(dirname(__FILE__)."/bug27722.wsdl");
+echo "ok\n";
+?>
+--EXPECT--
+ok \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug27722.wsdl b/ext/soap/tests/bugs/bug27722.wsdl
new file mode 100644
index 0000000..51f11e6
--- /dev/null
+++ b/ext/soap/tests/bugs/bug27722.wsdl
@@ -0,0 +1,92 @@
+<?xml version="1.0" ?>
+<definitions
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:si="http://soapinterop.org/xsd"
+ xmlns:tns="http://linuxsrv.home/~dmitry/soap/test.wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl">
+ <types>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Purchase order schema for Example.com.
+ Copyright 2000 Example.com. All rights reserved.
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
+
+ <xsd:element name="comment" type="xsd:string"/>
+
+ <xsd:complexType name="PurchaseOrderType">
+ <xsd:sequence>
+ <xsd:element name="shipTo" type="USAddress"/>
+ <xsd:element name="billTo" type="USAddress"/>
+ <xsd:element ref="comment" minOccurs="0"/>
+ <xsd:element name="items" type="Items"/>
+ </xsd:sequence>
+ <xsd:attribute name="orderDate" type="xsd:date"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="USAddress">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="street" type="xsd:string"/>
+ <xsd:element name="city" type="xsd:string"/>
+ <xsd:element name="state" type="xsd:string"/>
+ <xsd:element name="zip" type="xsd:decimal"/>
+ </xsd:sequence>
+ <xsd:attribute name="country" type="xsd:NMTOKEN"
+ fixed="US"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="Items">
+ <xsd:sequence>
+ <xsd:element name="item" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="productName" type="xsd:string"/>
+ <xsd:element name="quantity">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:positiveInteger">
+ <xsd:maxExclusive value="100"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:element>
+ <xsd:element name="USPrice" type="xsd:decimal"/>
+ <xsd:element ref="comment" minOccurs="0"/>
+ <xsd:element name="shipDate" type="xsd:date" minOccurs="0"/>
+ </xsd:sequence>
+ <xsd:attribute name="partNum" type="SKU" use="required"/>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <!-- Stock Keeping Unit, a code for identifying products -->
+ <simpleType name="SKU">
+ <restriction base="xsd:string">
+ <pattern value="\d{3}-[A-Z]{2}"/>
+ </restriction>
+ </simpleType>
+
+</xsd:schema>
+</types>
+ <portType name="TestServicePortType">
+ </portType>
+
+ <binding name="TestServiceBinding" type="tns:TestServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+ </binding>
+
+ <service name="TestService">
+ <port name="TestServicePort" binding="tns:TestServiceBinding">
+ <soap:address location="test://" />
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug27742.phpt b/ext/soap/tests/bugs/bug27742.phpt
new file mode 100644
index 0000000..5d9636f
--- /dev/null
+++ b/ext/soap/tests/bugs/bug27742.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #27742 (WDSL SOAP Parsing Schema bug)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--GET--
+wsdl
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$x = new SoapClient(dirname(__FILE__)."/bug27742.wsdl");
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug27742.wsdl b/ext/soap/tests/bugs/bug27742.wsdl
new file mode 100644
index 0000000..f38d911
--- /dev/null
+++ b/ext/soap/tests/bugs/bug27742.wsdl
@@ -0,0 +1,854 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by Rakesh Vidyadharan (Enterprise Application Development Tribune Media Services) -->
+<wsdl:definitions name="xtvdWebService" targetNamespace="urn:TMSWebServices" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tms="urn:TMSWebServices" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <xsd:schema targetNamespace="urn:TMSWebServices" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tms="urn:TMSWebServices" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <simpleType name="duration">
+ <annotation>
+ <documentation xml:lang="en">ISO 8601 pattern used to denote program durations. Year, month and day are not relevent in our context and are omitted.</documentation>
+ </annotation>
+ <restriction base="xsd:duration">
+ <pattern value="PT[0-9][0-9]H[0-5][0-9]M"/>
+ </restriction>
+ </simpleType>
+ <simpleType name="dateTime">
+ <annotation>
+ <documentation xml:lang="en">ISO 8601 pattern for date+time information : YYYY-MM-DDThh:mm:ssZ</documentation>
+ </annotation>
+ <restriction base="xsd:dateTime">
+ <pattern value="20[0-9]{2}\-[0-1][0-9]\-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]Z"/>
+ </restriction>
+ </simpleType>
+ <simpleType name="date">
+ <annotation>
+ <documentation xml:lang="en">ISO 8601 pattern for date: YYYY-MM-DD</documentation>
+ </annotation>
+ <restriction base="xsd:date">
+ <pattern value="(19|20)[0-9]{2}\-[0-1][0-9]\-[0-3][0-9]"/>
+ </restriction>
+ </simpleType>
+ <simpleType name="time">
+ <annotation>
+ <documentation xml:lang="en">ISO 8601 pattern for time of day : hh:mm:ss</documentation>
+ </annotation>
+ <restriction base="xsd:time">
+ <pattern value="\d\d:\d\d:\d\d"/>
+ </restriction>
+ </simpleType>
+ <simpleType name="mpaaRatings">
+ <annotation>
+ <documentation xml:lang="en">MPAA standard ratings for a movie as defined in the movie and TV database schemas.</documentation>
+ </annotation>
+ <restriction base="xsd:string">
+ <enumeration value="Adult">
+ <annotation>
+ <documentation xml:lang="en">This is the way this rating is defined in the movies database schema.</documentation>
+ </annotation>
+ </enumeration>
+ <enumeration value="AO">
+ <annotation>
+ <documentation xml:lang="en">This is the way this rating is defined in the TV database schema.</documentation>
+ </annotation>
+ </enumeration>
+ <enumeration value="G"/>
+ <enumeration value="NC-17"/>
+ <enumeration value="NONE">
+ <annotation>
+ <documentation xml:lang="en">Films in the movie database that do not have any ratings associated with them are sometimes marked with this value.</documentation>
+ </annotation>
+ </enumeration>
+ <enumeration value="NOT RATED">
+ <annotation>
+ <documentation xml:lang="en">This is the way films without any rating are defined in the movies database schema.</documentation>
+ </annotation>
+ </enumeration>
+ <enumeration value="NR">
+ <annotation>
+ <documentation xml:lang="en">This is the way films without any rating are defined in the TV database schema.</documentation>
+ </annotation>
+ </enumeration>
+ <enumeration value="PG"/>
+ <enumeration value="PG-13"/>
+ <enumeration value="R"/>
+ </restriction>
+ </simpleType>
+ <simpleType name="starRating">
+ <annotation>
+ <documentation xml:lang="en">A Zap2it reviewer assigned rating for a given film.</documentation>
+ </annotation>
+ <restriction base="xsd:string">
+ <enumeration value="*"/>
+ <enumeration value="*+"/>
+ <enumeration value="**"/>
+ <enumeration value="**+"/>
+ <enumeration value="***"/>
+ <enumeration value="***+"/>
+ <enumeration value="****"/>
+ </restriction>
+ </simpleType>
+ <simpleType name="movieCrewRole">
+ <annotation>
+ <documentation xml:lang="en">The roles that are currently defined for the production crew associated with a given film.</documentation>
+ </annotation>
+ <restriction base="xsd:string">
+ <enumeration value="Actor"/>
+ <enumeration value="Director"/>
+ <enumeration value="Executive Producer"/>
+ <enumeration value="Guest Star"/>
+ <enumeration value="Producer"/>
+ <enumeration value="Writer"/>
+ </restriction>
+ </simpleType>
+ <simpleType name="movieGenres">
+ <annotation>
+ <documentation xml:lang="en">The standard genres that are used to classify films in the movies database schema.</documentation>
+ </annotation>
+ <restriction base="xsd:string">
+ <enumeration value=""/>
+ <enumeration value="Action"/>
+ <enumeration value="Adults only"/>
+ <enumeration value="Adventure"/>
+ <enumeration value="Animated musical"/>
+ <enumeration value="Biography"/>
+ <enumeration value="Children"/>
+ <enumeration value="Comedy"/>
+ <enumeration value="Comedy-drama"/>
+ <enumeration value="Crime drama"/>
+ <enumeration value="Docudrama"/>
+ <enumeration value="Documentary"/>
+ <enumeration value="Drama"/>
+ <enumeration value="Fantasy"/>
+ <enumeration value="French"/>
+ <enumeration value="Historical drama"/>
+ <enumeration value="Horror"/>
+ <enumeration value="Martial arts"/>
+ <enumeration value="Musical"/>
+ <enumeration value="Musical comedy"/>
+ <enumeration value="Musical romance"/>
+ <enumeration value="Mystery"/>
+ <enumeration value="Romance"/>
+ <enumeration value="Romance-comedy"/>
+ <enumeration value="Science fiction"/>
+ <enumeration value="Spanish"/>
+ <enumeration value="Suspense"/>
+ <enumeration value="Suspense-comedy"/>
+ <enumeration value="War"/>
+ <enumeration value="Western"/>
+ </restriction>
+ </simpleType>
+ <simpleType name="movieAdvisories">
+ <annotation>
+ <documentation xml:lang="en">The standard advisory messages that are associated with a movie shown on TV.</documentation>
+ </annotation>
+ <restriction base="xsd:string">
+ <enumeration value="Adult Situations"/>
+ <enumeration value="Adolescentes y Adultos"/>
+ <enumeration value="Adultos"/>
+ <enumeration value="Brief Nudity"/>
+ <enumeration value="Graphic Language"/>
+ <enumeration value="Graphic Violence"/>
+ <enumeration value="Language"/>
+ <enumeration value="Mild Violence"/>
+ <enumeration value="Nudity"/>
+ <enumeration value="Publico General"/>
+ <enumeration value="Rape"/>
+ <enumeration value="Strong Sexual Content"/>
+ <enumeration value="Violence"/>
+ </restriction>
+ </simpleType>
+ <simpleType name="tvRatings">
+ <annotation>
+ <documentation xml:lang="en">The FCC standard ratings for TV programs (http://www.fcc.gov/vchip/#guidelines)</documentation>
+ </annotation>
+ <restriction base="xsd:string">
+ <enumeration value="TVY"/>
+ <enumeration value="TVY7"/>
+ <enumeration value="TVG"/>
+ <enumeration value="TVPG"/>
+ <enumeration value="TV14"/>
+ <enumeration value="TVMA"/>
+ </restriction>
+ </simpleType>
+ <simpleType name="tvColorCode">
+ <annotation>
+ <documentation>The standard color codes used to denote the color scheme used by a TV program (eg. Color, B &amp; W ...).</documentation>
+ </annotation>
+ <restriction base="xsd:string">
+ <enumeration value="B &amp; W">
+ <annotation>
+ <documentation xml:lang="en">Indicates that the program is begin telecast in Black and White.</documentation>
+ </annotation>
+ </enumeration>
+ <enumeration value="Color">
+ <annotation>
+ <documentation xml:lang="en">Indicates that the program being telecast is in color.</documentation>
+ </annotation>
+ </enumeration>
+ <enumeration value="Colorized">
+ <annotation>
+ <documentation xml:lang="en">Indicates that the program being telecast is a colorised version of the original program.</documentation>
+ </annotation>
+ </enumeration>
+ <enumeration value="Color and B &amp; W">
+ <annotation>
+ <documentation xml:lang="en">Indicates that the program being telecast is partly in color and partly in Black and White.</documentation>
+ </annotation>
+ </enumeration>
+ </restriction>
+ </simpleType>
+ <attributeGroup name="filmDataAttributes">
+ <annotation>
+ <documentation xml:lang="en">Common attributes that are applicable to all the root elements of the XML schemas developed to represent film data.</documentation>
+ </annotation>
+ <attribute name="postalCode" type="xsd:string" use="optional">
+ <annotation>
+ <documentation xml:lang="en">The ZIP/Postal code for which the theatre list was generated.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="radius" type="xsd:float" use="optional" default="5">
+ <annotation>
+ <documentation xml:lang="en">The radius around the centroid of the ZIP/Postal code within which the films are located. A default value of 20 (miles for US customers and kilometres for non-US customers) will be used if the client making the request did not specify a radius.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="maxCount" type="xsd:int" use="optional">
+ <annotation>
+ <documentation xml:lang="en">The maximum number of film/theatre records that are included in the document. This number may be specified by the client making the request for the list of films/theatres/showtimes.</documentation>
+ </annotation>
+ </attribute>
+ </attributeGroup>
+ <complexType name="crewMember">
+ <annotation>
+ <documentation xml:lang="en">A cast or production crew member for a film or TV show.</documentation>
+ </annotation>
+ <sequence>
+ <element name="role" type="xsd:string">
+ <annotation>
+ <documentation xml:lang="en">Describes the role of the crew member. Eg. Actor, Director ...</documentation>
+ </annotation>
+ </element>
+ <element name="givenname" type="xsd:string" nillable="true">
+ <annotation>
+ <documentation xml:lang="en">The given/first name of the crew member. The element name follows LDAP naming convention. TMS does not have given/first names for all cast/crew members. Hence this element is nillable.</documentation>
+ </annotation>
+ </element>
+ <element name="surname" type="xsd:string">
+ <annotation>
+ <documentation xml:lang="en">The surname/last-name of the crew member. The element name follows LDAP naming convention.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ <complexType name="image">
+ <annotation>
+ <documentation>Complex type that contains the attributes of an image. The only attribute available at present is its URI.</documentation>
+ </annotation>
+ <sequence>
+ <element name="imageUri" type="xsd:anyURI" nillable="true">
+ <annotation>
+ <documentation>This element contains an absolute URI to an image associated with the film.</documentation>
+ </annotation>
+ </element>
+ <element name="width" type="xsd:string" minOccurs="0">
+ <annotation>
+ <documentation>This element defines the width of the image associated with the film. This element is a place holder. The width attribute is not available at present.</documentation>
+ </annotation>
+ </element>
+ <element name="height" type="xsd:string" minOccurs="0">
+ <annotation>
+ <documentation>This element defines the height of the image associated with the film. This element is a place holder. The height attribute is not available at present.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ <complexType name="address">
+ <annotation>
+ <documentation xml:lang="en">This complex type describes a generic address.</documentation>
+ </annotation>
+ <sequence>
+ <element name="streetAddress">
+ <annotation>
+ <documentation xml:lang="en">This element groups together the various street address parts for the entire address.</documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element name="street" type="xsd:string" maxOccurs="unbounded">
+ <annotation>
+ <documentation xml:lang="en">This field contains each entry for the street address part of the entire address.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="city" type="xsd:string">
+ <annotation>
+ <documentation xml:lang="en">This field contains the city for the address.</documentation>
+ </annotation>
+ </element>
+ <element name="state" type="xsd:string">
+ <annotation>
+ <documentation xml:lang="en">This field contains the name/code of the state for the address.</documentation>
+ </annotation>
+ </element>
+ <element name="postalCode" type="xsd:string">
+ <annotation>
+ <documentation xml:lang="en">This field contains the ZIP/Postal code for the address.</documentation>
+ </annotation>
+ </element>
+ <element name="telephone" type="xsd:string" minOccurs="0">
+ <annotation>
+ <documentation xml:lang="en">This field contains the telephone number if available for the address.</documentation>
+ </annotation>
+ </element>
+ <element name="fax" type="xsd:string" minOccurs="0">
+ <annotation>
+ <documentation xml:lang="en">This field contains the fax number if available for the address.</documentation>
+ </annotation>
+ </element>
+ <element name="mobile" type="xsd:string" minOccurs="0">
+ <annotation>
+ <documentation xml:lang="en">This field contains the mobile phone number if available for the address.</documentation>
+ </annotation>
+ </element>
+ <element name="email" type="xsd:string" minOccurs="0">
+ <annotation>
+ <documentation xml:lang="en">This field contains the email address if available for the address.</documentation>
+ </annotation>
+ </element>
+ <element name="country" type="xsd:string" minOccurs="0">
+ <annotation>
+ <documentation xml:lang="en">This field contains the country of the address.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ <element name="xtvd">
+ <annotation>
+ <documentation>Root element of the document. @IMPORTANT : All time and dates are specified in UTC !</documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="tms:stations"/>
+ <element ref="tms:lineups"/>
+ <element ref="tms:schedules"/>
+ <element ref="tms:programs"/>
+ <element ref="tms:productionCrew" minOccurs="0"/>
+ <element ref="tms:genres"/>
+ </sequence>
+ <attribute name="from" type="tms:dateTime" use="required">
+ <annotation>
+ <documentation xml:lang="en">Date and time defining the start of the period covered by this XTVD document.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="to" type="tms:dateTime" use="required">
+ <annotation>
+ <documentation xml:lang="en">Date and time defining the end of the period covered by this XTVD document.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="schemaVersion" type="xsd:float" use="required" fixed="1.2">
+ <annotation>
+ <documentation xml:lang="en">Version number of the schema used to build this document.</documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ <key name="station_key">
+ <selector xpath="./stations/station"/>
+ <field xpath="@id"/>
+ </key>
+ <keyref name="station_keyref_schedule" refer="tms:station_key">
+ <selector xpath="./schedules/schedule"/>
+ <field xpath="@station"/>
+ </keyref>
+ <keyref name="station_keyref_map" refer="tms:station_key">
+ <selector xpath="./lineups/lineup/map"/>
+ <field xpath="@station"/>
+ </keyref>
+ <unique name="program_key">
+ <selector xpath="./programs/program"/>
+ <field xpath="@id"/>
+ </unique>
+ <keyref name="program_keyref" refer="tms:program_key">
+ <selector xpath="./schedules/schedule"/>
+ <field xpath="@program"/>
+ </keyref>
+ <keyref name="crew_keyref" refer="tms:program_key">
+ <selector xpath="./productionCrew/crew"/>
+ <field xpath="@program"/>
+ </keyref>
+ <keyref name="genre_keyref" refer="tms:program_key">
+ <selector xpath="./genres/programGenre"/>
+ <field xpath="@program"/>
+ </keyref>
+ <keyref name="advisory_keyref" refer="tms:program_key">
+ <selector xpath="./advisories/advisory"/>
+ <field xpath="@program"/>
+ </keyref>
+ </element>
+ <element name="stations">
+ <annotation>
+ <documentation>Collection of user selected station elements (across all lineups).</documentation>
+ </annotation>
+ <complexType>
+ <sequence maxOccurs="unbounded">
+ <element name="station">
+ <annotation>
+ <documentation>Defines a TV broadcast station - each station is identified with an unique ID.</documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element name="callSign">
+ <annotation>
+ <documentation>Short name of the station (eg. CNN).</documentation>
+ </annotation>
+ </element>
+ <element name="name" minOccurs="0">
+ <annotation>
+ <documentation>Long name of the station (eg. Cable News Network).</documentation>
+ </annotation>
+ </element>
+ <element name="fccChannelNumber" type="xsd:positiveInteger" minOccurs="0">
+ <annotation>
+ <documentation xml:lang="en">FCC channel number of a broadcast station.</documentation>
+ </annotation>
+ </element>
+ <element name="affiliate" type="xsd:string" minOccurs="0">
+ <annotation>
+ <documentation xml:lang="en">Network, cable or broadcasting group with which the station is associated.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="id" type="xsd:int" use="required">
+ <annotation>
+ <documentation xml:lang="en">ID string of the station.</documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="lineups">
+ <annotation>
+ <documentation>Collection of lineup elements selected by the user.</documentation>
+ </annotation>
+ <complexType>
+ <sequence maxOccurs="unbounded">
+ <element name="lineup">
+ <annotation>
+ <documentation>Defines all the station that were selected for the given lineup. </documentation>
+ </annotation>
+ <complexType>
+ <sequence maxOccurs="unbounded">
+ <element name="map">
+ <annotation>
+ <documentation>This element defines the mapping between one station and one channel number. As channel numbers may change over time, attributes to define a validity period for the mapping are available.</documentation>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element name="onAir">
+ <annotation>
+ <documentation xml:lang="en">Specifies the time(s) of day when the given station-channel mapping is in effect.</documentation>
+ </annotation>
+ <complexType>
+ <attribute name="from" type="tms:time" use="required">
+ <annotation>
+ <documentation xml:lang="en">The time of day from which the station-channel mapping is effective.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="to" type="tms:time" use="required">
+ <annotation>
+ <documentation xml:lang="en">The time of day until which the station-channel mapping is effective.</documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="station" type="xsd:int" use="required">
+ <annotation>
+ <documentation xml:lang="en">Reference to a station.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="channel" type="xsd:positiveInteger" use="required">
+ <annotation>
+ <documentation xml:lang="en">Channel number associated to the station.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="channelMinor" type="xsd:positiveInteger" use="optional">
+ <annotation>
+ <documentation xml:lang="en">The major channel (the channel attribute) number is used to group all services associated with a broadcaster's NTSC brand, for example Channel 4. The minor channel number specifies a particular channel within that group. Zero (0) is reserved for the NTSC channel; all other values (1-999) are allowed for digital services. One common approach is to start with 1 and to continue numerically for different programming services.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="from" type="tms:date" use="optional">
+ <annotation>
+ <documentation xml:lang="en">Date from which the mapping is valid, according to the validity period of the whole XTVD document. @IMPORTANT : It is assumed that the change will occur at midnight.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="to" type="tms:date" use="optional">
+ <annotation>
+ <documentation xml:lang="en">Date untill which the mapping is valid, within the validity period of the whole XTVD document. @IMPORTANT : The change will occur at midnight.</documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="name" type="xsd:string" use="required">
+ <annotation>
+ <documentation xml:lang="en">Name given to the lineup.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="type" type="tms:lineupTypes" use="required">
+ <annotation>
+ <documentation xml:lang="en">Defines the type of the lineup (CABLE, SATELLITE, ...).</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="device" type="xsd:string" use="optional">
+ <annotation>
+ <documentation xml:lang="en">The name of the device associated with the headend.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="postalCode" type="xsd:string" use="optional">
+ <annotation>
+ <documentation xml:lang="en">The ZIP/Postal code for which the specified lineup was selected by the user.</documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="schedules">
+ <annotation>
+ <documentation>Contain all schedule records (across all selected lineups).</documentation>
+ </annotation>
+ <complexType>
+ <sequence maxOccurs="unbounded">
+ <annotation>
+ <documentation>Sequence of schedule records.</documentation>
+ </annotation>
+ <element name="schedule">
+ <annotation>
+ <documentation>Describes a schedule entry.</documentation>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="0">
+ <element name="part" minOccurs="0">
+ <annotation>
+ <documentation>Designates which part, when a program is split into 2 or more viewings.</documentation>
+ </annotation>
+ <complexType>
+ <attribute name="number" use="required">
+ <annotation>
+ <documentation xml:lang="en">Designates which part, when a program is split into 2 or more viewings. </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="xsd:unsignedInt">
+ <minInclusive value="1"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="total" use="required">
+ <annotation>
+ <documentation xml:lang="en">Designates when a program is split into 2 or more parts for viewing. </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="xsd:unsignedInt">
+ <minInclusive value="2"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="program" type="xsd:string" use="required">
+ <annotation>
+ <documentation xml:lang="en">Reference to a program ID.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="station" type="xsd:int" use="required">
+ <annotation>
+ <documentation xml:lang="en">Reference to a station ID.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="time" type="tms:dateTime" use="required">
+ <annotation>
+ <documentation xml:lang="en">Air date and time for the schedule.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="duration" type="tms:duration" use="required">
+ <annotation>
+ <documentation xml:lang="en">Duration of the schedule.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="repeat" type="xsd:boolean" use="optional">
+ <annotation>
+ <documentation xml:lang="en">Designates a program which has been aired previously.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="tvRating" type="tms:tvRatings" use="optional">
+ <annotation>
+ <documentation xml:lang="en">The FCC standard ratings applied to TV shows.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="stereo" type="xsd:boolean" use="optional">
+ <annotation>
+ <documentation xml:lang="en">Indicates whether the program has stereo sound or not.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="subtitled" type="xsd:boolean" use="optional">
+ <annotation>
+ <documentation xml:lang="en">Indicates whether the program has subtitles.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="hdtv" type="xsd:boolean" use="optional">
+ <annotation>
+ <documentation xml:lang="en">Indicates whether the program broadcast is HDTV compatible.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="closeCaptioned" type="xsd:boolean" use="optional">
+ <annotation>
+ <documentation xml:lang="en">Indicates whether the program has closed captions.</documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="programs">
+ <annotation>
+ <documentation>Contains all the program records that are referenced by the schedule records.</documentation>
+ </annotation>
+ <complexType>
+ <sequence maxOccurs="unbounded">
+ <element name="program" minOccurs="0">
+ <annotation>
+ <documentation>Defines a program entry.</documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element name="title" type="xsd:string">
+ <annotation>
+ <documentation>Title of the program.</documentation>
+ </annotation>
+ </element>
+ <element name="subtitle" type="xsd:string" minOccurs="0">
+ <annotation>
+ <documentation>Subtitle of the program (episode title, game title, ...)</documentation>
+ </annotation>
+ </element>
+ <element name="description" type="xsd:string" minOccurs="0">
+ <annotation>
+ <documentation>Word string that describes the program.</documentation>
+ </annotation>
+ </element>
+ <element name="mpaaRating" type="tms:mpaaRatings" minOccurs="0">
+ <annotation>
+ <documentation>MPAA rating of the program (applies to movies only).</documentation>
+ </annotation>
+ </element>
+ <element name="starRating" type="tms:starRating" minOccurs="0">
+ <annotation>
+ <documentation>Star rating of the program (applies to movies only).</documentation>
+ </annotation>
+ </element>
+ <element name="runTime" type="tms:duration" minOccurs="0">
+ <annotation>
+ <documentation>Actual length of the program. Not the same as schedule/@duration. Applies to movies only.</documentation>
+ </annotation>
+ </element>
+ <element name="year" type="xsd:gYear" minOccurs="0">
+ <annotation>
+ <documentation>The year in which a feature film was released; YYYY format. Applies to movies only.</documentation>
+ </annotation>
+ </element>
+ <element name="showType" type="xsd:string" minOccurs="0">
+ <annotation>
+ <documentation xml:lang="en">Distinguishes how a program was originally produced and/or distributed.</documentation>
+ </annotation>
+ </element>
+ <element name="series" type="xsd:string" minOccurs="0">
+ <annotation>
+ <documentation xml:lang="en">The series ID associated with episodic programs. For instance an episode with programId "EP5544720193" has a series ID "SH5544720000". The series ID may be used to group together all episodes for a given series.</documentation>
+ </annotation>
+ </element>
+ <element name="colorCode" type="tms:tvColorCode" minOccurs="0">
+ <annotation>
+ <documentation xml:lang="en">Indicates whether the program is in black and white, colorized or color. Since most programs are in "Color" this element will be populated only if a program is not in "Color".</documentation>
+ </annotation>
+ </element>
+ <element name="advisories" minOccurs="0">
+ <annotation>
+ <documentation xml:lang="en">This element groups together all the advisories associated with the program. Advisories apply only to movies.</documentation>
+ </annotation>
+ <complexType>
+ <sequence maxOccurs="6">
+ <element name="advisory" type="tms:movieAdvisories">
+ <annotation>
+ <documentation xml:lang="en">An individual advisory message associated with the movie.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="id" type="xsd:string" use="required">
+ <annotation>
+ <documentation xml:lang="en">Unique ID of the program.</documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="productionCrew">
+ <annotation>
+ <documentation>Contains information about the personnel associated with each program record.</documentation>
+ </annotation>
+ <complexType>
+ <sequence maxOccurs="unbounded">
+ <element name="crew">
+ <annotation>
+ <documentation xml:lang="en">This element groups together all the crew members associated with the given program.</documentation>
+ </annotation>
+ <complexType>
+ <sequence maxOccurs="unbounded">
+ <element name="member" type="tms:crewMember">
+ <annotation>
+ <documentation xml:lang="en">This element describes an individual production crew member associated with a program.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="program" type="xsd:string" use="required"/>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="genres">
+ <annotation>
+ <documentation xml:lang="en">Containes genre information where available for the program records. A program may have more than one genre with different relevence factors.</documentation>
+ </annotation>
+ <complexType>
+ <sequence maxOccurs="unbounded">
+ <element name="programGenre">
+ <annotation>
+ <documentation xml:lang="en">This element groups together all the genres under which the specified program falls.</documentation>
+ </annotation>
+ <complexType>
+ <sequence maxOccurs="unbounded">
+ <element name="genre">
+ <annotation>
+ <documentation xml:lang="en">This element groups together the different elements associated with each genre with which the program is associated.</documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element name="class" type="xsd:string">
+ <annotation>
+ <documentation xml:lang="en">The genre that is associated with a specified program record.</documentation>
+ </annotation>
+ </element>
+ <element name="relevance" type="xsd:int">
+ <annotation>
+ <documentation xml:lang="en">A relevence factor that applies to the genre classification for the program. A relevence factor of 1 indicates that this is the top-level genre under which the program is classified.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="program" type="xsd:string" use="required"/>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ <simpleType name="lineupTypes">
+ <annotation>
+ <documentation xml:lang="en">Standard lineup types.</documentation>
+ </annotation>
+ <restriction base="xsd:string">
+ <enumeration value="Cable"/>
+ <enumeration value="CableDigital"/>
+ <enumeration value="Satellite"/>
+ <enumeration value="LocalBroadcast"/>
+ </restriction>
+ </simpleType>
+ <xsd:complexType name="xtvdResponse">
+ <xsd:sequence>
+ <xsd:element name="messages">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">A collection of messages that may be sent back by the server to the client. Messages are usually used by the server to notify the user of changes to their subscription caused by automatic changes in station's that are part of their subscription. For instance, messages are passed back if a lineup selected by the user is no-longer valid, if all the stations selected by the user has been removed as they are no longer valid ... </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="message" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">An individual message that is passed back by the server.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="xtvdDocument" type="tms:xtvd"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="downloadResponse">
+ <wsdl:part name="xtvdResponse" type="tms:xtvdResponse"/>
+ </wsdl:message>
+ <wsdl:message name="downloadRequest">
+ <wsdl:part name="startTime" type="tms:dateTime"/>
+ <wsdl:part name="endTime" type="tms:dateTime"/>
+ </wsdl:message>
+ <wsdl:message name="activateRequest">
+ <wsdl:part name="deviceType" type="xsd:string"/>
+ <wsdl:part name="activationKey" type="xsd:string"/>
+ </wsdl:message>
+ <wsdl:message name="webserviceFault"/>
+ <wsdl:message name="activateResponse"/>
+ <wsdl:portType name="xtvdPortType">
+ <wsdl:operation name="activate">
+ <wsdl:input message="tms:activateRequest"/>
+ <wsdl:output message="tms:activateResponse"/>
+ <wsdl:fault message="tms:webserviceFault" name="webserviceFault"/>
+ </wsdl:operation>
+ <wsdl:operation name="download">
+ <wsdl:input message="tms:downloadRequest"/>
+ <wsdl:output message="tms:downloadResponse"/>
+ <wsdl:fault message="tms:webserviceFault" name="webserviceFault"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="xtvdBinding" type="tms:xtvdPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="activate">
+ <soap:operation soapAction="urn:TMSWebServices:xtvdWebService#activate"/>
+ <wsdl:input>
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:TMSWebServices" use="encoded"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
+ </wsdl:output>
+ <wsdl:fault name="webserviceFault">
+ <soap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="tms:webserviceFault" namespace="urn:TMSWebServices" use="encoded"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="download">
+ <soap:operation soapAction="urn:TMSWebServices:xtvdWebService#download"/>
+ <wsdl:input>
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:TMSWebServices" use="encoded"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
+ </wsdl:output>
+ <wsdl:fault name="webserviceFault">
+ <soap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="tms:webserviceFault" namespace="urn:TMSWebServices" use="encoded"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="xtvdWebService">
+ <wsdl:port binding="tms:xtvdBinding" name="xtvdWebServicePort">
+ <soap:address location="http://datadirect.webservices.zap2it.com/tvlistings/xtvdService"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug28751.phpt b/ext/soap/tests/bugs/bug28751.phpt
new file mode 100644
index 0000000..697ebd8
--- /dev/null
+++ b/ext/soap/tests/bugs/bug28751.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Bug #28751 (SoapServer does not call _autoload())
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function __autoload($className) {
+ class SoapServerActions {
+ function test() {
+ return "Hello World";
+ }
+ }
+}
+
+$server = new SoapServer(NULL, array('uri'=>"http://testuri.org"));
+$server->setClass("SoapServerActions");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/bugs/bug28969.phpt b/ext/soap/tests/bugs/bug28969.phpt
new file mode 100644
index 0000000..dd8c3a1
--- /dev/null
+++ b/ext/soap/tests/bugs/bug28969.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Bug #28969 (Wrong data encoding of special characters)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test() {
+ return "¦è¥";
+// return utf8_encode("¦è¥");
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('test');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$x = new LocalSoapClient(NULL,array('location'=>'test://',
+ 'uri'=>'http://testuri.org',
+ 'encoding'=>'ISO-8859-1'));
+var_dump($x->test());
+echo "ok\n";
+?>
+--EXPECT--
+string(3) "¦è¥"
+ok
diff --git a/ext/soap/tests/bugs/bug28985.phpt b/ext/soap/tests/bugs/bug28985.phpt
new file mode 100644
index 0000000..59d96e2
--- /dev/null
+++ b/ext/soap/tests/bugs/bug28985.phpt
@@ -0,0 +1,206 @@
+--TEST--
+Bug #28985 (__getTypes() returning nothing on complex WSDL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SOAPClient(dirname(__FILE__).'/bug28985.wsdl', array('trace'=>1));
+var_dump($client->__getTypes());
+?>
+--EXPECT--
+array(42) {
+ [0]=>
+ string(100) "struct LoginMGDIS {
+ string iUserLogin;
+ string iUserId;
+ string iUserPassword;
+ string iProfilId;
+}"
+ [1]=>
+ string(29) "struct LoginMGDISResponse {
+}"
+ [2]=>
+ string(28) "struct GetIdentification {
+}"
+ [3]=>
+ string(77) "struct GetIdentificationResponse {
+ ArrayOfAnyType GetIdentificationResult;
+}"
+ [4]=>
+ string(43) "struct ArrayOfAnyType {
+ anyType anyType;
+}"
+ [5]=>
+ string(37) "struct RollbackCurrentTransaction {
+}"
+ [6]=>
+ string(45) "struct RollbackCurrentTransactionResponse {
+}"
+ [7]=>
+ string(68) "struct GetListeProfil {
+ string iUserLogin;
+ string iUserPassword;
+}"
+ [8]=>
+ string(86) "struct MGCodeLibelle {
+ string Code;
+ string Libelle;
+ boolean Defaut;
+ anyType Tag;
+}"
+ [9]=>
+ string(61) "struct ArrayOfMGCodeLibelle {
+ MGCodeLibelle MGCodeLibelle;
+}"
+ [10]=>
+ string(77) "struct GetListeProfilResponse {
+ ArrayOfMGCodeLibelle GetListeProfilResult;
+}"
+ [11]=>
+ string(41) "struct GetListeValCodif {
+ string Code;
+}"
+ [12]=>
+ string(43) "struct ArrayOfMGCodif {
+ MGCodif MGCodif;
+}"
+ [13]=>
+ string(18) "struct MGCodif {
+}"
+ [14]=>
+ string(75) "struct GetListeValCodifResponse {
+ ArrayOfMGCodif GetListeValCodifResult;
+}"
+ [15]=>
+ string(39) "struct TestPhpSoap {
+ MGCodif entree;
+}"
+ [16]=>
+ string(57) "struct TestPhpSoapResponse {
+ string TestPhpSoapResult;
+}"
+ [17]=>
+ string(50) "struct GetListeCodif {
+ boolean iGetListeValeur;
+}"
+ [18]=>
+ string(87) "struct MGCodifGrp {
+ string TypeCodif;
+ string LibCodif;
+ ArrayOfMGCodif ListeCodifs;
+}"
+ [19]=>
+ string(52) "struct ArrayOfMGCodifGrp {
+ MGCodifGrp MGCodifGrp;
+}"
+ [20]=>
+ string(72) "struct GetListeCodifResponse {
+ ArrayOfMGCodifGrp GetListeCodifResult;
+}"
+ [21]=>
+ string(57) "struct DroitCreation {
+ string iObjet;
+ string iProfil;
+}"
+ [22]=>
+ string(62) "struct DroitCreationResponse {
+ boolean DroitCreationResult;
+}"
+ [23]=>
+ string(74) "struct ListeDroitCreation {
+ ArrayOfString iListeObjet;
+ string iProfil;
+}"
+ [24]=>
+ string(40) "struct ArrayOfString {
+ string string;
+}"
+ [25]=>
+ string(79) "struct ListeDroitCreationResponse {
+ ArrayOfAnyType ListeDroitCreationResult;
+}"
+ [26]=>
+ string(87) "struct GetDroitsObjetProtege {
+ string iObjet;
+ string iProfil;
+ string iUtilisateur;
+}"
+ [27]=>
+ string(154) "struct MGDroitsObjetProtege {
+ string LbUti;
+ string LbProf;
+ string LbServ;
+ string LbDir;
+ boolean isProtected;
+ ArrayOfMGDroitAcces ListeDroitsAcces;
+}"
+ [28]=>
+ string(58) "struct ArrayOfMGDroitAcces {
+ MGDroitAcces MGDroitAcces;
+}"
+ [29]=>
+ string(104) "struct MGDroitAcces {
+ string IdProfil;
+ boolean Lecture;
+ boolean Modification;
+ boolean Suppression;
+}"
+ [30]=>
+ string(91) "struct GetDroitsObjetProtegeResponse {
+ MGDroitsObjetProtege GetDroitsObjetProtegeResult;
+}"
+ [31]=>
+ string(76) "struct GetPrivileges {
+ string iIdSupport;
+ int iIdForme;
+ string iProfil;
+}"
+ [32]=>
+ string(68) "struct GetPrivilegesResponse {
+ ArrayOfString GetPrivilegesResult;
+}"
+ [33]=>
+ string(46) "struct GetLibelleProfil {
+ string iIdProfil;
+}"
+ [34]=>
+ string(67) "struct GetLibelleProfilResponse {
+ string GetLibelleProfilResult;
+}"
+ [35]=>
+ string(91) "struct GetValeurRecherche {
+ string iChampSource;
+ string iTable;
+ string iOrderByClause;
+}"
+ [36]=>
+ string(78) "struct GetValeurRechercheResponse {
+ ArrayOfString GetValeurRechercheResult;
+}"
+ [37]=>
+ string(128) "struct GetValeurRechercheWithClauseWhere {
+ string iChampSource;
+ string iTable;
+ string iClauseWhere;
+ string iOrderByClause;
+}"
+ [38]=>
+ string(108) "struct GetValeurRechercheWithClauseWhereResponse {
+ ArrayOfString GetValeurRechercheWithClauseWhereResult;
+}"
+ [39]=>
+ string(27) "struct GetEnvironnement {
+}"
+ [40]=>
+ string(106) "struct MGEnvironnement {
+ string RepBureautique;
+ string RepBureautiqueImage;
+ string RepBureautiqueDoc;
+}"
+ [41]=>
+ string(76) "struct GetEnvironnementResponse {
+ MGEnvironnement GetEnvironnementResult;
+}"
+} \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug28985.wsdl b/ext/soap/tests/bugs/bug28985.wsdl
new file mode 100644
index 0000000..ee52881
--- /dev/null
+++ b/ext/soap/tests/bugs/bug28985.wsdl
@@ -0,0 +1,683 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+xmlns:s="http://www.w3.org/2001/XMLSchema"
+xmlns:s0="http://tempuri.org/"
+xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
+xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+targetNamespace="http://tempuri.org/"
+xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified"
+targetNamespace="http://tempuri.org/">
+ <s:element name="LoginMGDIS">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="iUserLogin"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="iUserId"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="iUserPassword"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="iProfilId"
+type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="LoginMGDISResponse">
+ <s:complexType />
+ </s:element>
+ <s:element name="GetIdentification">
+ <s:complexType />
+ </s:element>
+ <s:element name="GetIdentificationResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="GetIdentificationResult" type="s0:ArrayOfAnyType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="ArrayOfAnyType">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="anyType"
+nillable="true" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="RollbackCurrentTransaction">
+ <s:complexType />
+ </s:element>
+ <s:element name="RollbackCurrentTransactionResponse">
+ <s:complexType />
+ </s:element>
+ <s:element name="GetListeProfil">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="iUserLogin"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="iUserPassword"
+type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="MGCodeLibelle">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="Code"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="Libelle"
+type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="Defaut"
+type="s:boolean" />
+ <s:element minOccurs="0" maxOccurs="1" name="Tag" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="ArrayOfMGCodeLibelle">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded"
+name="MGCodeLibelle" nillable="true" type="s0:MGCodeLibelle" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="GetListeProfilResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="GetListeProfilResult" type="s0:ArrayOfMGCodeLibelle" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetListeValCodif">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="Code"
+type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="ArrayOfMGCodif">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="MGCodif"
+nillable="true" type="s0:MGCodif" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="MGCodif">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:MGCodeLibelle" />
+ </s:complexContent>
+ </s:complexType>
+ <s:element name="GetListeValCodifResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="GetListeValCodifResult" type="s0:ArrayOfMGCodif" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="TestPhpSoap">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="entree"
+type="s0:MGCodif" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="TestPhpSoapResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="TestPhpSoapResult" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetListeCodif">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1"
+name="iGetListeValeur" type="s:boolean" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="MGCodifGrp">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="TypeCodif"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="LibCodif"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="ListeCodifs"
+type="s0:ArrayOfMGCodif" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="ArrayOfMGCodifGrp">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded"
+name="MGCodifGrp" nillable="true" type="s0:MGCodifGrp" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="GetListeCodifResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="GetListeCodifResult" type="s0:ArrayOfMGCodifGrp" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="DroitCreation">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="iObjet"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="iProfil"
+type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="DroitCreationResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1"
+name="DroitCreationResult" type="s:boolean" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="ListeDroitCreation">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="iListeObjet"
+type="s0:ArrayOfString" />
+ <s:element minOccurs="0" maxOccurs="1" name="iProfil"
+type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="ArrayOfString">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="string"
+nillable="true" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="ListeDroitCreationResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="ListeDroitCreationResult" type="s0:ArrayOfAnyType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetDroitsObjetProtege">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="iObjet"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="iProfil"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="iUtilisateur"
+type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="MGDroitsObjetProtege">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="LbUti"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="LbProf"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="LbServ"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="LbDir"
+type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="isProtected"
+type="s:boolean" />
+ <s:element minOccurs="0" maxOccurs="1" name="ListeDroitsAcces"
+type="s0:ArrayOfMGDroitAcces" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="ArrayOfMGDroitAcces">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded"
+name="MGDroitAcces" nillable="true" type="s0:MGDroitAcces" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="MGDroitAcces">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="IdProfil"
+type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="Lecture"
+type="s:boolean" />
+ <s:element minOccurs="1" maxOccurs="1" name="Modification"
+type="s:boolean" />
+ <s:element minOccurs="1" maxOccurs="1" name="Suppression"
+type="s:boolean" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="GetDroitsObjetProtegeResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="GetDroitsObjetProtegeResult" type="s0:MGDroitsObjetProtege" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetPrivileges">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="iIdSupport"
+type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="iIdForme"
+type="s:int" />
+ <s:element minOccurs="0" maxOccurs="1" name="iProfil"
+type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetPrivilegesResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="GetPrivilegesResult" type="s0:ArrayOfString" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetLibelleProfil">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="iIdProfil"
+type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetLibelleProfilResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="GetLibelleProfilResult" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetValeurRecherche">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="iChampSource"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="iTable"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="iOrderByClause"
+type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetValeurRechercheResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="GetValeurRechercheResult" type="s0:ArrayOfString" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetValeurRechercheWithClauseWhere">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="iChampSource"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="iTable"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="iClauseWhere"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="iOrderByClause"
+type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetValeurRechercheWithClauseWhereResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="GetValeurRechercheWithClauseWhereResult" type="s0:ArrayOfString"
+/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetEnvironnement">
+ <s:complexType />
+ </s:element>
+ <s:complexType name="MGEnvironnement">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="RepBureautique"
+type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1"
+name="RepBureautiqueImage" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1"
+name="RepBureautiqueDoc" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="GetEnvironnementResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="GetEnvironnementResult" type="s0:MGEnvironnement" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:schema>
+ </types>
+ <message name="LoginMGDISSoapIn">
+ <part name="parameters" element="s0:LoginMGDIS" />
+ </message>
+ <message name="LoginMGDISSoapOut">
+ <part name="parameters" element="s0:LoginMGDISResponse" />
+ </message>
+ <message name="GetIdentificationSoapIn">
+ <part name="parameters" element="s0:GetIdentification" />
+ </message>
+ <message name="GetIdentificationSoapOut">
+ <part name="parameters" element="s0:GetIdentificationResponse" />
+ </message>
+ <message name="RollbackCurrentTransactionSoapIn">
+ <part name="parameters" element="s0:RollbackCurrentTransaction" />
+ </message>
+ <message name="RollbackCurrentTransactionSoapOut">
+ <part name="parameters"
+element="s0:RollbackCurrentTransactionResponse" />
+ </message>
+ <message name="GetListeProfilSoapIn">
+ <part name="parameters" element="s0:GetListeProfil" />
+ </message>
+ <message name="GetListeProfilSoapOut">
+ <part name="parameters" element="s0:GetListeProfilResponse" />
+ </message>
+ <message name="GetListeValCodifSoapIn">
+ <part name="parameters" element="s0:GetListeValCodif" />
+ </message>
+ <message name="GetListeValCodifSoapOut">
+ <part name="parameters" element="s0:GetListeValCodifResponse" />
+ </message>
+ <message name="TestPhpSoapSoapIn">
+ <part name="parameters" element="s0:TestPhpSoap" />
+ </message>
+ <message name="TestPhpSoapSoapOut">
+ <part name="parameters" element="s0:TestPhpSoapResponse" />
+ </message>
+ <message name="GetListeCodifSoapIn">
+ <part name="parameters" element="s0:GetListeCodif" />
+ </message>
+ <message name="GetListeCodifSoapOut">
+ <part name="parameters" element="s0:GetListeCodifResponse" />
+ </message>
+ <message name="DroitCreationSoapIn">
+ <part name="parameters" element="s0:DroitCreation" />
+ </message>
+ <message name="DroitCreationSoapOut">
+ <part name="parameters" element="s0:DroitCreationResponse" />
+ </message>
+ <message name="ListeDroitCreationSoapIn">
+ <part name="parameters" element="s0:ListeDroitCreation" />
+ </message>
+ <message name="ListeDroitCreationSoapOut">
+ <part name="parameters" element="s0:ListeDroitCreationResponse" />
+ </message>
+ <message name="GetDroitsObjetProtegeSoapIn">
+ <part name="parameters" element="s0:GetDroitsObjetProtege" />
+ </message>
+ <message name="GetDroitsObjetProtegeSoapOut">
+ <part name="parameters" element="s0:GetDroitsObjetProtegeResponse"
+/>
+ </message>
+ <message name="GetPrivilegesSoapIn">
+ <part name="parameters" element="s0:GetPrivileges" />
+ </message>
+ <message name="GetPrivilegesSoapOut">
+ <part name="parameters" element="s0:GetPrivilegesResponse" />
+ </message>
+ <message name="GetLibelleProfilSoapIn">
+ <part name="parameters" element="s0:GetLibelleProfil" />
+ </message>
+ <message name="GetLibelleProfilSoapOut">
+ <part name="parameters" element="s0:GetLibelleProfilResponse" />
+ </message>
+ <message name="GetValeurRechercheSoapIn">
+ <part name="parameters" element="s0:GetValeurRecherche" />
+ </message>
+ <message name="GetValeurRechercheSoapOut">
+ <part name="parameters" element="s0:GetValeurRechercheResponse" />
+ </message>
+ <message name="GetValeurRechercheWithClauseWhereSoapIn">
+ <part name="parameters"
+element="s0:GetValeurRechercheWithClauseWhere" />
+ </message>
+ <message name="GetValeurRechercheWithClauseWhereSoapOut">
+ <part name="parameters"
+element="s0:GetValeurRechercheWithClauseWhereResponse" />
+ </message>
+ <message name="GetEnvironnementSoapIn">
+ <part name="parameters" element="s0:GetEnvironnement" />
+ </message>
+ <message name="GetEnvironnementSoapOut">
+ <part name="parameters" element="s0:GetEnvironnementResponse" />
+ </message>
+ <portType name="MGServiceNoyauNETSoap">
+ <operation name="LoginMGDIS">
+ <input message="s0:LoginMGDISSoapIn" />
+ <output message="s0:LoginMGDISSoapOut" />
+ </operation>
+ <operation name="GetIdentification">
+ <input message="s0:GetIdentificationSoapIn" />
+ <output message="s0:GetIdentificationSoapOut" />
+ </operation>
+ <operation name="RollbackCurrentTransaction">
+ <input message="s0:RollbackCurrentTransactionSoapIn" />
+ <output message="s0:RollbackCurrentTransactionSoapOut" />
+ </operation>
+ <operation name="GetListeProfil">
+ <input message="s0:GetListeProfilSoapIn" />
+ <output message="s0:GetListeProfilSoapOut" />
+ </operation>
+ <operation name="GetListeValCodif">
+ <input message="s0:GetListeValCodifSoapIn" />
+ <output message="s0:GetListeValCodifSoapOut" />
+ </operation>
+ <operation name="TestPhpSoap">
+ <input message="s0:TestPhpSoapSoapIn" />
+ <output message="s0:TestPhpSoapSoapOut" />
+ </operation>
+ <operation name="GetListeCodif">
+ <input message="s0:GetListeCodifSoapIn" />
+ <output message="s0:GetListeCodifSoapOut" />
+ </operation>
+ <operation name="DroitCreation">
+ <input message="s0:DroitCreationSoapIn" />
+ <output message="s0:DroitCreationSoapOut" />
+ </operation>
+ <operation name="ListeDroitCreation">
+ <input message="s0:ListeDroitCreationSoapIn" />
+ <output message="s0:ListeDroitCreationSoapOut" />
+ </operation>
+ <operation name="GetDroitsObjetProtege">
+ <input message="s0:GetDroitsObjetProtegeSoapIn" />
+ <output message="s0:GetDroitsObjetProtegeSoapOut" />
+ </operation>
+ <operation name="GetPrivileges">
+ <input message="s0:GetPrivilegesSoapIn" />
+ <output message="s0:GetPrivilegesSoapOut" />
+ </operation>
+ <operation name="GetLibelleProfil">
+ <input message="s0:GetLibelleProfilSoapIn" />
+ <output message="s0:GetLibelleProfilSoapOut" />
+ </operation>
+ <operation name="GetValeurRecherche">
+ <input message="s0:GetValeurRechercheSoapIn" />
+ <output message="s0:GetValeurRechercheSoapOut" />
+ </operation>
+ <operation name="GetValeurRechercheWithClauseWhere">
+ <input message="s0:GetValeurRechercheWithClauseWhereSoapIn" />
+ <output message="s0:GetValeurRechercheWithClauseWhereSoapOut" />
+ </operation>
+ <operation name="GetEnvironnement">
+ <input message="s0:GetEnvironnementSoapIn" />
+ <output message="s0:GetEnvironnementSoapOut" />
+ </operation>
+ </portType>
+ <binding name="MGServiceNoyauNETSoap"
+type="s0:MGServiceNoyauNETSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+style="document" />
+ <operation name="LoginMGDIS">
+ <soap:operation soapAction="http://tempuri.org/LoginMGDIS"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="GetIdentification">
+ <soap:operation soapAction="http://tempuri.org/GetIdentification"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="RollbackCurrentTransaction">
+ <soap:operation
+soapAction="http://tempuri.org/RollbackCurrentTransaction"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="GetListeProfil">
+ <soap:operation soapAction="http://tempuri.org/GetListeProfil"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="GetListeValCodif">
+ <soap:operation soapAction="http://tempuri.org/GetListeValCodif"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="TestPhpSoap">
+ <soap:operation soapAction="http://tempuri.org/TestPhpSoap"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="GetListeCodif">
+ <soap:operation soapAction="http://tempuri.org/GetListeCodif"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="DroitCreation">
+ <soap:operation soapAction="http://tempuri.org/DroitCreation"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="ListeDroitCreation">
+ <soap:operation soapAction="http://tempuri.org/ListeDroitCreation"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="GetDroitsObjetProtege">
+ <soap:operation
+soapAction="http://tempuri.org/GetDroitsObjetProtege" style="document"
+/>
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="GetPrivileges">
+ <soap:operation soapAction="http://tempuri.org/GetPrivileges"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="GetLibelleProfil">
+ <soap:operation soapAction="http://tempuri.org/GetLibelleProfil"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="GetValeurRecherche">
+ <soap:operation soapAction="http://tempuri.org/GetValeurRecherche"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="GetValeurRechercheWithClauseWhere">
+ <soap:operation
+soapAction="http://tempuri.org/GetValeurRechercheWithClauseWhere"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="GetEnvironnement">
+ <soap:operation soapAction="http://tempuri.org/GetEnvironnement"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <service name="MGServiceNoyauNET">
+ <port name="MGServiceNoyauNETSoap"
+binding="s0:MGServiceNoyauNETSoap">
+ <soap:address
+location="http://localhost/SoapSrvSOFI/MGServiceNoyauNET.asmx" />
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug29061.phpt b/ext/soap/tests/bugs/bug29061.phpt
new file mode 100644
index 0000000..a85a7aa
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29061.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #29061 (soap extension segfaults)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/bug29061.wsdl", array("exceptions"=>0));
+$client->getQuote("ibm");
+echo "ok\n";
+?>
+--EXPECT--
+ok \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug29061.wsdl b/ext/soap/tests/bugs/bug29061.wsdl
new file mode 100644
index 0000000..fb4d9aa
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29061.wsdl
@@ -0,0 +1,41 @@
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://
+schemas.xmlsoap.org/wsdl/http/"
+xmlns:xs="http://www.w3.org/2001/XMLSchema"
+xmlns:soapenc="http://schemas.xmlsoap.org/soap/e
+ncoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+xmlns:y="http://new.webservice.namespace" targetNamespace="http
+://new.webservice.namespace">
+<types>
+<xs:schema/>
+</types>
+<message name="getQuoteResponse">
+<part name="parameter" element="" type="xs:string"/>
+</message>
+<message name="getQuoteRequest">
+<part name="String" element="" type="xs:string"/>
+</message>
+<portType name="SOAPport">
+<operation name="getQuote">
+<input message="y:getQuoteRequest"/>
+<output message="y:getQuoteResponse"/>
+</operation>
+</portType>
+<binding name="bindingName" type="y:SOAPport">
+<soap:binding style="rpc"
+transport="http://schemas.xmlsoap.org/soap/http"/>
+<operation name="getQuote">
+<input>
+<soap:body use="literal"/>
+</input>
+<output>
+<soap:body use="literal"/>
+</output>
+</operation>
+</binding>
+<service name="myService">
+<port name="myPort" binding="y:bindingName">
+<soap:address location="test://"/>
+</port>
+</service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug29109.phpt b/ext/soap/tests/bugs/bug29109.phpt
new file mode 100644
index 0000000..3b13974
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29109.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #29109 (Uncaught SoapFault exception: [WSDL] Out of memory)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/bug29109.wsdl");
+var_dump($client->__getFunctions());
+?>
+--EXPECT--
+array(1) {
+ [0]=>
+ string(53) "HelloWorldResponse HelloWorld(HelloWorld $parameters)"
+} \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug29109.wsdl b/ext/soap/tests/bugs/bug29109.wsdl
new file mode 100644
index 0000000..800cd23
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29109.wsdl
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="windows-1257"?>
+<definitions xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+xmlns:s0="http://tempuri.org/"
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+xmlns:s="http://www.w3.org/2001/XMLSchema"
+xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
+xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" name="test"
+targetNamespace="http://tempuri.org/"
+xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xs:schema elementFormDefault="qualified"
+targetNamespace="http://tempuri.org/"
+xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="HelloWorld">
+ <xs:complexType />
+ </xs:element>
+ <xs:element name="HelloWorldResponse">
+ <xs:complexType>
+ <xs:sequence>
+
+ <xs:element minOccurs="0" maxOccurs="1"
+name="HelloWorldResult" type="xs:string" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="string" type="xs:string" />
+ </xs:schema>
+ </types>
+ <message name="HelloWorldSoapIn">
+ <part name="parameters" element="s0:HelloWorld" />
+
+ </message>
+ <message name="HelloWorldSoapOut">
+ <part name="parameters" element="s0:HelloWorldResponse" />
+ </message>
+ <message name="HelloWorldHttpGetIn" />
+ <message name="HelloWorldHttpGetOut">
+ <part name="Body" element="s0:string" />
+ </message>
+ <message name="HelloWorldHttpPostIn" />
+
+ <message name="HelloWorldHttpPostOut">
+ <part name="Body" element="s0:string" />
+ </message>
+ <portType name="testSoap">
+ <operation name="HelloWorld">
+ <input message="s0:HelloWorldSoapIn" />
+ <output message="s0:HelloWorldSoapOut" />
+ </operation>
+ </portType>
+
+ <portType name="testHttpGet">
+ <operation name="HelloWorld">
+ <input message="s0:HelloWorldHttpGetIn" />
+ <output message="s0:HelloWorldHttpGetOut" />
+ </operation>
+ </portType>
+ <portType name="testHttpPost">
+ <operation name="HelloWorld">
+ <input message="s0:HelloWorldHttpPostIn" />
+
+ <output message="s0:HelloWorldHttpPostOut" />
+ </operation>
+ </portType>
+ <binding name="testSoap" type="s0:testSoap">
+ <soap:binding style="document"
+transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="HelloWorld">
+ <soap:operation soapAction="http://tempuri.org/HelloWorld"
+style="document" />
+ <input>
+ <soap:body use="literal" />
+
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <binding name="testHttpGet" type="s0:testHttpGet">
+ <http:binding verb="GET" />
+ <operation name="HelloWorld">
+
+ <http:operation location="/HelloWorld" />
+ <input>
+ <http:urlEncoded />
+ </input>
+ <output>
+ <mime:mimeXml part="Body" />
+ </output>
+ </operation>
+ </binding>
+
+ <binding name="testHttpPost" type="s0:testHttpPost">
+ <http:binding verb="POST" />
+ <operation name="HelloWorld">
+ <http:operation location="/HelloWorld" />
+ <input>
+ <mime:content part="" type="application/x-www-form-urlencoded"
+/>
+ </input>
+ <output>
+ <mime:mimeXml part="Body" />
+
+ </output>
+ </operation>
+ </binding>
+ <service name="test">
+ <port name="testSoap" binding="s0:testSoap">
+ <soap:address location="http://localhost:81/test.asmx" />
+ </port>
+ <port name="testHttpGet" binding="s0:testHttpGet">
+ <http:address location="http://localhost:81/test.asmx" />
+
+ </port>
+ <port name="testHttpPost" binding="s0:testHttpPost">
+ <http:address location="http://localhost:81/test.asmx" />
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug29236.phpt b/ext/soap/tests/bugs/bug29236.phpt
new file mode 100644
index 0000000..7b7628d
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29236.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #29236 (memory error when wsdl-cache is enabled)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=1
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/bug29236.wsdl");
+var_dump($client->__getFunctions());
+?>
+--EXPECT--
+array(4) {
+ [0]=>
+ string(59) "StartSessionResponse StartSession(StartSession $parameters)"
+ [1]=>
+ string(62) "VerifySessionResponse VerifySession(VerifySession $parameters)"
+ [2]=>
+ string(41) "LogoutResponse Logout(Logout $parameters)"
+ [3]=>
+ string(62) "GetSystemInfoResponse GetSystemInfo(GetSystemInfo $parameters)"
+}
diff --git a/ext/soap/tests/bugs/bug29236.wsdl b/ext/soap/tests/bugs/bug29236.wsdl
new file mode 100644
index 0000000..d60a487
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29236.wsdl
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://isis.ais.ucla.edu/ws/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://isis.ais.ucla.edu/ws/" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://isis.ais.ucla.edu/ws/">
+ <s:element name="StartSession">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="uclaId" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="userIpAddr" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="StartSessionResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="iwsResponse" nillable="true" type="s0:IwsResponse" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="IwsResponse">
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="sessionInfo" nillable="true" type="s0:IwsSession" />
+ <s:element minOccurs="1" maxOccurs="1" name="errorInfo" nillable="true" type="s0:IwsErrorCollection" />
+ </s:sequence>
+ <s:attribute name="action" type="s0:ActionEnum" />
+ <s:attribute name="hasErrors" type="s:boolean" />
+ <s:attribute name="transactionId" type="s:long" />
+ </s:complexType>
+ <s:complexType name="IwsSession">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="userAttributes" type="s0:ArrayOfIwsUserAttribute" />
+ <s:element minOccurs="0" maxOccurs="1" name="accounts" type="s0:ArrayOfIwsAccount" />
+ <s:element minOccurs="1" maxOccurs="1" name="ticket" nillable="true" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="uclaId" nillable="true" type="s:string" />
+ </s:sequence>
+ <s:attribute name="status" type="s0:SessionStatus" />
+ </s:complexType>
+ <s:complexType name="ArrayOfIwsUserAttribute">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="attribute" type="s0:IwsUserAttribute" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="IwsUserAttribute">
+ <s:attribute name="name" type="s:string" />
+ <s:attribute name="value" type="s:string" />
+ </s:complexType>
+ <s:complexType name="ArrayOfIwsAccount">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="account" type="s0:IwsAccount" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="IwsAccount">
+ <s:attribute name="loginId" type="s:string" />
+ <s:attribute name="type" type="s0:LoginType" />
+ <s:attribute name="status" type="s0:AccountStatus" />
+ </s:complexType>
+ <s:simpleType name="LoginType">
+ <s:restriction base="s:string">
+ <s:enumeration value="BruinOnline" />
+ <s:enumeration value="ACF2" />
+ <s:enumeration value="QDB" />
+ <s:enumeration value="UID" />
+ <s:enumeration value="CommonLogon" />
+ <s:enumeration value="RACF" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="AccountStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Unknown" />
+ <s:enumeration value="Active" />
+ <s:enumeration value="Authenticated" />
+ <s:enumeration value="AuthenticatedWithCachedCredential" />
+ <s:enumeration value="NotAuthenticated" />
+ <s:enumeration value="PermmanentlySuspended" />
+ <s:enumeration value="TemporarilySuspended" />
+ <s:enumeration value="PasswordResetRequired" />
+ <s:enumeration value="InvalidID" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="SessionStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Uninitialized" />
+ <s:enumeration value="Active" />
+ <s:enumeration value="ActiveWithCachedCredential" />
+ <s:enumeration value="ActiveWithMultipleCredentials" />
+ <s:enumeration value="Expired" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="IwsErrorCollection">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="errors" type="s0:ArrayOfIwsError" />
+ </s:sequence>
+ <s:attribute name="count" type="s:int" />
+ </s:complexType>
+ <s:complexType name="ArrayOfIwsError">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="error" type="s0:IwsError" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="IwsError">
+ <s:attribute name="errorCode" type="s:int" />
+ <s:attribute name="detail" type="s:string" />
+ </s:complexType>
+ <s:simpleType name="ActionEnum">
+ <s:restriction base="s:string">
+ <s:enumeration value="GetInfo" />
+ <s:enumeration value="Start" />
+ <s:enumeration value="Verify" />
+ <s:enumeration value="Logout" />
+ </s:restriction>
+ </s:simpleType>
+ <s:element name="wsConsumerCredential" type="s0:WsConsumerCredential" />
+ <s:complexType name="WsConsumerCredential">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="id" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="VerifySession">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="ticket" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="userIpAddr" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="returnExtendedAttributes" type="s:boolean" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="VerifySessionResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="iwsResponse" nillable="true" type="s0:IwsResponse" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="Logout">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="ticket" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="userIpAddr" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="LogoutResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="iwsResponse" nillable="true" type="s0:IwsResponse" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetSystemInfo">
+ <s:complexType />
+ </s:element>
+ <s:element name="GetSystemInfoResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="GetSystemInfoResult" type="s0:ArrayOfIwsAttribute" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="ArrayOfIwsAttribute">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="IwsAttribute" type="s0:IwsAttribute" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="IwsAttribute">
+ <s:attribute name="name" type="s:string" />
+ <s:attribute name="value" type="s:string" />
+ </s:complexType>
+ </s:schema>
+ </types>
+ <message name="StartSessionSoapIn">
+ <part name="parameters" element="s0:StartSession" />
+ </message>
+ <message name="StartSessionSoapOut">
+ <part name="parameters" element="s0:StartSessionResponse" />
+ </message>
+ <message name="StartSessionwsConsumerCredential">
+ <part name="wsConsumerCredential" element="s0:wsConsumerCredential" />
+ </message>
+ <message name="VerifySessionSoapIn">
+ <part name="parameters" element="s0:VerifySession" />
+ </message>
+ <message name="VerifySessionSoapOut">
+ <part name="parameters" element="s0:VerifySessionResponse" />
+ </message>
+ <message name="VerifySessionwsConsumerCredential">
+ <part name="wsConsumerCredential" element="s0:wsConsumerCredential" />
+ </message>
+ <message name="LogoutSoapIn">
+ <part name="parameters" element="s0:Logout" />
+ </message>
+ <message name="LogoutSoapOut">
+ <part name="parameters" element="s0:LogoutResponse" />
+ </message>
+ <message name="LogoutwsConsumerCredential">
+ <part name="wsConsumerCredential" element="s0:wsConsumerCredential" />
+ </message>
+ <message name="GetSystemInfoSoapIn">
+ <part name="parameters" element="s0:GetSystemInfo" />
+ </message>
+ <message name="GetSystemInfoSoapOut">
+ <part name="parameters" element="s0:GetSystemInfoResponse" />
+ </message>
+ <message name="GetSystemInfowsConsumerCredential">
+ <part name="wsConsumerCredential" element="s0:wsConsumerCredential" />
+ </message>
+ <portType name="IsisSoap">
+ <operation name="StartSession">
+ <input message="s0:StartSessionSoapIn" />
+ <output message="s0:StartSessionSoapOut" />
+ </operation>
+ <operation name="VerifySession">
+ <input message="s0:VerifySessionSoapIn" />
+ <output message="s0:VerifySessionSoapOut" />
+ </operation>
+ <operation name="Logout">
+ <input message="s0:LogoutSoapIn" />
+ <output message="s0:LogoutSoapOut" />
+ </operation>
+ <operation name="GetSystemInfo">
+ <input message="s0:GetSystemInfoSoapIn" />
+ <output message="s0:GetSystemInfoSoapOut" />
+ </operation>
+ </portType>
+ <portType name="IsisHttpGet" />
+ <portType name="IsisHttpPost" />
+ <binding name="IsisSoap" type="s0:IsisSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="StartSession">
+ <soap:operation soapAction="http://isis.ais.ucla.edu/ws/StartSession" style="document" />
+ <input>
+ <soap:body use="literal" />
+ <soap:header d5p1:required="true" message="s0:StartSessionwsConsumerCredential" part="wsConsumerCredential" use="literal" xmlns:d5p1="http://schemas.xmlsoap.org/wsdl/" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="VerifySession">
+ <soap:operation soapAction="http://isis.ais.ucla.edu/ws/VerifySession" style="document" />
+ <input>
+ <soap:body use="literal" />
+ <soap:header d5p1:required="true" message="s0:VerifySessionwsConsumerCredential" part="wsConsumerCredential" use="literal" xmlns:d5p1="http://schemas.xmlsoap.org/wsdl/" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="Logout">
+ <soap:operation soapAction="http://isis.ais.ucla.edu/ws/Logout" style="document" />
+ <input>
+ <soap:body use="literal" />
+ <soap:header d5p1:required="true" message="s0:LogoutwsConsumerCredential" part="wsConsumerCredential" use="literal" xmlns:d5p1="http://schemas.xmlsoap.org/wsdl/" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="GetSystemInfo">
+ <soap:operation soapAction="http://isis.ais.ucla.edu/ws/GetSystemInfo" style="document" />
+ <input>
+ <soap:body use="literal" />
+ <soap:header d5p1:required="true" message="s0:GetSystemInfowsConsumerCredential" part="wsConsumerCredential" use="literal" xmlns:d5p1="http://schemas.xmlsoap.org/wsdl/" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <binding name="IsisHttpGet" type="s0:IsisHttpGet">
+ <http:binding verb="GET" />
+ </binding>
+ <binding name="IsisHttpPost" type="s0:IsisHttpPost">
+ <http:binding verb="POST" />
+ </binding>
+ <service name="Isis">
+ <port name="IsisSoap" binding="s0:IsisSoap">
+ <soap:address location="http://isisdev1.tig.ucla.edu/iws/v4.asmx" />
+ </port>
+ <port name="IsisHttpGet" binding="s0:IsisHttpGet">
+ <http:address location="http://isisdev1.tig.ucla.edu/iws/v4.asmx" />
+ </port>
+ <port name="IsisHttpPost" binding="s0:IsisHttpPost">
+ <http:address location="http://isisdev1.tig.ucla.edu/iws/v4.asmx" />
+ </port>
+ </service>
+</definitions> \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug29795.phpt b/ext/soap/tests/bugs/bug29795.phpt
new file mode 100644
index 0000000..388caa6
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29795.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #29795 (SegFault with Soap and Amazon's Web Services)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=1
+--FILE--
+<?php
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><Price><Amount>3995</Amount><CurrencyCode>USD</CurrencyCode></Price></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+ }
+
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)."/bug29795.wsdl",array("trace"=>1));
+$ar=$client->GetPrice();
+echo "o";
+$client = new LocalSoapClient(dirname(__FILE__)."/bug29795.wsdl",array("trace"=>1));
+$ar=$client->GetPrice();
+echo "k\n";
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug29795.wsdl b/ext/soap/tests/bugs/bug29795.wsdl
new file mode 100644
index 0000000..5a4499d
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29795.wsdl
@@ -0,0 +1,40 @@
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://xml.amazon.com/AWSProductData/2004-08-01" targetNamespace="http://xml.amazon.com/AWSProductData/2004-08-01">
+ <types>
+ <xs:schema targetNamespace="http://xml.amazon.com/AWSProductData/2004-08-01" elementFormDefault="qualified">
+ <xs:complexType name="Price">
+ <xs:sequence>
+ <xs:element name="Amount" type="xs:integer" minOccurs="0"/>
+ <xs:element name="CurrencyCode" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name="GetPriceRequest">
+ </message>
+ <message name="GetPriceResponse">
+ <part name="Price" type="tns:Price"/>
+ </message>
+ <portType name="AWSProductDataPortType">
+ <operation name="GetPrice">
+ <input message="tns:GetPriceRequest"/>
+ <output message="tns:GetPriceResponse"/>
+ </operation>
+ </portType>
+ <binding name="AWSProductDataBinding" type="tns:AWSProductDataPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="GetPrice">
+ <soap:operation soapAction="http://soap.amazon.com"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="AWSProductData">
+ <port name="AWSProductDataPort" binding="tns:AWSProductDataBinding">
+ <soap:address location="http://aws-beta.amazon.com/onca/soap?Service=AWSProductData"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug29830.phpt b/ext/soap/tests/bugs/bug29830.phpt
new file mode 100644
index 0000000..dc090f8
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29830.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #29844 (SoapServer::setClass() should not export non-public methods)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+class hello_world {
+ public function hello($to) {
+ return 'Hello ' . $to;
+ }
+ private function bye($to) {
+ return 'Bye ' . $to;
+ }
+}
+
+$server = new SoapServer(NULL, array("uri"=>"test://"));
+$server->setClass('hello_world');
+$functions = $server->getFunctions();
+foreach($functions as $func) {
+ echo $func . "\n";
+}
+?>
+--EXPECT--
+hello
diff --git a/ext/soap/tests/bugs/bug29839.phpt b/ext/soap/tests/bugs/bug29839.phpt
new file mode 100644
index 0000000..11d924e
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29839.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #29839 (incorrect convert (xml:lang to lang))
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+
+function EchoString($s) {
+ return $s;
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('EchoString');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)."/bug29839.wsdl", array("trace"=>1));
+$client->EchoString(array("value"=>"hello","lang"=>"en"));
+echo $client->__getLastRequest();
+echo $client->__getLastResponse();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri"><SOAP-ENV:Body><string xml:lang="en"><ns1:value>hello</ns1:value></string></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri"><SOAP-ENV:Body><string xml:lang="en"><ns1:value>hello</ns1:value></string></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/bugs/bug29839.wsdl b/ext/soap/tests/bugs/bug29839.wsdl
new file mode 100644
index 0000000..d8ccb97
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29839.wsdl
@@ -0,0 +1,42 @@
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://test-uri" targetNamespace="http://test-uri">
+ <types>
+ <xs:schema targetNamespace="http://test-uri" elementFormDefault="qualified">
+ <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd" />
+ <complexType name="LocalizedString">
+ <sequence>
+ <element name="value" type="xsd:string"/>
+ </sequence>
+ <attribute ref="xml:lang" use="required"/>
+ </complexType>
+ </xs:schema>
+ </types>
+ <message name="EchoStringRequest">
+ <part name="string" type="tns:LocalizedString"/>
+ </message>
+ <message name="EchoStringResponse">
+ <part name="string" type="tns:LocalizedString"/>
+ </message>
+ <portType name="AWSProductDataPortType">
+ <operation name="EchoString">
+ <input message="tns:EchoStringRequest"/>
+ <output message="tns:EchoStringResponse"/>
+ </operation>
+ </portType>
+ <binding name="AWSProductDataBinding" type="tns:AWSProductDataPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="EchoString">
+ <soap:operation soapAction="http://test-uri"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="AWSProductData">
+ <port name="AWSProductDataPort" binding="tns:AWSProductDataBinding">
+ <soap:address location="http://aws-beta.amazon.com/onca/soap?Service=AWSProductData"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug29844.phpt b/ext/soap/tests/bugs/bug29844.phpt
new file mode 100644
index 0000000..efaccbc
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29844.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Bug #29844 (SOAP doesn't return the result of a valid SOAP request)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+
+class hello_world {
+ public function hello($to) {
+ return 'Hello ' . $to;
+ }
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->setClass('hello_world');;
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)."/bug29844.wsdl", array("trace"=>1));
+var_dump($client->hello('davey'));
+?>
+--EXPECT--
+string(11) "Hello davey"
diff --git a/ext/soap/tests/bugs/bug29844.wsdl b/ext/soap/tests/bugs/bug29844.wsdl
new file mode 100644
index 0000000..b45aa36
--- /dev/null
+++ b/ext/soap/tests/bugs/bug29844.wsdl
@@ -0,0 +1,66 @@
+<?xml version="1.0" ?>
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://davey.synapticmedia.net/php-mag/shafikdavey_automaticwebservices/src/Listing%201.php" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" name="Crtx_SOAP_AutoDiscover_Example" targetNamespace="http://davey.synapticmedia.net/php-mag/shafikdavey_automaticwebservices/src/Listing%201.php">
+ <portType name="Crtx_SOAP_AutoDiscover_ExamplePort">
+ <operation name="hello">
+ <input message="tns:helloRequest" />
+ <output message="tns:helloResponse" />
+ <documentation>Say Hello to Somebody</documentation>
+ </operation>
+ <operation name="goodBye">
+ <input message="tns:goodByeRequest" />
+ <output message="tns:goodByeResponse" />
+ <documentation>Say Goodbye to Somebody</documentation>
+ </operation>
+ </portType>
+ <binding name="Crtx_SOAP_AutoDiscover_ExampleBinding"
+ type="tns:Crtx_SOAP_AutoDiscover_ExamplePort">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="hello">
+ <input>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </output>
+ <soap:operation soapAction="http://davey.synapticmedia.net/php-mag/shafikdavey_automaticwebservices/src/Listing%201.php#hello" />
+ </operation>
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="goodBye">
+ <input>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </output>
+ <soap:operation soapAction="http://davey.synapticmedia.net/php-mag/shafikdavey_automaticwebservices/src/Listing%201.php#goodBye" />
+ </operation>
+ </binding>
+ <service name="Crtx_SOAP_AutoDiscover_ExampleService">
+ <port name="tns:Crtx_SOAP_AutoDiscover_ExamplePort"
+ binding="tns:Crtx_SOAP_AutoDiscover_ExampleBinding">
+ <soap:address location="http://davey.synapticmedia.net/php-mag/shafikdavey_automaticwebservices/src/Listing%201.php" />
+ </port>
+ </service>
+ <message name="helloRequest">
+ <part name="to" type="xsd:string" />
+ <documentation>Say Hello to Somebody</documentation>
+ </message>
+ <message name="helloResponse">
+ <part name="helloReturn" type="xsd:string" />
+ <documentation>The greeting</documentation>
+ </message>
+ <message name="goodByeRequest">
+ <part name="to" type="xsd:string" />
+ <documentation>Say Goodbye to Somebody</documentation>
+ </message>
+ <message name="goodByeResponse">
+ <part name="goodByeReturn" type="xsd:string" />
+ <documentation>The goodbye</documentation>
+ </message>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug30045.phpt b/ext/soap/tests/bugs/bug30045.phpt
new file mode 100644
index 0000000..281f958
--- /dev/null
+++ b/ext/soap/tests/bugs/bug30045.phpt
@@ -0,0 +1,173 @@
+--TEST--
+Bug #30045 (Cannot pass big integers (> 2147483647) in SOAP requests)
+--SKIPIF--
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+ if (!extension_loaded('simplexml')) die('skip simplexml extension not available');
+?>
+--INI--
+soap.wsdl_cache_enabled=1
+--FILE--
+<?php
+
+function foo($type, $num) {
+ return new SoapVar($num, $type);
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('foo');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ $xml = simplexml_load_string($request);
+ echo $xml->children("http://schemas.xmlsoap.org/soap/envelope/")->Body->children("http://test-uri")->children()->param1->asXML(),"\n";
+ unset($xml);
+
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+
+ return $response;
+ }
+
+}
+
+$soap = new LocalSoapClient(NULL, array("uri"=>"http://test-uri", "location"=>"test://"));
+
+function test($type, $num) {
+ global $soap;
+ try {
+ printf(" %0.0f\n ", $num);
+ $ret = $soap->foo($type, new SoapVar($num, $type));
+ printf(" %0.0f\n", $ret);
+ } catch (SoapFault $ex) {
+ var_dump($ex);
+ }
+}
+/*
+echo "byte\n";
+//test(XSD_BYTE, -129);
+test(XSD_BYTE, -128);
+test(XSD_BYTE, 127);
+//test(XSD_BYTE, 128);
+
+echo "\nshort\n";
+//test(XSD_SHORT, -32769);
+test(XSD_SHORT, -32768);
+test(XSD_SHORT, 32767);
+//test(XSD_SHORT, 32768);
+
+echo "\nint\n";
+//test(XSD_INT, -2147483649);
+test(XSD_INT, -2147483648);
+test(XSD_INT, 2147483647);
+//test(XSD_INT, 2147483648);
+
+echo "\nlong\n";
+//test(XSD_LONG, -9223372036854775809);
+test(XSD_LONG, -9223372036854775808);
+test(XSD_LONG, 9223372036854775807);
+//test(XSD_LONG, 9223372036854775808);
+
+echo "\nunsignedByte\n";
+//test(XSD_UNSIGNEDBYTE, -1);
+test(XSD_UNSIGNEDBYTE, 0);
+test(XSD_UNSIGNEDBYTE, 255);
+//test(XSD_UNSIGNEDBYTE, 256);
+
+echo "\nunsignedShort\n";
+//test(XSD_UNSIGNEDSHORT, -1);
+test(XSD_UNSIGNEDSHORT, 0);
+test(XSD_UNSIGNEDSHORT, 65535);
+//test(XSD_UNSIGNEDSHORT, 65536);
+
+echo "\nunsignedInt\n";
+//test(XSD_UNSIGNEDINT, -1);
+test(XSD_UNSIGNEDINT, 0);
+test(XSD_UNSIGNEDINT, 4294967295);
+//test(XSD_UNSIGNEDINT, 4294967296);
+
+echo "\nunsignedLong\n";
+//test(XSD_UNSIGNEDLONG, -1);
+test(XSD_UNSIGNEDLONG, 0);
+test(XSD_UNSIGNEDLONG, 18446744073709551615);
+//test(XSD_UNSIGNEDLONG, 18446744073709551616);
+
+echo "\nnegativeInteger\n";
+test(XSD_NEGATIVEINTEGER, -18446744073709551616);
+test(XSD_NEGATIVEINTEGER, -1);
+//test(XSD_NEGATIVEINTEGER, 0);
+
+echo "\nnonPositiveInteger\n";
+test(XSD_NONPOSITIVEINTEGER, -18446744073709551616);
+test(XSD_NONPOSITIVEINTEGER, 0);
+//test(XSD_NONPOSITIVEINTEGER, 1);
+
+echo "\nnonNegativeInteger\n";
+//test(XSD_NONNEGATIVEINTEGER, -1);
+test(XSD_NONNEGATIVEINTEGER, 0);
+test(XSD_NONNEGATIVEINTEGER, 18446744073709551616);
+
+echo "\nPositiveInteger\n";
+//test(XSD_POSITIVEINTEGER, 0);
+test(XSD_POSITIVEINTEGER, 1);
+test(XSD_POSITIVEINTEGER, 18446744073709551616);
+
+echo "\ninteger\n";
+test(XSD_INTEGER, -18446744073709551616);
+test(XSD_INTEGER, 18446744073709551616);
+*/
+echo "long\n";
+test(XSD_LONG, 2147483647);
+test(XSD_LONG, 2147483648);
+test(XSD_LONG, 4294967296);
+test(XSD_LONG, 8589934592);
+test(XSD_LONG, 17179869184);
+
+echo "\nunsignedLong\n";
+test(XSD_UNSIGNEDLONG, 2147483647);
+test(XSD_UNSIGNEDLONG, 2147483648);
+test(XSD_UNSIGNEDLONG, 4294967296);
+test(XSD_UNSIGNEDLONG, 8589934592);
+test(XSD_UNSIGNEDLONG, 17179869184);
+
+?>
+--EXPECT--
+long
+ 2147483647
+ <param1 xsi:type="xsd:long">2147483647</param1>
+ 2147483647
+ 2147483648
+ <param1 xsi:type="xsd:long">2147483648</param1>
+ 2147483648
+ 4294967296
+ <param1 xsi:type="xsd:long">4294967296</param1>
+ 4294967296
+ 8589934592
+ <param1 xsi:type="xsd:long">8589934592</param1>
+ 8589934592
+ 17179869184
+ <param1 xsi:type="xsd:long">17179869184</param1>
+ 17179869184
+
+unsignedLong
+ 2147483647
+ <param1 xsi:type="xsd:unsignedLong">2147483647</param1>
+ 2147483647
+ 2147483648
+ <param1 xsi:type="xsd:unsignedLong">2147483648</param1>
+ 2147483648
+ 4294967296
+ <param1 xsi:type="xsd:unsignedLong">4294967296</param1>
+ 4294967296
+ 8589934592
+ <param1 xsi:type="xsd:unsignedLong">8589934592</param1>
+ 8589934592
+ 17179869184
+ <param1 xsi:type="xsd:unsignedLong">17179869184</param1>
+ 17179869184
diff --git a/ext/soap/tests/bugs/bug30106.phpt b/ext/soap/tests/bugs/bug30106.phpt
new file mode 100644
index 0000000..2104c6d
--- /dev/null
+++ b/ext/soap/tests/bugs/bug30106.phpt
@@ -0,0 +1,72 @@
+--TEST--
+Bug #30106 (SOAP cannot not parse 'ref' element. Causes Uncaught SoapFault exception)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled", 0);
+
+function getContinentList() {
+ return array("getContinentListResult"=>array(
+ "schema"=>"<xsd:schema><element name=\"test\" type=\"xsd:string\"/></xsd:schema>",
+ "any"=>"<test>Hello World!</test><test>Bye World!</test>"));
+}
+
+class LocalSoapClient extends SoapClient {
+ function __construct($wsdl, $options=array()) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction("getContinentList");
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ echo $request;
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ echo $response;
+ return $response;
+ }
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)."/bug30106.wsdl");
+var_dump($client->__getFunctions());
+var_dump($client->__getTypes());
+$x = $client->getContinentList(array("AFFILIATE_ID"=>1,"PASSWORD"=>"x"));
+var_dump($x);
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ string(71) "getContinentListResponse getContinentList(getContinentList $parameters)"
+}
+array(3) {
+ [0]=>
+ string(64) "struct getContinentList {
+ int AFFILIATE_ID;
+ string PASSWORD;
+}"
+ [1]=>
+ string(83) "struct getContinentListResponse {
+ getContinentListResult getContinentListResult;
+}"
+ [2]=>
+ string(66) "struct getContinentListResult {
+ <anyXML> schema;
+ <anyXML> any;
+}"
+}
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/PRWebServ/getOtherInformation"><SOAP-ENV:Body><ns1:getContinentList><ns1:AFFILIATE_ID>1</ns1:AFFILIATE_ID><ns1:PASSWORD>x</ns1:PASSWORD></ns1:getContinentList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://tempuri.org/PRWebServ/getOtherInformation"><SOAP-ENV:Body><ns1:getContinentListResponse><ns1:getContinentListResult><xsd:schema><element name="test" type="xsd:string"/></xsd:schema><test>Hello World!</test><test>Bye World!</test></ns1:getContinentListResult></ns1:getContinentListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (1) {
+ ["getContinentListResult"]=>
+ object(stdClass)#%d (2) {
+ ["schema"]=>
+ string(65) "<xsd:schema><element name="test" type="xsd:string"/></xsd:schema>"
+ ["any"]=>
+ string(48) "<test>Hello World!</test><test>Bye World!</test>"
+ }
+}
diff --git a/ext/soap/tests/bugs/bug30106.wsdl b/ext/soap/tests/bugs/bug30106.wsdl
new file mode 100644
index 0000000..db1922d
--- /dev/null
+++ b/ext/soap/tests/bugs/bug30106.wsdl
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/PRWebServ/getOtherInformation" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/PRWebServ/getOtherInformation" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/PRWebServ/getOtherInformation">
+ <s:import namespace="http://www.w3.org/2001/XMLSchema" />
+ <s:element name="getContinentList">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="AFFILIATE_ID" type="s:int" />
+ <s:element minOccurs="0" maxOccurs="1" name="PASSWORD" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="getContinentListResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="getContinentListResult">
+ <s:complexType>
+ <s:sequence>
+ <s:element ref="s:schema" />
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:schema>
+ </wsdl:types>
+ <wsdl:message name="getContinentListSoapIn">
+ <wsdl:part name="parameters" element="tns:getContinentList" />
+ </wsdl:message>
+ <wsdl:message name="getContinentListSoapOut">
+ <wsdl:part name="parameters" element="tns:getContinentListResponse" />
+ </wsdl:message>
+ <wsdl:portType name="getOtherInformationSoap">
+ <wsdl:operation name="getContinentList">
+ <wsdl:input message="tns:getContinentListSoapIn" />
+ <wsdl:output message="tns:getContinentListSoapOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="getOtherInformationSoap" type="tns:getOtherInformationSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <wsdl:operation name="getContinentList">
+ <soap:operation soapAction="http://tempuri.org/PRWebServ/getOtherInformation/getContinentList" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="getOtherInformation">
+ <wsdl:port name="getOtherInformationSoap" binding="tns:getOtherInformationSoap">
+ <soap:address location="http://www.precisionreservations.com/PRWebServ/getOtherInformation.asmx" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions> \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug30175.phpt b/ext/soap/tests/bugs/bug30175.phpt
new file mode 100644
index 0000000..8d721ea
--- /dev/null
+++ b/ext/soap/tests/bugs/bug30175.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Bug #30175 (SOAP results aren't parsed correctly)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+
+class LocalSoapClient extends SoapClient {
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope
+xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:ns1="urn:qweb">
+<SOAP-ENV:Body
+SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+id="_0">
+<ns1:HostInfo xsi:type="ns1:HostInfo">
+<name xsi:type="xsd:string">blah blah some name field</name>
+<shortDescription xsi:type="xsd:string">This is a description. more blah blah blah</shortDescription>
+<ipAddress xsi:type="xsd:string">127.0.0.1</ipAddress>
+</ns1:HostInfo>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+ }
+
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)."/bug30175.wsdl");
+var_dump($client->qwebGetHostInfo());
+?>
+--EXPECT--
+array(3) {
+ ["name"]=>
+ string(25) "blah blah some name field"
+ ["shortDescription"]=>
+ string(42) "This is a description. more blah blah blah"
+ ["ipAddress"]=>
+ string(9) "127.0.0.1"
+}
diff --git a/ext/soap/tests/bugs/bug30175.wsdl b/ext/soap/tests/bugs/bug30175.wsdl
new file mode 100644
index 0000000..f4cae25
--- /dev/null
+++ b/ext/soap/tests/bugs/bug30175.wsdl
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="qweb"
+ targetNamespace="http://www.newsblob.com/qweb.wsdl"
+ xmlns:tns="http://www.newsblob.com/qweb.wsdl"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns1="urn:qweb"
+ xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+<types>
+
+ <schema targetNamespace="urn:qweb"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns1="urn:qweb"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="unqualified"
+ attributeFormDefault="unqualified">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="qwebGetHostInfoResponse">
+ <sequence>
+ <element name="return" type="ns1:HostInfo" minOccurs="1" maxOccurs="1"/>
+ </sequence>
+ </complexType>
+ <complexType name="ArrayOfHostInfo">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <sequence>
+ <element name="item" type="ns1:HostInfo" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute ref="SOAP-ENC:arrayType" WSDL:arrayType="ns1:HostInfo[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </schema>
+
+</types>
+
+<message name="qwebSquareRequest">
+ <part name="mynum" type="xsd:int"/>
+</message>
+
+<message name="qwebSquareResponse">
+ <part name="result" type="xsd:int"/>
+</message>
+
+<message name="qwebStrlenRequest">
+ <part name="mystr" type="xsd:string"/>
+</message>
+
+<message name="qwebStrlenResponse">
+ <part name="result" type="xsd:int"/>
+</message>
+
+<message name="qwebGetHostInfoRequest">
+</message>
+
+<message name="HostInfo">
+ <part name="name" type="xsd:string"/>
+ <part name="shortDescription" type="xsd:string"/>
+ <part name="ipAddress" type="xsd:string"/>
+</message>
+
+<portType name="qwebPortType">
+ <operation name="qwebSquare">
+ <documentation>Service definition of function ns1__qwebSquare</documentation>
+ <input message="tns:qwebSquareRequest"/>
+ <output message="tns:qwebSquareResponse"/>
+ </operation>
+ <operation name="qwebStrlen">
+ <documentation>Service definition of function ns1__qwebStrlen</documentation>
+ <input message="tns:qwebStrlenRequest"/>
+ <output message="tns:qwebStrlenResponse"/>
+ </operation>
+ <operation name="qwebGetHostInfo">
+ <documentation>Service definition of function ns1__qwebGetHostInfo</documentation>
+ <input message="tns:qwebGetHostInfoRequest"/>
+ <output message="tns:HostInfo"/>
+ </operation>
+</portType>
+
+<binding name="qweb" type="tns:qwebPortType">
+ <SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="qwebSquare">
+ <SOAP:operation style="rpc" soapAction=""/>
+ <input>
+ <SOAP:body use="encoded" namespace="urn:qweb" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <SOAP:body use="encoded" namespace="urn:qweb" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="qwebStrlen">
+ <SOAP:operation style="rpc" soapAction=""/>
+ <input>
+ <SOAP:body use="encoded" namespace="urn:qweb" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <SOAP:body use="encoded" namespace="urn:qweb" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="qwebGetHostInfo">
+ <SOAP:operation style="rpc" soapAction=""/>
+ <input>
+ <SOAP:body use="encoded" namespace="urn:qweb" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <SOAP:body use="encoded" namespace="urn:qweb" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+</binding>
+
+<service name="qweb">
+ <documentation>Demo Qweb SOAP interface</documentation>
+ <port name="qweb" binding="tns:qweb">
+ <SOAP:address location="http://www.newsblob.com:6969"/>
+ </port>
+</service>
+
+</definitions>
diff --git a/ext/soap/tests/bugs/bug30799.phpt b/ext/soap/tests/bugs/bug30799.phpt
new file mode 100644
index 0000000..fe7c8ca
--- /dev/null
+++ b/ext/soap/tests/bugs/bug30799.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #30799 (SoapServer doesn't handle private or protected properties)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class foo {
+ public $a="a";
+ private $b="b";
+ protected $c="c";
+
+}
+
+$x = new SoapClient(NULL,array("location"=>"test://",
+ "uri" => "test://",
+ "exceptions" => 0,
+ "trace" => 1 ));
+$x->test(new foo());
+echo $x->__getLastRequest();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><param0 xsi:type="SOAP-ENC:Struct"><a xsi:type="xsd:string">a</a><b xsi:type="xsd:string">b</b><c xsi:type="xsd:string">c</c></param0></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/bugs/bug30928.phpt b/ext/soap/tests/bugs/bug30928.phpt
new file mode 100644
index 0000000..0f473b3
--- /dev/null
+++ b/ext/soap/tests/bugs/bug30928.phpt
@@ -0,0 +1,63 @@
+--TEST--
+Bug #30928 (When Using WSDL, SoapServer doesn't handle private or protected properties)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled", 0);
+
+class foo {
+ public $a="a";
+ private $b="b";
+ protected $c="c";
+}
+
+function test($x) {
+ return $x;
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('test');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+}
+
+$x = new LocalSoapClient(dirname(__FILE__)."/bug30928.wsdl",
+ array());
+var_dump($x->test(new foo()));
+
+$x = new LocalSoapClient(dirname(__FILE__)."/bug30928.wsdl",
+ array("classmap" => array('testType'=>'foo')));
+var_dump($x->test(new foo()));
+
+echo "ok\n";
+?>
+--EXPECTF--
+object(stdClass)#%d (3) {
+ ["a"]=>
+ string(1) "a"
+ ["b"]=>
+ string(1) "b"
+ ["c"]=>
+ string(1) "c"
+}
+object(foo)#%d (3) {
+ ["a"]=>
+ string(1) "a"
+ ["b":"foo":private]=>
+ string(1) "b"
+ ["c":protected]=>
+ string(1) "c"
+}
+ok
diff --git a/ext/soap/tests/bugs/bug30928.wsdl b/ext/soap/tests/bugs/bug30928.wsdl
new file mode 100644
index 0000000..7ed34d3
--- /dev/null
+++ b/ext/soap/tests/bugs/bug30928.wsdl
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions name="InteropTest"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="http://test-uri/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://test-uri/">
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test-uri/">
+ <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+ <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
+ <complexType name="testType">
+ <sequence>
+ <element name="a" type="string"/>
+ <element name="b" type="string"/>
+ </sequence>
+ <attribute name="c" type="string"/>
+ </complexType>
+ </schema>
+ </types>
+ <message name="testMessage">
+ <part name="testParam" type="tns:testType"/>
+ </message>
+ <portType name="testPortType">
+ <operation name="test">
+ <input message="testMessage"/>
+ <output message="testMessage"/>
+ </operation>
+ </portType>
+ <binding name="testBinding" type="testPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="test">
+ <soap:operation soapAction="#test" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://test-uri/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://test-uri/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="testService">
+ <port name="testPort" binding="tns:testBinding">
+ <soap:address location="test://" />
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug30994.phpt b/ext/soap/tests/bugs/bug30994.phpt
new file mode 100644
index 0000000..28e3b92
--- /dev/null
+++ b/ext/soap/tests/bugs/bug30994.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Bug #30994 (SOAP server unable to handle request with references)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="utf-8"?>
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="http://spock/kunta/kunta"
+ xmlns:types="http://spock/kunta/kunta/encodedTypes"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+<soap:Body
+soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+ <q1:bassCall xmlns:q1="http://spock/bass/types/kunta">
+ <system xsi:type="xsd:string">XXX</system>
+ <function xsi:type="xsd:string">TASKTEST</function>
+ <parameter href="#id1" />
+ </q1:bassCall>
+
+ <soapenc:Array id="id1" soapenc:arrayType="tns:Item[1]">
+ <Item href="#id2" />
+ </soapenc:Array>
+
+ <tns:Item id="id2" xsi:type="tns:Item">
+ <key xsi:type="xsd:string">ABCabc123</key>
+ <val xsi:type="xsd:string">123456</val>
+ </tns:Item>
+
+</soap:Body>
+</soap:Envelope>
+EOF;
+
+function bassCall() {
+ return "ok";
+}
+
+$x = new SoapServer(NULL, array("uri"=>"http://spock/kunta/kunta"));
+$x->addFunction("bassCall");
+$x->handle($HTTP_RAW_POST_DATA);
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://spock/kunta/kunta" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:bassCallResponse><return xsi:type="xsd:string">ok</return></ns1:bassCallResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug31422-win.phpt b/ext/soap/tests/bugs/bug31422-win.phpt
new file mode 100644
index 0000000..ba8df07
--- /dev/null
+++ b/ext/soap/tests/bugs/bug31422-win.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Bug #31422 (No Error-Logging on SoapServer-Side)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die('skip not valid for non windows');
+}
+require_once('skipif.inc');
+?>
+--INI--
+log_errors=1
+--FILE--
+<?php
+function Add($x,$y) {
+ fopen();
+ user_error("Hello", E_USER_ERROR);
+ return $x+$y;
+}
+
+$server = new SoapServer(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("Add");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:Add xmlns:ns1="http://testuri.org">
+ <x xsi:type="xsd:int">22</x>
+ <y xsi:type="xsd:int">33</y>
+ </ns1:Add>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Hello</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+PHP Warning: fopen() expects at least 2 parameters, 0 given in %sbug31422-win.php on line %d
+PHP Fatal error: Hello in %sbug31422-win.php on line %d
diff --git a/ext/soap/tests/bugs/bug31422.phpt b/ext/soap/tests/bugs/bug31422.phpt
new file mode 100644
index 0000000..c8ddcfe
--- /dev/null
+++ b/ext/soap/tests/bugs/bug31422.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Bug #31422 (No Error-Logging on SoapServer-Side)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die('skip not valid for windows');
+}
+require_once('skipif.inc');
+?>
+--INI--
+log_errors=1
+error_log=
+--FILE--
+<?php
+function Add($x,$y) {
+ fopen();
+ user_error("Hello", E_USER_ERROR);
+ return $x+$y;
+}
+
+$server = new SoapServer(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("Add");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:Add xmlns:ns1="http://testuri.org">
+ <x xsi:type="xsd:int">22</x>
+ <y xsi:type="xsd:int">33</y>
+ </ns1:Add>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECTF--
+PHP Warning: fopen() expects at least 2 parameters, 0 given in %sbug31422.php on line %d
+PHP Fatal error: Hello in %sbug31422.php on line %d
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Hello</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug31695.phpt b/ext/soap/tests/bugs/bug31695.phpt
new file mode 100644
index 0000000..9def103
--- /dev/null
+++ b/ext/soap/tests/bugs/bug31695.phpt
@@ -0,0 +1,62 @@
+--TEST--
+Bug #31695 (Cannot redefine endpoint when using WSDL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled", 0);
+
+function Test($x) {
+ return $x;
+}
+
+class LocalSoapClient extends SoapClient {
+ function __construct($wsdl, $options=array()) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction("Test");
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ echo "$location\n";
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)."/bug31695.wsdl");
+$client->Test("str");
+$client = new LocalSoapClient(dirname(__FILE__)."/bug31695.wsdl", array("location"=>"test://1"));
+$client->Test("str");
+$client->__soapCall("Test",
+ array("arg1"),
+ array("location"=>"test://2"));
+$old = $client->__setLocation("test://3");
+echo "$old\n";
+$client->Test("str");
+$client->Test("str");
+$client->__setLocation($old);
+$client->Test("str");
+$old = $client->__setLocation();
+$client->Test("str");
+$client->__setLocation($old);
+$client->Test("str");
+$client->__setLocation(null);
+$client->Test("str");
+var_dump($client->__setLocation());
+?>
+--EXPECT--
+test://0
+test://1
+test://2
+test://1
+test://3
+test://3
+test://1
+test://0
+test://1
+test://0
+NULL
diff --git a/ext/soap/tests/bugs/bug31695.wsdl b/ext/soap/tests/bugs/bug31695.wsdl
new file mode 100644
index 0000000..5785cb0
--- /dev/null
+++ b/ext/soap/tests/bugs/bug31695.wsdl
@@ -0,0 +1,47 @@
+<?xml version="1.0" ?>
+<definitions
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:si="http://soapinterop.org/xsd"
+ xmlns:tns="http://linuxsrv.home/~dmitry/soap/test.wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl">
+
+ <message name="TestRequest">
+ <part name="x" type="xsd:string" />
+ </message>
+ <message name="TestResponse">
+ <part name="result" type="xsd:string" />
+ </message>
+
+ <portType name="TestServicePortType">
+ <operation name="Test">
+ <input message="tns:TestRequest" />
+ <output message="tns:TestResponse" />
+ </operation>
+ </portType>
+
+ <binding name="TestServiceBinding" type="tns:TestServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="Test">
+ <soap:operation soapAction="Test" style="rpc" />
+ <input>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </input>
+ <output>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="TestService">
+ <port name="TestServicePort" binding="tns:TestServiceBinding">
+ <soap:address location="test://0" />
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/bugs/bug31755.phpt b/ext/soap/tests/bugs/bug31755.phpt
new file mode 100644
index 0000000..1d65b3a
--- /dev/null
+++ b/ext/soap/tests/bugs/bug31755.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #31422 (No Error-Logging on SoapServer-Side)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client=new SOAPClient(null, array('location' => 'http://localhost',
+'uri' => 'myNS', 'exceptions' => false, 'trace' => true));
+
+$header = new SOAPHeader(null, 'foo', 'bar');
+
+$response= $client->__call('function', array(), null, $header);
+
+print $client->__getLastRequest();
+?>
+--EXPECTF--
+Warning: SoapHeader::SoapHeader(): Invalid namespace in %s on line %d
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="myNS" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns1:function/></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug32776.phpt b/ext/soap/tests/bugs/bug32776.phpt
new file mode 100644
index 0000000..6dc9466
--- /dev/null
+++ b/ext/soap/tests/bugs/bug32776.phpt
@@ -0,0 +1,49 @@
+--TEST--
+Bug #32776 (SOAP doesn't support one-way operations)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+
+$d = null;
+
+function test($x) {
+ global $d;
+ $d = $x;
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('test');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$x = new LocalSoapClient(dirname(__FILE__)."/bug32776.wsdl",array("trace"=>true,"exceptions"=>false));
+var_dump($x->test("Hello"));
+var_dump($d);
+var_dump($x->__getLastRequest());
+var_dump($x->__getLastResponse());
+echo "ok\n";
+?>
+--EXPECT--
+NULL
+string(5) "Hello"
+string(459) "<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:test><x xsi:type="xsd:string">Hello</x></SOAP-ENV:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+"
+string(0) ""
+ok
diff --git a/ext/soap/tests/bugs/bug32776.wsdl b/ext/soap/tests/bugs/bug32776.wsdl
new file mode 100644
index 0000000..7339018
--- /dev/null
+++ b/ext/soap/tests/bugs/bug32776.wsdl
@@ -0,0 +1,47 @@
+<?xml version="1.0" ?>
+<definitions
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:si="http://soapinterop.org/xsd"
+ xmlns:tns="http://linuxsrv.home/~dmitry/soap/test.wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl">
+
+ <types>
+ <xsd:schema targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl">
+ <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+ <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
+ </xsd:schema>
+ </types>
+
+ <message name="TestRequest">
+ <part name="x" type="xsd:string" />
+ </message>
+
+ <portType name="TestServicePortType">
+ <operation name="test">
+ <input message="tns:TestRequest" />
+ </operation>
+ </portType>
+
+ <binding name="TestServiceBinding" type="tns:TestServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="test">
+ <soap:operation soapAction="Add" style="rpc" />
+ <input>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </input>
+ </operation>
+ </binding>
+
+ <service name="TestService">
+ <port name="TestServicePort" binding="tns:TestServiceBinding">
+ <soap:address location="http://linuxsrv.home/~dmitry/soap/soap_server.php" />
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/bugs/bug32941.phpt b/ext/soap/tests/bugs/bug32941.phpt
new file mode 100644
index 0000000..d1e3fff
--- /dev/null
+++ b/ext/soap/tests/bugs/bug32941.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Bug #32941 (Sending structured exception kills a php)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class TestSoapClient extends SoapClient {
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<soapenv:Envelope
+xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <soapenv:Body>
+ <soapenv:Fault>
+ <faultcode>soapenv:Server.userException</faultcode>
+ <faultstring>service.EchoServiceException</faultstring>
+ <detail>
+ <service.EchoServiceException xsi:type="ns1:EchoServiceException" xmlns:ns1="urn:service.EchoService">
+ <intParameter xsi:type="xsd:int">105</intParameter>
+ <parameter xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">string param</parameter>
+ </service.EchoServiceException>
+ <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">steckovic</ns2:hostname>
+ </detail>
+ </soapenv:Fault>
+ </soapenv:Body>
+</soapenv:Envelope>
+EOF;
+ }
+}
+
+ini_set("soap.wsdl_cache_enabled", 1);
+$client = new TestSoapClient(dirname(__FILE__).'/bug32941.wsdl', array("trace" => 1, 'exceptions' => 0));
+$ahoj = $client->echoString('exception');
+$client = new TestSoapClient(dirname(__FILE__).'/bug32941.wsdl', array("trace" => 1, 'exceptions' => 0));
+$ahoj = $client->echoString('exception');
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug32941.wsdl b/ext/soap/tests/bugs/bug32941.wsdl
new file mode 100755
index 0000000..61fd13d
--- /dev/null
+++ b/ext/soap/tests/bugs/bug32941.wsdl
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://212.24.157.117:8080/axis/services/echo" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://212.24.157.117:8080/axis/services/echo" xmlns:intf="http://212.24.157.117:8080/axis/services/echo" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:service.EchoService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+<!--WSDL created by Apache Axis version: 1.2RC3
+Built on Feb 28, 2005 (10:15:14 EST)-->
+ <wsdl:types>
+ <schema targetNamespace="urn:service.EchoService" xmlns="http://www.w3.org/2001/XMLSchema">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="EchoServiceException">
+ <sequence>
+ <element name="intParameter" type="xsd:int"/>
+ <element name="parameter" nillable="true" type="soapenc:string"/>
+ </sequence>
+ </complexType>
+ <complexType name="Person">
+ <sequence>
+ <element name="name" nillable="true" type="soapenc:string"/>
+ <element name="surname" nillable="true" type="soapenc:string"/>
+ </sequence>
+ </complexType>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="echoStringResponse">
+
+ <wsdl:part name="echoStringReturn" type="soapenc:string"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="EchoServiceException">
+
+ <wsdl:part name="EchoServiceException" type="tns1:EchoServiceException"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoStringRequest">
+
+ <wsdl:part name="e" type="xsd:string"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoPersonResponse">
+
+ <wsdl:part name="echoPersonReturn" type="tns1:Person"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoPersonRequest">
+
+ <wsdl:part name="p" type="tns1:Person"/>
+
+ </wsdl:message>
+
+ <wsdl:portType name="EchoService">
+
+ <wsdl:operation name="echoString" parameterOrder="e">
+
+ <wsdl:input message="impl:echoStringRequest" name="echoStringRequest"/>
+
+ <wsdl:output message="impl:echoStringResponse" name="echoStringResponse"/>
+
+ <wsdl:fault message="impl:EchoServiceException" name="EchoServiceException"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoPerson" parameterOrder="p">
+
+ <wsdl:input message="impl:echoPersonRequest" name="echoPersonRequest"/>
+
+ <wsdl:output message="impl:echoPersonResponse" name="echoPersonResponse"/>
+
+ <wsdl:fault message="impl:EchoServiceException" name="EchoServiceException"/>
+
+ </wsdl:operation>
+
+ </wsdl:portType>
+
+ <wsdl:binding name="echoSoapBinding" type="impl:EchoService">
+
+ <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="echoString">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="echoStringRequest">
+
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:service.EchoService" use="encoded"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="echoStringResponse">
+
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://212.24.157.117:8080/axis/services/echo" use="encoded"/>
+
+ </wsdl:output>
+
+ <wsdl:fault name="EchoServiceException">
+
+ <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="EchoServiceException" namespace="urn:service.EchoService" use="encoded"/>
+
+ </wsdl:fault>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoPerson">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="echoPersonRequest">
+
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://service" use="encoded"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="echoPersonResponse">
+
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://212.24.157.117:8080/axis/services/echo" use="encoded"/>
+
+ </wsdl:output>
+
+ <wsdl:fault name="EchoServiceException">
+
+ <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="EchoServiceException" namespace="http://212.24.157.117:8080/axis/services/echo" use="encoded"/>
+
+ </wsdl:fault>
+
+ </wsdl:operation>
+
+ </wsdl:binding>
+
+ <wsdl:service name="EchoServiceService">
+
+ <wsdl:port binding="impl:echoSoapBinding" name="echo">
+
+ <wsdlsoap:address location="http://212.24.157.117:8080/axis/services/echo"/>
+
+ </wsdl:port>
+
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug34449.phpt b/ext/soap/tests/bugs/bug34449.phpt
new file mode 100644
index 0000000..f5766e2
--- /dev/null
+++ b/ext/soap/tests/bugs/bug34449.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #34449 (ext/soap: XSD_ANYXML functionality not exposed)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class TestSoapClient extends SoapClient {
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ echo "$request\n";
+ exit;
+ }
+}
+
+$my_xml = "<array><item/><item/><item/></array>";
+$client = new TestSoapClient(null, array('location' => 'test://', 'uri' => 'test://'));
+$client->AnyFunction(new SoapVar($my_xml, XSD_ANYXML));
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:AnyFunction><array><item/><item/><item/></array></ns1:AnyFunction></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug34453.phpt b/ext/soap/tests/bugs/bug34453.phpt
new file mode 100644
index 0000000..0f9543b
--- /dev/null
+++ b/ext/soap/tests/bugs/bug34453.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #29839 (incorrect convert (xml:lang to lang))
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+
+function EchoString($s) {
+ return $s;
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('EchoString');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)."/bug34453.wsdl", array("trace"=>1));
+$client->EchoString(array("value"=>"hello","lang"=>"en"));
+echo $client->__getLastRequest();
+echo $client->__getLastResponse();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri"><SOAP-ENV:Body><string xml:lang="en"><ns1:value>hello</ns1:value></string></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri"><SOAP-ENV:Body><string xml:lang="en"><ns1:value>hello</ns1:value></string></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/bugs/bug34453.wsdl b/ext/soap/tests/bugs/bug34453.wsdl
new file mode 100755
index 0000000..205e1c9
--- /dev/null
+++ b/ext/soap/tests/bugs/bug34453.wsdl
@@ -0,0 +1,42 @@
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://test-uri" targetNamespace="http://test-uri">
+ <types>
+ <xs:schema targetNamespace="http://test-uri" elementFormDefault="qualified">
+ <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml2.xsd" />
+ <complexType name="LocalizedString">
+ <sequence>
+ <element name="value" type="xsd:string"/>
+ </sequence>
+ <attribute ref="xml:lang" use="required"/>
+ </complexType>
+ </xs:schema>
+ </types>
+ <message name="EchoStringRequest">
+ <part name="string" type="tns:LocalizedString"/>
+ </message>
+ <message name="EchoStringResponse">
+ <part name="string" type="tns:LocalizedString"/>
+ </message>
+ <portType name="AWSProductDataPortType">
+ <operation name="EchoString">
+ <input message="tns:EchoStringRequest"/>
+ <output message="tns:EchoStringResponse"/>
+ </operation>
+ </portType>
+ <binding name="AWSProductDataBinding" type="tns:AWSProductDataPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="EchoString">
+ <soap:operation soapAction="http://test-uri"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="AWSProductData">
+ <port name="AWSProductDataPort" binding="tns:AWSProductDataBinding">
+ <soap:address location="http://aws-beta.amazon.com/onca/soap?Service=AWSProductData"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug34643.phpt b/ext/soap/tests/bugs/bug34643.phpt
new file mode 100644
index 0000000..b995651
--- /dev/null
+++ b/ext/soap/tests/bugs/bug34643.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Bug #34643 (wsdl default value)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled", 0);
+
+class fp {
+ public function get_it($opt="zzz") {
+ return $opt;
+ }
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->setClass('fp');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$cl = new LocalSoapClient(dirname(__FILE__).'/bug34643.wsdl', array("trace"=>1));
+print_r($cl->__getFunctions());
+echo $cl->get_it("aaa")."\n";
+echo $cl->get_it()."\n";
+var_dump($cl->get_it(null));
+?>
+--EXPECT--
+Array
+(
+ [0] => string get_it(string $opt)
+)
+aaa
+zzz
+NULL
diff --git a/ext/soap/tests/bugs/bug34643.wsdl b/ext/soap/tests/bugs/bug34643.wsdl
new file mode 100755
index 0000000..24c3a50
--- /dev/null
+++ b/ext/soap/tests/bugs/bug34643.wsdl
@@ -0,0 +1,42 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<definitions name="wsdl" targetNamespace="urn:wsdl"
+xmlns:typens="urn:wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:wsdl">
+ <xsd:element name="opt" type="xsd:string" default="zzz" />
+ </xsd:schema>
+ </types>
+ <message name="get_it">
+ <part name="opt" element="typens:opt"/>
+ </message>
+ <message name="get_itResponse">
+ <part name="return" type="xsd:string"/>
+ </message>
+ <portType name="fpPortType">
+ <operation name="get_it">
+ <input message="typens:get_it"/>
+ <output message="typens:get_itResponse"/>
+ </operation>
+ </portType>
+ <binding name="fpBinding" type="typens:fpPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="get_it">
+ <soap:operation soapAction="urn:fpAction"/>
+ <input>
+ <soap:body namespace="urn:wsdl" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body namespace="urn:wsdl" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="wsdlService">
+ <port name="fpPort" binding="typens:fpBinding">
+ <soap:address location="**********"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug34657.phpt b/ext/soap/tests/bugs/bug34657.phpt
new file mode 100644
index 0000000..d974d02
--- /dev/null
+++ b/ext/soap/tests/bugs/bug34657.phpt
@@ -0,0 +1,35 @@
+--TEST--
+Bug #34657 (If you get a communication problem when loading the WSDL, it fatal's)
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+if (extension_loaded("openssl")) {
+ /*
+ when openssl loaded, tcp stream is less verbose, so some error messages are missing
+ so let's skip the test in this case
+ */
+ die("skip OpenSSL extension required");
+}
+?>
+--FILE--
+<?php
+try {
+ $client = new SoapClient('http://i_dont_exist.com/some.wsdl');
+ echo "?\n";
+} catch (SoapFault $e) {
+ echo get_class($e)."\n";
+ echo $e->faultstring."\n";
+ echo "ok\n";
+} catch (Exception $e) {
+ echo get_class($e)."\n";
+}
+?>
+--EXPECTF--
+Warning: SoapClient::SoapClient(): %s %sbug34657.php on line 3
+
+Warning: SoapClient::SoapClient(http://i_dont_exist.com/some.wsdl): failed to open stream: %sbug34657.php on line 3
+
+Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity "http://i_dont_exist.com/some.wsdl" in %sbug34657.php on line 3
+SoapFault
+SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://i_dont_exist.com/some.wsdl'%S
+ok
diff --git a/ext/soap/tests/bugs/bug35142.phpt b/ext/soap/tests/bugs/bug35142.phpt
new file mode 100644
index 0000000..94c1aa9
--- /dev/null
+++ b/ext/soap/tests/bugs/bug35142.phpt
@@ -0,0 +1,135 @@
+--TEST--
+Bug #35142 (SOAP Client/Server Complex Object Support)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled",0);
+$timestamp = "2005-11-08T11:22:07+03:00";
+$wsdl = dirname(__FILE__)."/bug35142.wsdl";
+
+function PostEvents($x) {
+ var_dump($x);
+ exit();
+ return $x;
+}
+
+class TestSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('PostEvents');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ echo "$request\n";
+ $this->server->handle($request);
+ return $response;
+ }
+
+}
+
+$soapClient = new TestSoapClient($wsdl,
+ array('trace' => 1, 'exceptions' => 0,
+ 'classmap' => array('logOnEvent' => 'LogOnEvent',
+ 'logOffEvent' => 'LogOffEvent',
+ 'events' => 'IVREvents')));
+
+$logOnEvent = new LogOnEvent(34567, $timestamp);
+$logOffEvents[] = new LogOffEvent(34567, $timestamp, "Smoked");
+$logOffEvents[] = new LogOffEvent(34568, $timestamp, "SmokeFree");
+$ivrEvents = new IVREvents("1.0", 101, 12345, 'IVR', $logOnEvent, $logOffEvents);
+
+$result = $soapClient->PostEvents($ivrEvents);
+
+class LogOffEvent {
+ public $audienceMemberId;
+ public $timestamp;
+ public $smokeStatus;
+ public $callInitiator;
+
+ function __construct($audienceMemberId, $timestamp, $smokeStatus) {
+ $this->audienceMemberId = $audienceMemberId;
+ $this->timestamp = $timestamp;
+ $this->smokeStatus = $smokeStatus;
+ $this->callInitiator = "IVR";
+ }
+}
+
+class LogOnEvent {
+ public $audienceMemberId;
+ public $timestamp;
+
+ function __construct($audienceMemberId, $timestamp) {
+ $this->audienceMemberId = $audienceMemberId;
+ $this->timestamp = $timestamp;
+ }
+}
+
+class IVREvents {
+ public $version;
+ public $activityId;
+ public $messageId;
+ public $source;
+ public $logOnEvent;
+ public $logOffEvent;
+
+ function __construct($version, $activityId, $messageId, $source, $logOnEvent=NULL, $logOffEvent=NULL) {
+ $this->version = $version;
+ $this->activityId = $activityId;
+ $this->messageId = $messageId;
+ $this->source = $source;
+ $this->logOnEvent = $logOnEvent;
+ $this->logOffEvent = $logOffEvent;
+ }
+}
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testurl/Message"><SOAP-ENV:Body><ns1:ivrEvents version="1.0" activityId="101" messageId="12345" source="IVR"><ns1:logOffEvent audienceMemberId="34567" timestamp="2005-11-08T11:22:07+03:00" smokeStatus="Smoked" callInitiator="IVR"/><ns1:logOffEvent audienceMemberId="34568" timestamp="2005-11-08T11:22:07+03:00" smokeStatus="SmokeFree" callInitiator="IVR"/><ns1:logOnEvent audienceMemberId="34567" timestamp="2005-11-08T11:22:07+03:00"/></ns1:ivrEvents></SOAP-ENV:Body></SOAP-ENV:Envelope>
+
+object(IVREvents)#%d (6) {
+ ["version"]=>
+ string(3) "1.0"
+ ["activityId"]=>
+ int(101)
+ ["messageId"]=>
+ int(12345)
+ ["source"]=>
+ string(3) "IVR"
+ ["logOnEvent"]=>
+ object(LogOnEvent)#%d (2) {
+ ["audienceMemberId"]=>
+ int(34567)
+ ["timestamp"]=>
+ string(25) "2005-11-08T11:22:07+03:00"
+ }
+ ["logOffEvent"]=>
+ array(2) {
+ [0]=>
+ object(LogOffEvent)#%d (4) {
+ ["audienceMemberId"]=>
+ int(34567)
+ ["timestamp"]=>
+ string(25) "2005-11-08T11:22:07+03:00"
+ ["smokeStatus"]=>
+ string(6) "Smoked"
+ ["callInitiator"]=>
+ string(3) "IVR"
+ }
+ [1]=>
+ object(LogOffEvent)#%d (4) {
+ ["audienceMemberId"]=>
+ int(34568)
+ ["timestamp"]=>
+ string(25) "2005-11-08T11:22:07+03:00"
+ ["smokeStatus"]=>
+ string(9) "SmokeFree"
+ ["callInitiator"]=>
+ string(3) "IVR"
+ }
+ }
+}
diff --git a/ext/soap/tests/bugs/bug35142.wsdl b/ext/soap/tests/bugs/bug35142.wsdl
new file mode 100755
index 0000000..2c712ec
--- /dev/null
+++ b/ext/soap/tests/bugs/bug35142.wsdl
@@ -0,0 +1,543 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions xmlns:s1="http://testurl/Events" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://testurl/Message" xmlns:s3="http://testurl/Smoker" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:s4="http://testurl/AudienceMember" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://testurl/Actions" xmlns:tns="http://testurl/Service" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://testurl/Service" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Message">
+ <s:import namespace="http://testurl/Events" />
+ <s:import namespace="http://testurl/Actions" />
+ <s:element name="ivrActions" type="s0:actions" />
+ <s:complexType name="actions">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:choice minOccurs="0" maxOccurs="unbounded">
+ <s:element minOccurs="0" maxOccurs="1" name="pauseSmokerAction" type="s2:pauseSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="terminateSmokerAction" type="s2:terminateSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="activateSmokerAction" type="s2:activateSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="addSmokerAction" type="s2:addSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="updateSmokerAction" type="s2:updateSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="deleteSmokerAction" type="s2:deleteSmokerAction" />
+ </s:choice>
+ </s:sequence>
+ <s:attribute default="Client" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractMessage" abstract="true">
+ <s:attribute default="1.0" name="version" type="s:string" />
+ <s:attribute name="activityId" type="s:unsignedLong" use="required" />
+ <s:attribute name="messageId" type="s:unsignedLong" use="required" />
+ </s:complexType>
+ <s:complexType name="events">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:choice minOccurs="0" maxOccurs="unbounded">
+ <s:element minOccurs="0" maxOccurs="1" name="authFailureEvent" type="s1:authFailureEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="logOffEvent" type="s1:logOffEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="cravingLineEvent" type="s1:cravingLineEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="terminateEvent" type="s1:terminateEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="relapseWakeSmsReplaceEvent" type="s1:relapseWakeSmsReplaceEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="confessionLineEvent" type="s1:confessionLineEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="rfqRecordedEvent" type="s1:rfqRecordedEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="logOnEvent" type="s1:logOnEvent" />
+ </s:choice>
+ </s:sequence>
+ <s:attribute default="IVR" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="ivrMessageSource">
+ <s:restriction base="s:string">
+ <s:enumeration value="IVR" />
+ <s:enumeration value="Client" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="actionResults">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:choice minOccurs="0" maxOccurs="unbounded">
+ <s:element minOccurs="0" maxOccurs="1" name="updateSmokerActionResult" type="s2:updateSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="activateSmokerActionResult" type="s2:activateSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="deleteSmokerActionResult" type="s2:deleteSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="addSmokerActionResult" type="s2:addSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="pauseSmokerActionResult" type="s2:pauseSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="terminateSmokerActionResult" type="s2:terminateSmokerActionResult" />
+ </s:choice>
+ </s:sequence>
+ <s:attribute default="IVR" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="eventResults">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="eventResult" type="s1:eventResult" />
+ </s:sequence>
+ <s:attribute default="IVR" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:element name="ivrActionResults" type="s0:actionResults" />
+ <s:element name="ivrEvents" type="s0:events" />
+ <s:element name="ivrEventResults" type="s0:eventResults" />
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Events">
+ <s:complexType name="authFailureEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="mobileNumber" type="s:string" />
+ <s:attribute name="line" type="s1:line" use="required" />
+ <s:attribute name="reason" type="s:string" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractEvent" abstract="true">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" />
+ <s:attribute name="timestamp" type="s:dateTime" use="required" />
+ </s:complexType>
+ <s:complexType name="logOnEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent" />
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="cravingLineEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="selection" type="s1:cravingLineEventSelection" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="cravingLineEventSelection">
+ <s:attribute name="type" type="s1:cravingLineMessageType" use="required" />
+ <s:attribute name="msgNumber" type="s:positiveInteger" />
+ </s:complexType>
+ <s:simpleType name="cravingLineMessageType">
+ <s:restriction base="s:string">
+ <s:enumeration value="Motivational" />
+ <s:enumeration value="StressReval" />
+ <s:enumeration value="EffectReg" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="confessionLineEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="smokeStatus" type="s1:smokeStatus" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="smokeStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Smoked" />
+ <s:enumeration value="SmokeFree" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="rfqRecordedEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent" />
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="terminateEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent" />
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="logOffEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="smokeStatus" type="s1:smokeStatus" use="required" />
+ <s:attribute name="callInitiator" type="s1:callInitiator" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="callInitiator">
+ <s:restriction base="s:string">
+ <s:enumeration value="AudienceMember" />
+ <s:enumeration value="IVR" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="relapseWakeSmsReplaceEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="relapseCount" type="s:positiveInteger" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="line">
+ <s:restriction base="s:string">
+ <s:enumeration value="LogOnOffLine" />
+ <s:enumeration value="CravingLine" />
+ <s:enumeration value="ConfessionLine" />
+ <s:enumeration value="ReasonsForQuittingLine" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="eventResult">
+ <s:attribute name="success" type="s:boolean" use="required" />
+ </s:complexType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Actions">
+ <s:import namespace="http://testurl/Smoker" />
+ <s:complexType name="updateSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:updateSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractActionResult">
+ <s:attribute name="resultId" type="s:unsignedLong" use="required" />
+ </s:complexType>
+ <s:complexType name="pauseSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:pauseSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="pauseSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:pauseSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:pauseSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="pauseSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Paused" />
+ <s:enumeration value="NotPaused" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="pauseSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="addSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:addSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="addSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:addSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:addSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="addSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Added" />
+ <s:enumeration value="NotAdded" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="addSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="DuplicateID" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="deleteSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:deleteSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="deleteSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:deleteSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:deleteSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="deleteSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Deleted" />
+ <s:enumeration value="NotDeleted" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="deleteSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="activateSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:activateSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="activateSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:activateSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:activateSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="activateSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Activated" />
+ <s:enumeration value="NotActivated" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="activateSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="terminateSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:terminateSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="terminateSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:terminateSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:terminateSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="terminateSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Terminated" />
+ <s:enumeration value="NotTerminated" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="terminateSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="updateSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:updateSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:updateSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="updateSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Updated" />
+ <s:enumeration value="NotUpdated" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="updateSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="pauseSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="audienceMemberID" type="s:unsignedLong" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractAction" abstract="true">
+ <s:attribute name="requestId" type="s:unsignedLong" use="required" />
+ </s:complexType>
+ <s:complexType name="addSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s3:smoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="updateSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s3:smoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="terminateSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="deleteSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="audienceMemberID" type="s:unsignedLong" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="activateSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Smoker">
+ <s:import namespace="http://testurl/AudienceMember" />
+ <s:complexType name="smoker">
+ <s:complexContent mixed="false">
+ <s:extension base="s4:ivrAudienceMember">
+ <s:attribute name="startDate" type="s:date" use="required" />
+ <s:attribute name="phase" type="s3:phase" use="required" />
+ <s:attribute name="day" type="s:positiveInteger" />
+ <s:attribute name="track" type="s3:track" use="required" />
+ <s:attribute name="status" type="s3:status" use="required" />
+ <s:attribute name="baseTime" type="s:string" />
+ <s:attribute name="sunWakeOffset" type="s:string" />
+ <s:attribute name="monWakeOffset" type="s:string" />
+ <s:attribute name="tueWakeOffset" type="s:string" />
+ <s:attribute name="wedWakeOffset" type="s:string" />
+ <s:attribute name="thuWakeOffset" type="s:string" />
+ <s:attribute name="friWakeOffset" type="s:string" />
+ <s:attribute name="satWakeOffset" type="s:string" />
+ <s:attribute name="sunSleepOffset" type="s:string" />
+ <s:attribute name="monSleepOffset" type="s:string" />
+ <s:attribute name="tueSleepOffset" type="s:string" />
+ <s:attribute name="wedSleepOffset" type="s:string" />
+ <s:attribute name="thuSleepOffset" type="s:string" />
+ <s:attribute name="friSleepOffset" type="s:string" />
+ <s:attribute name="satSleepOffset" type="s:string" />
+ <s:attribute name="sunLogOnWindowOffset" type="s:string" />
+ <s:attribute name="monLogOnWindowOffset" type="s:string" />
+ <s:attribute name="tueLogOnWindowOffset" type="s:string" />
+ <s:attribute name="wedLogOnWindowOffset" type="s:string" />
+ <s:attribute name="thuLogOnWindowOffset" type="s:string" />
+ <s:attribute name="friLogOnWindowOffset" type="s:string" />
+ <s:attribute name="satLogOnWindowOffset" type="s:string" />
+ <s:attribute name="sunLogOffWindowOffset" type="s:string" />
+ <s:attribute name="monLogOffWindowOffset" type="s:string" />
+ <s:attribute name="tueLogOffWindowOffset" type="s:string" />
+ <s:attribute name="wedLogOffWindowOffset" type="s:string" />
+ <s:attribute name="thuLogOffWindowOffset" type="s:string" />
+ <s:attribute name="friLogOffWindowOffset" type="s:string" />
+ <s:attribute name="satLogOffWindowOffset" type="s:string" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="phase">
+ <s:restriction base="s:string">
+ <s:enumeration value="Prep" />
+ <s:enumeration value="Quit" />
+ <s:enumeration value="Followup" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="track">
+ <s:restriction base="s:string">
+ <s:enumeration value="NRT" />
+ <s:enumeration value="NonNRT" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="status">
+ <s:restriction base="s:string">
+ <s:enumeration value="Pre-Start" />
+ <s:enumeration value="Completed" />
+ <s:enumeration value="Terminated" />
+ <s:enumeration value="Paused" />
+ <s:enumeration value="Active" />
+ </s:restriction>
+ </s:simpleType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/AudienceMember">
+ <s:import namespace="http://testurl/Smoker" />
+ <s:complexType name="ivrAudienceMember">
+ <s:attribute name="id" type="s:unsignedLong" use="required" />
+ <s:attribute name="mobileNumber" type="s:string" />
+ <s:attribute name="firstName" type="s:string" />
+ <s:attribute name="lastName" type="s:string" />
+ </s:complexType>
+ </s:schema>
+ </types>
+ <message name="PostActionsSoapIn">
+ <part name="ivrActions" element="s0:ivrActions" />
+ </message>
+ <message name="PostActionsSoapOut">
+ <part name="PostActionsResult" element="s0:ivrActionResults" />
+ </message>
+ <message name="PostEventsSoapIn">
+ <part name="ivrEvents" element="s0:ivrEvents" />
+ </message>
+ <message name="PostEventsSoapOut">
+ <part name="PostEventsResult" element="s0:ivrEventResults" />
+ </message>
+ <portType name="IVRServicePortSoap">
+ <operation name="PostActions">
+ <input message="tns:PostActionsSoapIn" />
+ <output message="tns:PostActionsSoapOut" />
+ </operation>
+ <operation name="PostEvents">
+ <input message="tns:PostEventsSoapIn" />
+ <output message="tns:PostEventsSoapOut" />
+ </operation>
+ </portType>
+ <binding name="IVRServicePortSoap" type="tns:IVRServicePortSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="PostActions">
+ <soap:operation soapAction="http://testurl/Service:postActionsIn" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="PostEvents">
+ <soap:operation soapAction="http://testurl/Service:postEventsIn" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <binding name="IVRServicePortSoap12" type="tns:IVRServicePortSoap">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="PostActions">
+ <soap12:operation soapAction="http://testurl/Service:postActionsIn" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="PostEvents">
+ <soap12:operation soapAction="http://testurl/Service:postEventsIn" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <service name="IVRServicePort">
+ <port name="IVRServicePortSoap" binding="tns:IVRServicePortSoap">
+ <soap:address location="test://" />
+ </port>
+ <port name="IVRServicePortSoap12" binding="tns:IVRServicePortSoap12">
+ <soap12:address location="test://" />
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug35273.phpt b/ext/soap/tests/bugs/bug35273.phpt
new file mode 100644
index 0000000..e22ebd7
--- /dev/null
+++ b/ext/soap/tests/bugs/bug35273.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #35273 (Error in mapping soap - java types)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class TestSoapClient extends SoapClient {
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ echo $request;
+ exit;
+ }
+}
+
+ini_set("soap.wsdl_cache_enabled", 0);
+$client = new TestSoapClient(dirname(__FILE__).'/bug32941.wsdl', array("trace" => 1, 'exceptions' => 0));
+$ahoj = $client->echoPerson(array("name"=>"Name","surname"=>"Surname"));
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://service" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:service.EchoService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoPerson><p xsi:type="ns2:Person"><name xsi:type="SOAP-ENC:string">Name</name><surname xsi:type="SOAP-ENC:string">Surname</surname></p></ns1:echoPerson></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug36226-2.phpt b/ext/soap/tests/bugs/bug36226-2.phpt
new file mode 100644
index 0000000..e14832d
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36226-2.phpt
@@ -0,0 +1,123 @@
+--TEST--
+Bug #36226 (Inconsistent handling when passing nillable arrays)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$timestamp = "2005-11-08T11:22:07+03:00";
+$wsdl = dirname(__FILE__)."/bug36226-2.wsdl";
+
+function PostEvents($x) {
+ var_dump($x);
+ exit();
+ return $x;
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('PostEvents');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ echo "$request\n";
+ $this->server->handle($request);
+ return $response;
+ }
+}
+
+$soapClient = new TestSoapClient($wsdl,
+ array(
+ 'trace' => 1,
+ 'exceptions' => 0,
+ 'classmap' => array(
+ 'logOnEvent' => 'LogOnEvent',
+ 'logOffEvent' => 'LogOffEvent',
+ 'events' => 'IVREvents'
+ ),
+ 'features' => SOAP_SINGLE_ELEMENT_ARRAYS
+ ));
+
+$logOnEvent = null;
+//$logOnEvent = array();
+$logOffEvents[] = new LogOffEvent(34567, $timestamp, "Smoked");
+//$logOffEvents[] = new LogOffEvent(34568, $timestamp, "SmokeFree");
+$ivrEvents = new IVREvents("1.0", 101, 12345, 'IVR', $logOnEvent, $logOffEvents);
+$result = $soapClient->PostEvents($ivrEvents);
+
+class LogOffEvent {
+ public $audienceMemberId;
+ public $timestamp;
+ public $smokeStatus;
+ public $callInitiator;
+
+ function __construct($audienceMemberId, $timestamp, $smokeStatus) {
+ $this->audienceMemberId = $audienceMemberId;
+ $this->timestamp = $timestamp;
+ $this->smokeStatus = $smokeStatus;
+ $this->callInitiator = "IVR";
+ }
+}
+
+class LogOnEvent {
+ public $audienceMemberId;
+ public $timestamp;
+
+ function __construct($audienceMemberId, $timestamp) {
+ $this->audienceMemberId = $audienceMemberId;
+ $this->timestamp = $timestamp;
+ }
+}
+
+class IVREvents {
+ public $version;
+ public $activityId;
+ public $messageId;
+ public $source;
+ public $logOnEvent;
+ public $logOffEvent;
+
+ function __construct($version, $activityId, $messageId, $source, $logOnEvent=NULL, $logOffEvent=NULL) {
+ $this->version = $version;
+ $this->activityId = $activityId;
+ $this->messageId = $messageId;
+ $this->source = $source;
+ $this->logOnEvent = $logOnEvent;
+ $this->logOffEvent = $logOffEvent;
+ }
+
+}
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testurl/Message" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns1:ivrEvents version="1.0" activityId="101" messageId="12345" source="IVR"><ns1:logOffEvent audienceMemberId="34567" timestamp="2005-11-08T11:22:07+03:00" smokeStatus="Smoked" callInitiator="IVR"/><ns1:logOnEvent xsi:nil="true"/></ns1:ivrEvents></SOAP-ENV:Body></SOAP-ENV:Envelope>
+
+object(IVREvents)#5 (6) {
+ ["version"]=>
+ string(3) "1.0"
+ ["activityId"]=>
+ int(101)
+ ["messageId"]=>
+ int(12345)
+ ["source"]=>
+ string(3) "IVR"
+ ["logOnEvent"]=>
+ NULL
+ ["logOffEvent"]=>
+ array(1) {
+ [0]=>
+ object(LogOffEvent)#6 (4) {
+ ["audienceMemberId"]=>
+ int(34567)
+ ["timestamp"]=>
+ string(25) "2005-11-08T11:22:07+03:00"
+ ["smokeStatus"]=>
+ string(6) "Smoked"
+ ["callInitiator"]=>
+ string(3) "IVR"
+ }
+ }
+}
diff --git a/ext/soap/tests/bugs/bug36226-2.wsdl b/ext/soap/tests/bugs/bug36226-2.wsdl
new file mode 100755
index 0000000..18c2ce3
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36226-2.wsdl
@@ -0,0 +1,543 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions xmlns:s1="http://testurl/Events" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://testurl/Message" xmlns:s3="http://testurl/Smoker" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:s4="http://testurl/AudienceMember" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://testurl/Actions" xmlns:tns="http://testurl/Service" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://testurl/Service" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Message">
+ <s:import namespace="http://testurl/Events" />
+ <s:import namespace="http://testurl/Actions" />
+ <s:element name="ivrActions" type="s0:actions" />
+ <s:complexType name="actions">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:choice minOccurs="0" maxOccurs="unbounded">
+ <s:element minOccurs="0" maxOccurs="1" name="pauseSmokerAction" type="s2:pauseSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="terminateSmokerAction" type="s2:terminateSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="activateSmokerAction" type="s2:activateSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="addSmokerAction" type="s2:addSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="updateSmokerAction" type="s2:updateSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="deleteSmokerAction" type="s2:deleteSmokerAction" />
+ </s:choice>
+ </s:sequence>
+ <s:attribute default="Client" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractMessage" abstract="true">
+ <s:attribute default="1.0" name="version" type="s:string" />
+ <s:attribute name="activityId" type="s:unsignedLong" use="required" />
+ <s:attribute name="messageId" type="s:unsignedLong" use="required" />
+ </s:complexType>
+ <s:complexType name="events">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:choice minOccurs="0" maxOccurs="unbounded">
+ <s:element minOccurs="0" maxOccurs="1" name="authFailureEvent" type="s1:authFailureEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="logOffEvent" type="s1:logOffEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="cravingLineEvent" type="s1:cravingLineEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="terminateEvent" type="s1:terminateEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="relapseWakeSmsReplaceEvent" type="s1:relapseWakeSmsReplaceEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="confessionLineEvent" type="s1:confessionLineEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="rfqRecordedEvent" type="s1:rfqRecordedEvent" />
+ <s:element nillable="true" minOccurs="0" maxOccurs="1" name="logOnEvent" type="s1:logOnEvent" />
+ </s:choice>
+ </s:sequence>
+ <s:attribute default="IVR" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="ivrMessageSource">
+ <s:restriction base="s:string">
+ <s:enumeration value="IVR" />
+ <s:enumeration value="Client" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="actionResults">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:choice minOccurs="0" maxOccurs="unbounded">
+ <s:element minOccurs="0" maxOccurs="1" name="updateSmokerActionResult" type="s2:updateSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="activateSmokerActionResult" type="s2:activateSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="deleteSmokerActionResult" type="s2:deleteSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="addSmokerActionResult" type="s2:addSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="pauseSmokerActionResult" type="s2:pauseSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="terminateSmokerActionResult" type="s2:terminateSmokerActionResult" />
+ </s:choice>
+ </s:sequence>
+ <s:attribute default="IVR" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="eventResults">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="eventResult" type="s1:eventResult" />
+ </s:sequence>
+ <s:attribute default="IVR" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:element name="ivrActionResults" type="s0:actionResults" />
+ <s:element name="ivrEvents" type="s0:events" />
+ <s:element name="ivrEventResults" type="s0:eventResults" />
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Events">
+ <s:complexType name="authFailureEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="mobileNumber" type="s:string" />
+ <s:attribute name="line" type="s1:line" use="required" />
+ <s:attribute name="reason" type="s:string" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractEvent" abstract="true">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" />
+ <s:attribute name="timestamp" type="s:dateTime" use="required" />
+ </s:complexType>
+ <s:complexType name="logOnEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent" />
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="cravingLineEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="selection" type="s1:cravingLineEventSelection" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="cravingLineEventSelection">
+ <s:attribute name="type" type="s1:cravingLineMessageType" use="required" />
+ <s:attribute name="msgNumber" type="s:positiveInteger" />
+ </s:complexType>
+ <s:simpleType name="cravingLineMessageType">
+ <s:restriction base="s:string">
+ <s:enumeration value="Motivational" />
+ <s:enumeration value="StressReval" />
+ <s:enumeration value="EffectReg" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="confessionLineEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="smokeStatus" type="s1:smokeStatus" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="smokeStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Smoked" />
+ <s:enumeration value="SmokeFree" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="rfqRecordedEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent" />
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="terminateEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent" />
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="logOffEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="smokeStatus" type="s1:smokeStatus" use="required" />
+ <s:attribute name="callInitiator" type="s1:callInitiator" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="callInitiator">
+ <s:restriction base="s:string">
+ <s:enumeration value="AudienceMember" />
+ <s:enumeration value="IVR" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="relapseWakeSmsReplaceEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="relapseCount" type="s:positiveInteger" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="line">
+ <s:restriction base="s:string">
+ <s:enumeration value="LogOnOffLine" />
+ <s:enumeration value="CravingLine" />
+ <s:enumeration value="ConfessionLine" />
+ <s:enumeration value="ReasonsForQuittingLine" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="eventResult">
+ <s:attribute name="success" type="s:boolean" use="required" />
+ </s:complexType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Actions">
+ <s:import namespace="http://testurl/Smoker" />
+ <s:complexType name="updateSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:updateSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractActionResult">
+ <s:attribute name="resultId" type="s:unsignedLong" use="required" />
+ </s:complexType>
+ <s:complexType name="pauseSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:pauseSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="pauseSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:pauseSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:pauseSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="pauseSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Paused" />
+ <s:enumeration value="NotPaused" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="pauseSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="addSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:addSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="addSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:addSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:addSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="addSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Added" />
+ <s:enumeration value="NotAdded" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="addSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="DuplicateID" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="deleteSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:deleteSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="deleteSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:deleteSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:deleteSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="deleteSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Deleted" />
+ <s:enumeration value="NotDeleted" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="deleteSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="activateSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:activateSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="activateSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:activateSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:activateSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="activateSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Activated" />
+ <s:enumeration value="NotActivated" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="activateSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="terminateSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:terminateSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="terminateSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:terminateSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:terminateSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="terminateSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Terminated" />
+ <s:enumeration value="NotTerminated" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="terminateSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="updateSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:updateSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:updateSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="updateSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Updated" />
+ <s:enumeration value="NotUpdated" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="updateSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="pauseSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="audienceMemberID" type="s:unsignedLong" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractAction" abstract="true">
+ <s:attribute name="requestId" type="s:unsignedLong" use="required" />
+ </s:complexType>
+ <s:complexType name="addSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s3:smoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="updateSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s3:smoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="terminateSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="deleteSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="audienceMemberID" type="s:unsignedLong" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="activateSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Smoker">
+ <s:import namespace="http://testurl/AudienceMember" />
+ <s:complexType name="smoker">
+ <s:complexContent mixed="false">
+ <s:extension base="s4:ivrAudienceMember">
+ <s:attribute name="startDate" type="s:date" use="required" />
+ <s:attribute name="phase" type="s3:phase" use="required" />
+ <s:attribute name="day" type="s:positiveInteger" />
+ <s:attribute name="track" type="s3:track" use="required" />
+ <s:attribute name="status" type="s3:status" use="required" />
+ <s:attribute name="baseTime" type="s:string" />
+ <s:attribute name="sunWakeOffset" type="s:string" />
+ <s:attribute name="monWakeOffset" type="s:string" />
+ <s:attribute name="tueWakeOffset" type="s:string" />
+ <s:attribute name="wedWakeOffset" type="s:string" />
+ <s:attribute name="thuWakeOffset" type="s:string" />
+ <s:attribute name="friWakeOffset" type="s:string" />
+ <s:attribute name="satWakeOffset" type="s:string" />
+ <s:attribute name="sunSleepOffset" type="s:string" />
+ <s:attribute name="monSleepOffset" type="s:string" />
+ <s:attribute name="tueSleepOffset" type="s:string" />
+ <s:attribute name="wedSleepOffset" type="s:string" />
+ <s:attribute name="thuSleepOffset" type="s:string" />
+ <s:attribute name="friSleepOffset" type="s:string" />
+ <s:attribute name="satSleepOffset" type="s:string" />
+ <s:attribute name="sunLogOnWindowOffset" type="s:string" />
+ <s:attribute name="monLogOnWindowOffset" type="s:string" />
+ <s:attribute name="tueLogOnWindowOffset" type="s:string" />
+ <s:attribute name="wedLogOnWindowOffset" type="s:string" />
+ <s:attribute name="thuLogOnWindowOffset" type="s:string" />
+ <s:attribute name="friLogOnWindowOffset" type="s:string" />
+ <s:attribute name="satLogOnWindowOffset" type="s:string" />
+ <s:attribute name="sunLogOffWindowOffset" type="s:string" />
+ <s:attribute name="monLogOffWindowOffset" type="s:string" />
+ <s:attribute name="tueLogOffWindowOffset" type="s:string" />
+ <s:attribute name="wedLogOffWindowOffset" type="s:string" />
+ <s:attribute name="thuLogOffWindowOffset" type="s:string" />
+ <s:attribute name="friLogOffWindowOffset" type="s:string" />
+ <s:attribute name="satLogOffWindowOffset" type="s:string" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="phase">
+ <s:restriction base="s:string">
+ <s:enumeration value="Prep" />
+ <s:enumeration value="Quit" />
+ <s:enumeration value="Followup" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="track">
+ <s:restriction base="s:string">
+ <s:enumeration value="NRT" />
+ <s:enumeration value="NonNRT" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="status">
+ <s:restriction base="s:string">
+ <s:enumeration value="Pre-Start" />
+ <s:enumeration value="Completed" />
+ <s:enumeration value="Terminated" />
+ <s:enumeration value="Paused" />
+ <s:enumeration value="Active" />
+ </s:restriction>
+ </s:simpleType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/AudienceMember">
+ <s:import namespace="http://testurl/Smoker" />
+ <s:complexType name="ivrAudienceMember">
+ <s:attribute name="id" type="s:unsignedLong" use="required" />
+ <s:attribute name="mobileNumber" type="s:string" />
+ <s:attribute name="firstName" type="s:string" />
+ <s:attribute name="lastName" type="s:string" />
+ </s:complexType>
+ </s:schema>
+ </types>
+ <message name="PostActionsSoapIn">
+ <part name="ivrActions" element="s0:ivrActions" />
+ </message>
+ <message name="PostActionsSoapOut">
+ <part name="PostActionsResult" element="s0:ivrActionResults" />
+ </message>
+ <message name="PostEventsSoapIn">
+ <part name="ivrEvents" element="s0:ivrEvents" />
+ </message>
+ <message name="PostEventsSoapOut">
+ <part name="PostEventsResult" element="s0:ivrEventResults" />
+ </message>
+ <portType name="IVRServicePortSoap">
+ <operation name="PostActions">
+ <input message="tns:PostActionsSoapIn" />
+ <output message="tns:PostActionsSoapOut" />
+ </operation>
+ <operation name="PostEvents">
+ <input message="tns:PostEventsSoapIn" />
+ <output message="tns:PostEventsSoapOut" />
+ </operation>
+ </portType>
+ <binding name="IVRServicePortSoap" type="tns:IVRServicePortSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="PostActions">
+ <soap:operation soapAction="http://testurl/Service:postActionsIn" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="PostEvents">
+ <soap:operation soapAction="http://testurl/Service:postEventsIn" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <binding name="IVRServicePortSoap12" type="tns:IVRServicePortSoap">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="PostActions">
+ <soap12:operation soapAction="http://testurl/Service:postActionsIn" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="PostEvents">
+ <soap12:operation soapAction="http://testurl/Service:postEventsIn" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <service name="IVRServicePort">
+ <port name="IVRServicePortSoap" binding="tns:IVRServicePortSoap">
+ <soap:address location="test://" />
+ </port>
+ <port name="IVRServicePortSoap12" binding="tns:IVRServicePortSoap12">
+ <soap12:address location="test://" />
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug36226.phpt b/ext/soap/tests/bugs/bug36226.phpt
new file mode 100644
index 0000000..8c01c5b
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36226.phpt
@@ -0,0 +1,139 @@
+--TEST--
+Bug #36226 (SOAP Inconsistent handling when passing potential arrays)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled",0);
+$timestamp = "2005-11-08T11:22:07+03:00";
+$wsdl = dirname(__FILE__)."/bug35142.wsdl";
+
+function PostEvents($x) {
+ var_dump($x);
+ exit();
+ return $x;
+}
+
+class TestSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('PostEvents');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ echo "$request\n";
+ $this->server->handle($request);
+ return $response;
+ }
+
+}
+
+$soapClient = new TestSoapClient($wsdl,
+ array('trace' => 1, 'exceptions' => 0,
+ 'classmap' => array('logOnEvent' => 'LogOnEvent',
+ 'logOffEvent' => 'LogOffEvent',
+ 'events' => 'IVREvents'),
+ 'features' => SOAP_SINGLE_ELEMENT_ARRAYS));
+
+$logOnEvent = new LogOnEvent(34567, $timestamp);
+$logOffEvents[] = new LogOffEvent(34567, $timestamp, "Smoked");
+$logOffEvents[] = new LogOffEvent(34568, $timestamp, "SmokeFree");
+$ivrEvents = new IVREvents("1.0", 101, 12345, 'IVR', $logOnEvent, $logOffEvents);
+
+$result = $soapClient->PostEvents($ivrEvents);
+
+class LogOffEvent {
+ public $audienceMemberId;
+ public $timestamp;
+ public $smokeStatus;
+ public $callInitiator;
+
+ function __construct($audienceMemberId, $timestamp, $smokeStatus) {
+ $this->audienceMemberId = $audienceMemberId;
+ $this->timestamp = $timestamp;
+ $this->smokeStatus = $smokeStatus;
+ $this->callInitiator = "IVR";
+ }
+}
+
+class LogOnEvent {
+ public $audienceMemberId;
+ public $timestamp;
+
+ function __construct($audienceMemberId, $timestamp) {
+ $this->audienceMemberId = $audienceMemberId;
+ $this->timestamp = $timestamp;
+ }
+}
+
+class IVREvents {
+ public $version;
+ public $activityId;
+ public $messageId;
+ public $source;
+ public $logOnEvent;
+ public $logOffEvent;
+
+ function __construct($version, $activityId, $messageId, $source, $logOnEvent=NULL, $logOffEvent=NULL) {
+ $this->version = $version;
+ $this->activityId = $activityId;
+ $this->messageId = $messageId;
+ $this->source = $source;
+ $this->logOnEvent = $logOnEvent;
+ $this->logOffEvent = $logOffEvent;
+ }
+}
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testurl/Message"><SOAP-ENV:Body><ns1:ivrEvents version="1.0" activityId="101" messageId="12345" source="IVR"><ns1:logOffEvent audienceMemberId="34567" timestamp="2005-11-08T11:22:07+03:00" smokeStatus="Smoked" callInitiator="IVR"/><ns1:logOffEvent audienceMemberId="34568" timestamp="2005-11-08T11:22:07+03:00" smokeStatus="SmokeFree" callInitiator="IVR"/><ns1:logOnEvent audienceMemberId="34567" timestamp="2005-11-08T11:22:07+03:00"/></ns1:ivrEvents></SOAP-ENV:Body></SOAP-ENV:Envelope>
+
+object(IVREvents)#%d (6) {
+ ["version"]=>
+ string(3) "1.0"
+ ["activityId"]=>
+ int(101)
+ ["messageId"]=>
+ int(12345)
+ ["source"]=>
+ string(3) "IVR"
+ ["logOnEvent"]=>
+ array(1) {
+ [0]=>
+ object(LogOnEvent)#10 (2) {
+ ["audienceMemberId"]=>
+ int(34567)
+ ["timestamp"]=>
+ string(25) "2005-11-08T11:22:07+03:00"
+ }
+ }
+ ["logOffEvent"]=>
+ array(2) {
+ [0]=>
+ object(LogOffEvent)#%d (4) {
+ ["audienceMemberId"]=>
+ int(34567)
+ ["timestamp"]=>
+ string(25) "2005-11-08T11:22:07+03:00"
+ ["smokeStatus"]=>
+ string(6) "Smoked"
+ ["callInitiator"]=>
+ string(3) "IVR"
+ }
+ [1]=>
+ object(LogOffEvent)#%d (4) {
+ ["audienceMemberId"]=>
+ int(34568)
+ ["timestamp"]=>
+ string(25) "2005-11-08T11:22:07+03:00"
+ ["smokeStatus"]=>
+ string(9) "SmokeFree"
+ ["callInitiator"]=>
+ string(3) "IVR"
+ }
+ }
+}
diff --git a/ext/soap/tests/bugs/bug36575.phpt b/ext/soap/tests/bugs/bug36575.phpt
new file mode 100644
index 0000000..9bf5415
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36575.phpt
@@ -0,0 +1,52 @@
+--TEST--
+Bug #36575 (Incorrect complex type instantiation with hierarchies)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+abstract class CT_A1 {
+ public $var1;
+}
+
+class CT_A2 extends CT_A1 {
+ public $var2;
+}
+
+class CT_A3 extends CT_A2 {
+ public $var3;
+}
+
+// returns A2 in WSDL
+function test( $a1 ) {
+ $a3 = new CT_A3();
+ $a3->var1 = $a1->var1;
+ $a3->var2 = "var two";
+ $a3->var3 = "var three";
+ return $a3;
+}
+
+$classMap = array("A1" => "CT_A1", "A2" => "CT_A2", "A3" => "CT_A3");
+
+$client = new SoapClient(dirname(__FILE__)."/bug36575.wsdl", array("trace" => 1, "exceptions" => 0, "classmap" => $classMap));
+$a2 = new CT_A2();
+$a2->var1 = "one";
+$a2->var2 = "two";
+$client->test($a2);
+
+$soapRequest = $client->__getLastRequest();
+
+echo $soapRequest;
+
+$server = new SoapServer(dirname(__FILE__)."/bug36575.wsdl", array("classmap" => $classMap));
+$server->addFunction("test");
+$server->handle($soapRequest);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:test.soap#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:test.soap.types#" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><a1 xsi:type="ns2:A2"><var1 xsi:type="xsd:string">one</var1><var2 xsi:type="xsd:string">two</var2></a1></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:test.soap#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:test.soap.types#" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><result xsi:type="ns2:A3"><var1 xsi:type="xsd:string">one</var1><var2 xsi:type="xsd:string">var two</var2><var3 xsi:type="xsd:string">var three</var3></result></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/bugs/bug36575.wsdl b/ext/soap/tests/bugs/bug36575.wsdl
new file mode 100755
index 0000000..0f1899b
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36575.wsdl
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions name="shoppingcart"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="urn:test.soap#" targetNamespace="urn:test.soap#"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:types="urn:test.soap.types#">
+ <!-- all datatypes will be imported to namespace types: -->
+ <types>
+ <xs:schema
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="urn:test.soap.types#"
+ targetNamespace="urn:test.soap.types#">
+
+ <xs:complexType name="A1">
+ <xs:all>
+ <xs:element name="var1" type="xs:string" nillable="true"/>
+ </xs:all>
+ </xs:complexType>
+
+ <xs:complexType name="A2">
+ <xs:complexContent>
+ <xs:extension base="tns:A1">
+ <xs:all>
+ <xs:element name="var2" type="xs:string" nillable="true"/>
+ </xs:all>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="A3">
+ <xs:complexContent>
+ <xs:extension base="tns:A2">
+ <xs:all>
+ <xs:element name="var3" type="xs:string" nillable="true"/>
+ </xs:all>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+
+ <message name="test-request">
+ <part name="a1" type="types:A1"/>
+ </message>
+ <message name="test-response">
+ <part name="result" type="types:A2"/>
+ </message>
+
+ <portType name="catalog-porttype">
+ <operation name="test" parameterOrder="a1">
+ <input name="test-request" message="tns:test-request"/>
+ <output name="test-response" message="tns:test-response"/>
+ </operation>
+ </portType>
+
+ <!-- @type doesn't like tns: -->
+ <binding name="catalog-binding" type="tns:catalog-porttype">
+ <soap:binding style="rpc"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <operation name="test">
+ <soap:operation soapAction="urn:test.soap#test"/>
+ <input>
+ <soap:body use="encoded" namespace="urn:test.soap#"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="urn:test.soap#"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="catalog">
+ <!-- @binding doesn't like to be tns: -->
+ <port name="catalog-port" binding="tns:catalog-binding">
+ <soap:address location="xxxxxxxx"/>
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/bugs/bug36614.phpt b/ext/soap/tests/bugs/bug36614.phpt
new file mode 100644
index 0000000..ba67348
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36614.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #36614 (Segfault when using Soap)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$lo_soap = new SoapClient(dirname(__FILE__)."/bug36614.wsdl");
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug36614.wsdl b/ext/soap/tests/bugs/bug36614.wsdl
new file mode 100755
index 0000000..ecf1b1b
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36614.wsdl
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<definitions name="SonicMobile Web-Services"
+ targetNamespace="http://soap.sonicmobile.com/sonicmobile.wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:sonic="http://soap.sonicmobile.com/sonicmobile.wsdl"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2000/10/XMLSchema">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="TransportCount">
+ <all>
+ <element name="transport" type="string" />
+ <element name="count" type="integer" />
+ <element name="rate" type="integer" />
+ <element name="last_message" type="integer" />
+ </all>
+ </complexType>
+ <complexType name="ArrayOfTransportCount">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType" arrayType="TransportCount[]" />
+ </restriction>
+ </complexContent>
+ </complexType>
+ </xsd:schema>
+ </types>
+
+ <message name="userSendMessageRequest">
+ <part name="sourceUser" type="xsd:int"/>
+ <part name="password" type="xsd:string"/>
+ <part name="destinationUser" type="xsd:int"/>
+ <part name="content" type="xsd:string"/>
+ <part name="sendRepliesTo" type="xsd:string"/>
+ <part name="reference" type="xsd:string"/>
+ </message>
+
+ <message name="sendMessageRequest">
+ <part name="application" type="xsd:string"/>
+ <part name="password" type="xsd:string"/>
+ <part name="destination" type="xsd:string"/>
+ <part name="content" type="xsd:string"/>
+ <part name="reference" type="xsd:string"/>
+ <part name="requestSource" type="xsd:string"/>
+ <part name="customer" type="xsd:string"/>
+ <part name="class" type="xsd:string"/>
+ </message>
+
+ <message name="MessageResponse">
+ <part name="messageid" type="xsd:int"/>
+ <part name="response" type="xsd:string"/>
+ </message>
+
+ <message name="messageCountRequest">
+ <part name="password" type="xsd:string"/>
+ </message>
+
+ <message name="messageCountResponse">
+ <part name="transports" type="tns:ArrayOfTransportCount"/>
+ </message>
+
+ <message name="serverStatusRequest">
+ <part name="password" type="xsd:string"/>
+ </message>
+ <message name="serverStatusResponse">
+ <part name="status_string" type="xsd:string"/>
+ </message>
+
+ <message name="flushGatewayRequest">
+ <part name="password" type="xsd:string"/>
+ </message>
+ <message name="flushGatewayResponse">
+ <part name="status_string" type="xsd:string"/>
+ </message>
+
+ <portType name="SonicMobilePortType">
+ <operation name="userSendMessage">
+ <input message="sonic:userSendMessageRequest"/>
+ <output message="sonic:MessageResponse"/>
+ </operation>
+
+ <operation name="sendMessage">
+ <input message="sonic:sendMessageRequest"/>
+ <output message="sonic:MessageResponse"/>
+ </operation>
+
+ <operation name="messageCount">
+ <input message="sonic:messageCountRequest"/>
+ <output message="sonic:messageCountResponse"/>
+ </operation>
+
+ <operation name="serverStatus">
+ <input message="sonic:serverStatusRequest"/>
+ <output message="sonic:serverStatusResponse"/>
+ </operation>
+
+ <operation name="flushGateway">
+ <input message="sonic:flushGatewayRequest"/>
+ <output message="sonic:flushGatewayResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="SonicMobileBinding" type="sonic:SonicMobilePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+
+ <operation name="userSendMessage">
+ <soap:operation soapAction="http://soap.sonicmobile.com/SonicMobile/SOAP#userSendMessage"/>
+
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soap.sonicmobile.com/SonicMobile/SOAP"
+ use="encoded" />
+ </input>
+
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soap.sonicmobile.com/SonicMobile/SOAP"
+ use="encoded" />
+ </output>
+ </operation>
+
+ <operation name="sendMessage">
+ <soap:operation soapAction="http://soap.sonicmobile.com/SonicMobile/SOAP#sendMessage"/>
+
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soap.sonicmobile.com/SonicMobile/SOAP"
+ use="encoded" />
+ </input>
+
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soap.sonicmobile.com/SonicMobile/SOAP"
+ use="encoded" />
+ </output>
+ </operation>
+
+ <operation name="messageCount">
+ <soap:operation soapAction="http://soap.sonicmobile.com/SonicMobile/SOAP#messageCount"/>
+
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soap.sonicmobile.com/SonicMobile/SOAP"
+ use="encoded" />
+ </input>
+
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soap.sonicmobile.com/SonicMobile/SOAP"
+ use="encoded" />
+ </output>
+ </operation>
+
+ <operation name="serverStatus">
+ <soap:operation soapAction="http://soap.sonicmobile.com/SonicMobile/SOAP#serverStatus"/>
+
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soap.sonicmobile.com/SonicMobile/SOAP"
+ use="encoded" />
+ </input>
+
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soap.sonicmobile.com/SonicMobile/SOAP"
+ use="encoded" />
+ </output>
+ </operation>
+
+ <operation name="flushGateway">
+ <soap:operation soapAction="http://soap.sonicmobile.com/SonicMobile/SOAP#flushGateway"/>
+
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soap.sonicmobile.com/SonicMobile/SOAP"
+ use="encoded" />
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soap.sonicmobile.com/SonicMobile/SOAP"
+ use="encoded" />
+ </output>
+ </operation>
+
+ </binding>
+
+ <service name="SonicMobile">
+ <port name="SonicMobilePort" binding="sonic:SonicMobileBinding">
+ <soap:address location="http://soap.sonicmobile.com/"/>
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/bugs/bug36629.phpt b/ext/soap/tests/bugs/bug36629.phpt
new file mode 100644
index 0000000..2096da2
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36629.phpt
@@ -0,0 +1,53 @@
+--TEST--
+Bug #36629 (SoapServer::handle() exits on SOAP faults)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test1() {
+ throw new SoapFault("Server", "test1");
+}
+function test2() {
+ return new SoapFault("Server", "test2");
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction(array("test1","test2"));
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test1 xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+$server->handle($HTTP_RAW_POST_DATA);
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test2 xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>test1</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>test2</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/bugs/bug36908.phpt b/ext/soap/tests/bugs/bug36908.phpt
new file mode 100644
index 0000000..cd0ea8b
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36908.phpt
@@ -0,0 +1,46 @@
+--TEST--
+Bug #36908 (wsdl default value overrides value in soap request)
+--SKIPIF--
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class PublisherService {
+ function add($publisher) {
+ return $publisher->region_id;
+ }
+}
+$input =
+'<?xml version="1.0" encoding="UTF-8"?>
+<soapenv:Envelope
+xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <soapenv:Body>
+ <ns1:add xmlns:ns1="urn:PublisherService" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+ <publisher href="#id0"/>
+ </ns1:add>
+ <multiRef xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:ns3="http://soap.dev/soap/types" id="id0" soapenc:root="0"
+soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+xsi:type="ns3:publisher">
+ <region_id href="#id5"/>
+ </multiRef>
+ <multiRef xmlns:ns5="http://soap.dev/soap/types"
+xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" id="id5"
+soapenc:root="0"
+soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+xsi:type="xsd:long">9</multiRef>
+ </soapenv:Body>
+</soapenv:Envelope>';
+ini_set('soap.wsdl_cache_enabled', false);
+$server = new SoapServer(dirname(__FILE__)."/bug36908.wsdl");
+$server->setClass("PublisherService");
+$server->handle($input);
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:PublisherService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:addResponse><out xsi:type="xsd:string">9</out></ns1:addResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug36908.wsdl b/ext/soap/tests/bugs/bug36908.wsdl
new file mode 100755
index 0000000..f3be3f6
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36908.wsdl
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+xmlns:api="http://soap.dev/soap/PublisherService"
+xmlns:types="http://soap.dev/soap/types"
+targetNamespace="http://soap.dev/soap/PublisherService">
+ <wsdl:types>
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+xmlns:types="http://soap.dev/soap/types"
+targetNamespace="http://soap.dev/soap/types">
+ <xsd:complexType name="publisher">
+ <xsd:all>
+ <xsd:element name="region_id" type="xsd:long" default="52"/>
+ </xsd:all>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="addInput">
+ <wsdl:part name="publisher" type="types:publisher"/>
+ </wsdl:message>
+ <wsdl:message name="addOutput">
+ <wsdl:part name="out" type="xsd:string"/>
+ </wsdl:message>
+ <wsdl:portType name="PublisherServicePortType">
+ <wsdl:operation name="add">
+ <wsdl:input message="api:addInput"/>
+ <wsdl:output message="api:addOutput"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="PublisherServiceBinding" type="api:PublisherServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="add">
+ <soap:operation soapAction="urn:PublisherService#add" style="rpc"/>
+ <wsdl:input>
+ <soap:body use="encoded" namespace="urn:PublisherService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="encoded" namespace="urn:PublisherService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="PublisherService">
+ <wsdl:port name="PublisherServicePort" binding="api:PublisherServiceBinding">
+ <soap:address location="http://soap.dev/soap//publisher_test.php"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug36999.phpt b/ext/soap/tests/bugs/bug36999.phpt
new file mode 100644
index 0000000..9fbb032
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36999.phpt
@@ -0,0 +1,50 @@
+--TEST--
+Bug #36999 (xsd:long values clamped to LONG_MAX instead of using double)
+--SKIPIF--
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+
+function echoLong($num) {
+ return $num;
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl) {
+ parent::__construct($wsdl);
+ $this->server = new SoapServer($wsdl);
+ $this->server->addFunction('echoLong');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$soap = new LocalSoapClient(dirname(__FILE__)."/bug36999.wsdl");
+
+function test($num) {
+ global $soap;
+ try {
+ printf("%s %0.0f\n", gettype($num), $num);
+ $ret = $soap->echoLong($num);
+ printf("%s %0.0f\n", gettype($ret), $ret);
+ } catch (SoapFault $ex) {
+ var_dump($ex);
+ }
+}
+test(3706790240);
+?>
+--EXPECTF--
+%s 3706790240
+%s 3706790240
diff --git a/ext/soap/tests/bugs/bug36999.wsdl b/ext/soap/tests/bugs/bug36999.wsdl
new file mode 100755
index 0000000..80d20b0
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36999.wsdl
@@ -0,0 +1,48 @@
+<?xml version="1.0" ?>
+<definitions
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:si="http://soapinterop.org/xsd"
+ xmlns:tns="http://linuxsrv.home/~dmitry/soap/test.wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl">
+
+ <message name="echoLongRequest">
+ <part name="x" type="xsd:long" />
+ </message>
+
+ <message name="echoLongResponse">
+ <part name="x" type="xsd:long" />
+ </message>
+
+ <portType name="TestServicePortType">
+ <operation name="echoLong">
+ <input message="tns:echoLongRequest" />
+ <output message="tns:echoLongResponse" />
+ </operation>
+ </portType>
+
+ <binding name="TestServiceBinding" type="tns:TestServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="echoLong">
+ <soap:operation style="rpc" />
+ <input>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </input>
+ <output>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="TestService">
+ <port name="TestServicePort" binding="tns:TestServiceBinding">
+ <soap:address location="test://" />
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/bugs/bug37013.phpt b/ext/soap/tests/bugs/bug37013.phpt
new file mode 100644
index 0000000..45f3142
--- /dev/null
+++ b/ext/soap/tests/bugs/bug37013.phpt
@@ -0,0 +1,58 @@
+--TEST--
+Bug #37013 (server hangs when returning circular object references)
+--SKIPIF--
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$request = <<<REQUEST
+<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
+xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+<soapenv:Body>
+<ns2:getThingWithParent
+ soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:ns2="urn:test.soapserver#"/>
+</soapenv:Body>
+
+</soapenv:Envelope>
+REQUEST;
+
+
+class ThingWithParent
+{
+ var $parent;
+ var $id;
+ var $children;
+ function __construct( $id, $parent ) {
+ $this->id = $id;
+ $this->parent = $parent;
+ }
+}
+
+
+class MultiRefTest {
+ public function getThingWithParent() {
+ $p = new ThingWithParent( 1, null );
+ $p2 = new ThingWithParent( 2, $p );
+ $p3 = new ThingWithParent( 3, $p );
+
+ $p->children = array( $p2, $p3 );
+
+ return $p2;
+ }
+}
+
+
+$server = new SoapServer(dirname(__FILE__)."/bug37013.wsdl");
+$server->setClass( "MultiRefTest");
+$server->handle( $request );
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:test.soapserver#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getThingWithParentResponse><result id="ref1" xsi:type="SOAP-ENC:Struct"><parent id="ref2" xsi:type="SOAP-ENC:Struct"><parent xsi:nil="true"/><id xsi:type="xsd:int">1</id><children SOAP-ENC:arrayType="SOAP-ENC:Struct[2]" xsi:type="SOAP-ENC:Array"><item href="#ref1"/><item xsi:type="SOAP-ENC:Struct"><parent href="#ref2"/><id xsi:type="xsd:int">3</id><children xsi:nil="true"/></item></children></parent><id xsi:type="xsd:int">2</id><children xsi:nil="true"/></result></ns1:getThingWithParentResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug37013.wsdl b/ext/soap/tests/bugs/bug37013.wsdl
new file mode 100755
index 0000000..dbd77fd
--- /dev/null
+++ b/ext/soap/tests/bugs/bug37013.wsdl
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions name="shoppingcart"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="urn:test.soapserver#"
+targetNamespace="urn:test.soapserver#"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:types="urn:test.soapserver.types#">
+
+ <!-- all datatypes will be imported to namespace types: -->
+ <types>
+ <xs:schema targetNamespace="urn:test.soapserver.types#">
+ <xs:complexType name="ThingWithParent">
+ <xs:all>
+ <xs:element name="id" type="xs:string"/>
+ <xs:element name="parent" type="types:ThingWithParent"/>
+ <xs:element name="children" type="types:ArrayOfThingWithParent"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ArrayOfThingWithParent">
+ <xs:complexContent>
+ <xs:restriction base="soapenc:Array">
+ <xs:attribute ref="soapenc:arrayType"
+ wsdl:arrayType="tns:ThingWithParent[]"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name="getThingWithParent-request"/>
+ <message name="getThingWithParent-response">
+ <part name="result" element="types:ThingWithParent"/>
+ </message>
+ <portType name="soapserver-porttype">
+ <operation name="getThingWithParent">
+ <input name="getThingWithParent-request" message="tns:getThingWithParent-request"/>
+ <output name="getThingWithParent-response" message="tns:getThingWithParent-response"/>
+ </operation>
+ </portType>
+ <binding name="soapserver-binding" type="tns:soapserver-porttype">
+ <soap:binding style="rpc"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="getThingWithParent">
+ <soap:operation soapAction="urn:test.soapserver.SoapServer#getThingWithParent"/>
+ <input>
+ <soap:body use="encoded"
+namespace="urn:test.soapserver#"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+namespace="urn:test.soapserver#"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="soapserver">
+ <!-- @binding doesn't like to be tns: -->
+ <port name="soapserver-port" binding="tns:soapserver-binding">
+ <soap:address location="xxxxxxxxxxxx"/>
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/bugs/bug37083.phpt b/ext/soap/tests/bugs/bug37083.phpt
new file mode 100644
index 0000000..d915ec0
--- /dev/null
+++ b/ext/soap/tests/bugs/bug37083.phpt
@@ -0,0 +1,58 @@
+--TEST--
+Bug #37083 (Frequent crashs in SOAP extension with new WSDL caching code in multithread WS)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache=3
+--FILE--
+<?php
+class TestSoapClient extends SoapClient {
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ return <<<EOF
+<?xml version="1.0" encoding="utf-8"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<soapenv:Body>
+<ns1:searchResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:java:de.pangaea.metadataportal.search.SearchService">
+<searchReturn href="#id0"/>
+</ns1:searchResponse>
+<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:SearchResponse" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:java:de.pangaea.metadataportal.search.SearchService"><offset xsi:type="xsd:int">0</offset><queryTime xsi:type="xsd:long">34</queryTime><results soapenc:arrayType="ns2:SearchResponseItem[10]" xsi:type="soapenc:Array"><results href="#id1"/><results href="#id2"/><results href="#id3"/><results href="#id4"/><results href="#id5"/><results href="#id6"/><results href="#id7"/><results href="#id8"/><results href="#id9"/><results href="#id10"/></results><totalCount xsi:type="xsd:int">3501</totalCount></multiRef>
+<multiRef id="id9" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:SearchResponseItem" xmlns:ns3="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id11"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:5900168</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml1</xml></multiRef>
+<multiRef id="id7" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:SearchResponseItem" xmlns:ns4="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id12"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:5900039</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml2</xml></multiRef>
+<multiRef id="id6" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:SearchResponseItem" xmlns:ns5="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id13"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:5900040</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml3</xml></multiRef>
+<multiRef id="id10" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns6:SearchResponseItem" xmlns:ns6="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id14"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:41534</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml4</xml></multiRef>
+<multiRef id="id8" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns7:SearchResponseItem" xmlns:ns7="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id15"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:5900038</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml5</xml></multiRef>
+<multiRef id="id4" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns8:SearchResponseItem" xmlns:ns8="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id16"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:2900229</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml6</xml></multiRef>
+<multiRef id="id5" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns9:SearchResponseItem" xmlns:ns9="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id17"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:2900228</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml7</xml></multiRef>
+<multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns10:SearchResponseItem" xmlns:ns10="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id18"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:2900230</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml8</xml></multiRef>
+<multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns11:SearchResponseItem" xmlns:ns11="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id19"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:2900235</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml9</xml></multiRef>
+<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns12:SearchResponseItem" xmlns:ns12="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id20"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:5900196</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml10</xml></multiRef>
+<multiRef id="id15" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns13:Map" xmlns:ns13="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-12-01T04:58:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">105.539</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">112.283</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-30.024</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-34.788</value></value></item></multiRef>
+<multiRef id="id20" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns14:Map" xmlns:ns14="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-06-07T17:41:44.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">129.882</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">133.635</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">39.529</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">36.419</value></value></item></multiRef>
+<multiRef id="id18" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns15:Map" xmlns:ns15="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-03-10T01:40:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">63.121</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">80.92</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">0.158</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-3.675</value></value></item></multiRef>
+<multiRef id="id14" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns16:Map" xmlns:ns16="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2003-01-12T05:15:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-42.88</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-20.85</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">61.41</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">43.2</value></value></item></multiRef>
+<multiRef id="id13" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns17:Map" xmlns:ns17="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-12-01T16:50:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">108.962</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">114.713</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-35.262</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-42.756</value></value></item></multiRef>
+<multiRef id="id17" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns18:Map" xmlns:ns18="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2003-10-10T11:52:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">68.14</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">95.987</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">3.97</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-1.242</value></value></item></multiRef>
+<multiRef id="id16" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns19:Map" xmlns:ns19="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-01-10T10:35:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">67.71</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">77.743</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">3.546</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-1.965</value></value></item></multiRef>
+<multiRef id="id19" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns20:Map" xmlns:ns20="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-04-09T23:00:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">59.116</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">69.206</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-2.274</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-4.093</value></value></item></multiRef>
+<multiRef id="id11" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns21:Map" xmlns:ns21="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2002-11-09T23:10:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">156.013</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">160.042</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">5.648</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">4.773</value></value></item></multiRef>
+<multiRef id="id12" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns22:Map" xmlns:ns22="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-11-01T16:58:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">108.11</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">113.383</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-31.666</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-35.075</value></value></item></multiRef>
+</soapenv:Body></soapenv:Envelope>
+EOF;
+ }
+}
+for ($i = 0; $i < 10; $i++) {
+ $ws=new TestSoapClient(dirname(__FILE__).'/bug37083.wsdl',
+ array('encoding'=>'ISO-8859-1',
+ 'cache_wsdl'=>WSDL_CACHE_BOTH));
+ $search=new stdClass();
+ $search->queryString='argo';
+ $search->ranges[]=$r=new stdClass();
+ $r->field='maxDateTime';
+ $r->min='2003-04-01';
+ $search->index='all';
+ $res=$ws->search($search,0,10);
+}
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug37083.wsdl b/ext/soap/tests/bugs/bug37083.wsdl
new file mode 100755
index 0000000..2a3b379
--- /dev/null
+++ b/ext/soap/tests/bugs/bug37083.wsdl
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:intf="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <schema targetNamespace="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns="http://www.w3.org/2001/XMLSchema">
+ <import namespace="http://xml.apache.org/xml-soap"/>
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="SearchRequestRange">
+ <sequence>
+ <element name="field" nillable="true" type="xsd:string"/>
+ <element name="max" nillable="true" type="xsd:anyType"/>
+ <element name="min" nillable="true" type="xsd:anyType"/>
+ </sequence>
+ </complexType>
+ <complexType name="ArrayOfSearchRequestRange">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="impl:SearchRequestRange[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="SearchRequest">
+ <sequence>
+ <element name="index" nillable="true" type="xsd:string"/>
+ <element name="queryString" nillable="true" type="xsd:string"/>
+ <element name="ranges" nillable="true" type="impl:ArrayOfSearchRequestRange"/>
+ </sequence>
+ </complexType>
+ <complexType name="SearchResponseItem">
+ <sequence>
+ <element name="fields" nillable="true" type="apachesoap:Map"/>
+ <element name="identifier" nillable="true" type="xsd:string"/>
+ <element name="score" type="xsd:float"/>
+ <element name="xml" nillable="true" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ <complexType name="ArrayOfSearchResponseItem">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="impl:SearchResponseItem[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="SearchResponse">
+ <sequence>
+ <element name="offset" type="xsd:int"/>
+ <element name="queryTime" type="xsd:long"/>
+ <element name="results" nillable="true" type="impl:ArrayOfSearchResponseItem"/>
+ <element name="totalCount" type="xsd:int"/>
+ </sequence>
+ </complexType>
+ </schema>
+ <schema targetNamespace="http://xml.apache.org/xml-soap" xmlns="http://www.w3.org/2001/XMLSchema">
+ <import namespace="urn:java:de.pangaea.metadataportal.search.SearchService"/>
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="mapItem">
+ <sequence>
+ <element name="key" nillable="true" type="xsd:anyType"/>
+ <element name="value" nillable="true" type="xsd:anyType"/>
+ </sequence>
+ </complexType>
+ <complexType name="Map">
+ <sequence>
+ <element maxOccurs="unbounded" minOccurs="0" name="item" type="apachesoap:mapItem"/>
+ </sequence>
+ </complexType>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="searchRequest">
+ <wsdl:part name="in0" type="impl:SearchRequest"/>
+ <wsdl:part name="in1" type="xsd:int"/>
+ <wsdl:part name="in2" type="xsd:int"/>
+ </wsdl:message>
+ <wsdl:message name="searchResponse">
+ <wsdl:part name="searchReturn" type="impl:SearchResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="SearchServiceAxisImpl">
+ <wsdl:operation name="search" parameterOrder="in0 in1 in2">
+ <wsdl:input message="impl:searchRequest" name="searchRequest"/>
+ <wsdl:output message="impl:searchResponse" name="searchResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="SearchSoapBinding" type="impl:SearchServiceAxisImpl">
+ <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="search">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="searchRequest">
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:java:de.pangaea.metadataportal.search.SearchService" use="encoded"/>
+ </wsdl:input>
+ <wsdl:output name="searchResponse">
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:java:de.pangaea.metadataportal.search.SearchService" use="encoded"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SearchServiceAxisImplService">
+ <wsdl:port binding="impl:SearchSoapBinding" name="Search">
+ <wsdlsoap:address location="test://"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug37278.phpt b/ext/soap/tests/bugs/bug37278.phpt
new file mode 100644
index 0000000..f3fd7c1
--- /dev/null
+++ b/ext/soap/tests/bugs/bug37278.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #37278 (SOAP not respecting uri in __soapCall)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$options = array(
+ "location" => "test://",
+ "uri" => "http://bricolage.sourceforge.net/Bric/SOAP/Auth",
+ "trace" => 1);
+
+$client = new SoapClient(null, $options);
+
+$newNS = "http://bricolage.sourceforge.net/Bric/SOAP/Story";
+
+try {
+ $client->__soapCall("list_ids", array(), array("uri" => $newNS));
+} catch (Exception $e) {
+ print $client->__getLastRequest();
+}
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://bricolage.sourceforge.net/Bric/SOAP/Story" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:list_ids/></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug38004.phpt b/ext/soap/tests/bugs/bug38004.phpt
new file mode 100644
index 0000000..fea4f03
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38004.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Bug #38004 (Parameters in SoapServer are decoded twice)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+function Test($param) {
+ global $g;
+ $g = $param->strA."\n".$param->strB."\n";
+ return $g;
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl) {
+ parent::__construct($wsdl);
+ $this->server = new SoapServer($wsdl);
+ $this->server->addFunction('Test');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+}
+
+$client = new TestSoapClient(dirname(__FILE__).'/bug38004.wsdl');
+$strA = 'test &amp; test';
+$strB = 'test & test';
+$res = $client->Test(array('strA'=>$strA, 'strB'=>$strB));
+print_r($res);
+print_r($g);
+?>
+--EXPECT--
+test &amp; test
+test & test
+test &amp; test
+test & test
diff --git a/ext/soap/tests/bugs/bug38004.wsdl b/ext/soap/tests/bugs/bug38004.wsdl
new file mode 100755
index 0000000..c288135
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38004.wsdl
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:s="http://www.w3.org/2001/XMLSchema"
+ xmlns:s0="http://test.pl"
+ targetNamespace="http://test.pl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+>
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://test.pl">
+ <s:complexType name="Test">
+ <s:attribute use="required" name="strA" type="s:string"/>
+ <s:attribute use="required" name="strB" type="s:string"/>
+ </s:complexType>
+ <s:element type="s0:Test" name="Test"/>
+ <s:element type="s:string" name="Ret"/>
+ </s:schema>
+ </types>
+
+ <message name="TestSoapIn">
+ <part name="parameters" element="s0:Test"/>
+ </message>
+ <message name="TestSoapOut">
+ <part name="parameters" element="s0:Ret"/>
+ </message>
+ <portType name="TestSoap">
+ <operation name="Test">
+ <input message="s0:TestSoapIn"/>
+ <output message="s0:TestSoapOut"/>
+ </operation>
+ </portType>
+ <binding name="TestSoap" type="s0:TestSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+style="document"/>
+ <operation name="Test">
+ <soap:operation soapAction="http:/Test/Test" style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Test">
+ <port name="TestSoapPort" binding="s0:TestSoap">
+ <soap:address location="http://localhost:8080/~dmitry/bug38004/server.php"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug38005.phpt b/ext/soap/tests/bugs/bug38005.phpt
new file mode 100644
index 0000000..6a4fb25
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38005.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #38005 (SoapFault faultstring doesn't follow encoding rules)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+function Test($param) {
+ return new SoapFault('Test', 'This is our fault: Ä');
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl, $opt) {
+ parent::__construct($wsdl, $opt);
+ $this->server = new SoapServer($wsdl, $opt);
+ $this->server->addFunction('Test');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+}
+
+$client = new TestSoapClient(NULL, array(
+ 'encoding' => 'ISO-8859-1',
+ 'uri' => "test://",
+ 'location' => "test://",
+ 'soap_version'=>SOAP_1_2,
+ 'trace'=>1,
+ 'exceptions'=>0));
+$res = $client->Test();
+echo($res->faultstring."\n");
+echo($client->__getLastResponse());
+?>
+--EXPECT--
+This is our fault: Ä
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>Test</env:Value></env:Code><env:Reason><env:Text>This is our fault: Ä</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/bugs/bug38055.phpt b/ext/soap/tests/bugs/bug38055.phpt
new file mode 100644
index 0000000..82b6c76
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38055.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Bug #38055 (Wrong interpretation of boolean parameters)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+function Test($param) {
+ global $g1, $g2;
+ $g1 = $param->boolA;
+ $g2 = $param->boolB;
+ return 1;
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl) {
+ parent::__construct($wsdl);
+ $this->server = new SoapServer($wsdl);
+ $this->server->addFunction('Test');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+}
+
+$client = new TestSoapClient(dirname(__FILE__).'/bug38055.wsdl');
+$boolA = 1;
+$boolB = '1';
+$res = $client->Test(array('boolA'=>$boolA, 'boolB'=>$boolB));
+var_dump($g1);
+var_dump($g2);
+?>
+--EXPECT--
+bool(true)
+bool(true)
diff --git a/ext/soap/tests/bugs/bug38055.wsdl b/ext/soap/tests/bugs/bug38055.wsdl
new file mode 100755
index 0000000..f893547
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38055.wsdl
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:s="http://www.w3.org/2001/XMLSchema"
+ xmlns:s0="http://test.pl"
+ targetNamespace="http://test.pl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://test.pl">
+ <s:complexType name="Test">
+ <s:attribute use="required" name="boolA" type="s:boolean"/>
+ <s:attribute use="required" name="boolB" type="s:boolean"/>
+ </s:complexType>
+ <s:element type="s0:Test" name="Test"/>
+ <s:element type="s:int" name="Ret"/>
+ </s:schema>
+ </types>
+
+ <message name="TestSoapIn">
+ <part name="parameters" element="s0:Test"/>
+ </message>
+ <message name="TestSoapOut">
+ <part name="parameters" element="s0:Ret"/>
+ </message>
+ <portType name="TestSoap">
+ <operation name="Test">
+ <input message="s0:TestSoapIn"/>
+ <output message="s0:TestSoapOut"/>
+ </operation>
+ </portType>
+ <binding name="TestSoap" type="s0:TestSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="Test">
+ <soap:operation soapAction="http:/Test/Test" style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Test">
+ <port name="TestSoapPort" binding="s0:TestSoap">
+ <soap:address location="http://localhost/server.php"/>
+ </port>
+ </service>
+</definitions> \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug38067.phpt b/ext/soap/tests/bugs/bug38067.phpt
new file mode 100644
index 0000000..c9bf3c1
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38067.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Bug #38067 (Parameters are not decoded from utf-8 when using encoding option)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+function Test($param) {
+ global $g;
+ $g = $param->str;
+ return $g;
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl, $opt) {
+ parent::__construct($wsdl, $opt);
+ $this->server = new SoapServer($wsdl, $opt);
+ $this->server->addFunction('Test');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+}
+
+$client = new TestSoapClient(dirname(__FILE__).'/bug38067.wsdl',
+ array('encoding' => 'ISO-8859-1'));
+$str = 'test: Ä';
+$res = $client->Test(array('str'=>$str));
+echo $str."\n";
+echo $res."\n";
+echo $g."\n";
+?>
+--EXPECT--
+test: Ä
+test: Ä
+test: Ä
diff --git a/ext/soap/tests/bugs/bug38067.wsdl b/ext/soap/tests/bugs/bug38067.wsdl
new file mode 100755
index 0000000..beb9fc2
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38067.wsdl
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:s="http://www.w3.org/2001/XMLSchema"
+ xmlns:s0="http://test.pl"
+ targetNamespace="http://test.pl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://test.pl">
+ <s:complexType name="Test">
+ <s:attribute use="required" name="str" type="s:string"/>
+ </s:complexType>
+ <s:element type="s0:Test" name="Test"/>
+ <s:element type="s:string" name="Ret"/>
+ </s:schema>
+ </types>
+
+ <message name="TestSoapIn">
+ <part name="parameters" element="s0:Test"/>
+ </message>
+ <message name="TestSoapOut">
+ <part name="parameters" element="s0:Ret"/>
+ </message>
+ <portType name="TestSoap">
+ <operation name="Test">
+ <input message="s0:TestSoapIn"/>
+ <output message="s0:TestSoapOut"/>
+ </operation>
+ </portType>
+ <binding name="TestSoap" type="s0:TestSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="Test">
+ <soap:operation soapAction="http:/Test/Test" style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Test">
+ <port name="TestSoapPort" binding="s0:TestSoap">
+ <soap:address location="http://localhost/server.php"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug38536.phpt b/ext/soap/tests/bugs/bug38536.phpt
new file mode 100644
index 0000000..feea46e
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38536.phpt
@@ -0,0 +1,52 @@
+--TEST--
+Bug #38536 (SOAP returns an array of values instead of an object)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class LocalSoapClient extends SoapClient {
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ns1="http://www.grupos.com.br/ws/enturma/client">
+<SOAP-ENV:Body>
+<getClientInfoFromDomainResponse SOAP-ENC:root="1">
+ <xsd:Result xsi:type="ns1:ClientType">
+ <id xsi:type="xsd:int">2</id>
+ <address href="#i2"/>
+ </xsd:Result>
+</getClientInfoFromDomainResponse>
+<xsd:address id="i2" xsi:type="ns1:ClientAddressType" SOAP-ENC:root="0">
+ <idClient xsi:type="xsd:long">2</idClient>
+ <address href="#i3"/>
+</xsd:address>
+<address xsi:type="xsd:string" id="i3" SOAP-ENC:root="0">Test</address>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+ }
+}
+
+ini_set("soap.wsdl_cache_enabled", 0);
+$SOAPObject = new LocalSoapClient(dirname(__FILE__).'/bug38536.wsdl');
+print_r($SOAPObject->test());
+?>
+--EXPECT--
+stdClass Object
+(
+ [id] => 2
+ [address] => stdClass Object
+ (
+ [idClient] => 2
+ [address] => Test
+ )
+
+)
diff --git a/ext/soap/tests/bugs/bug38536.wsdl b/ext/soap/tests/bugs/bug38536.wsdl
new file mode 100755
index 0000000..0ef3fd4
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38536.wsdl
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:enturma="http://www.grupos.com.br/ws/enturmaServices"
+ xmlns:clientTypes="http://www.grupos.com.br/ws/enturma/client"
+ targetNamespace="http://www.grupos.com.br/ws/enturmaServices"
+ elementFormDefault="qualified"
+ attributeFormDefault="qualified">
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
+ targetNamespace="http://www.grupos.com.br/ws/enturma/client">
+ <complexType name="ClientType">
+ <sequence>
+ <element name="id" type="int"/>
+ <element name="address" type="clientTypes:ClientAddressType" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <complexType name="ClientAddressType">
+ <sequence>
+ <element name="idClient" type="int"/>
+ <element name="address" type="string" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ </schema>
+ </types>
+ <message name="testMessage" />
+ <message name="testResponse">
+ <part name="domain" type="clientTypes:ClientType"/>
+ </message>
+
+ <portType name="SessionImpl">
+ <operation name="test">
+ <input message="enturma:testMessage" />
+ <output message="enturma:testResponse" />
+ </operation>
+ </portType>
+ <binding name="SessionBind" type="enturma:SessionImpl">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="test">
+ <soap:operation soapAction="test://"/>
+ <input>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="test://"/>
+ </input>
+ <output>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="test://"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Session">
+ <port name="SessionImpl" binding="enturma:SessionBind">
+ <soap:address location="test://"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug39121.phpt b/ext/soap/tests/bugs/bug39121.phpt
new file mode 100644
index 0000000..caa7f6c
--- /dev/null
+++ b/ext/soap/tests/bugs/bug39121.phpt
@@ -0,0 +1,73 @@
+--TEST--
+Bug #39121 (Incorrect return array handling in non-wsdl soap client)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class LocalSoapClient extends SoapClient {
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+ <soap:Body>
+ <getDIDAreaResponse xmlns="http://didx.org/GetList">
+ <soapenc:Array soapenc:arrayType="xsd:string[2]" xsi:type="soapenc:Array">
+ <item xsi:type="xsd:string">StateCode</item>
+ <item xsi:type="xsd:string">description</item>
+ </soapenc:Array>
+ <soapenc:Array soapenc:arrayType="xsd:anyType[2]" xsi:type="soapenc:Array">
+ <item xsi:type="xsd:int">241</item>
+ <item xsi:type="xsd:string">Carabobo</item>
+ </soapenc:Array>
+ <soapenc:Array soapenc:arrayType="xsd:anyType[2]" xsi:type="soapenc:Array">
+ <item xsi:type="xsd:int">243</item>
+ <item xsi:type="xsd:string">Aragua and Carabobo</item>
+ </soapenc:Array>
+ <soapenc:Array soapenc:arrayType="xsd:anyType[2]" xsi:type="soapenc:Array">
+ <item xsi:type="xsd:int">261</item>
+ <item xsi:type="xsd:string">Zulia</item>
+ </soapenc:Array>
+ </getDIDAreaResponse>
+ </soap:Body>
+</soap:Envelope>
+EOF;
+ }
+}
+
+$client = new LocalSoapClient(NULL, array('location'=>'test://','uri'=>'test://'));
+print_r($client->getDIDAreaResponse());
+?>
+--EXPECT--
+Array
+(
+ [Array] => Array
+ (
+ [0] => Array
+ (
+ [0] => StateCode
+ [1] => description
+ )
+
+ [1] => Array
+ (
+ [0] => 241
+ [1] => Carabobo
+ )
+
+ [2] => Array
+ (
+ [0] => 243
+ [1] => Aragua and Carabobo
+ )
+
+ [3] => Array
+ (
+ [0] => 261
+ [1] => Zulia
+ )
+
+ )
+
+)
diff --git a/ext/soap/tests/bugs/bug39815.phpt b/ext/soap/tests/bugs/bug39815.phpt
new file mode 100644
index 0000000..1adc50a
--- /dev/null
+++ b/ext/soap/tests/bugs/bug39815.phpt
@@ -0,0 +1,50 @@
+--TEST--
+Bug #39815 (to_zval_double() in ext/soap/php_encoding.c is not locale-independent)
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+if (!function_exists('setlocale')) die('skip setlocale() not available');
+if (!@setlocale(LC_ALL, 'sv_SE', 'sv_SE.ISO8859-1')) die('skip sv_SE locale not available');
+if (!@setlocale(LC_ALL, 'en_US', 'en_US.ISO8859-1')) die('skip en_US locale not available');
+?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+function test(){
+ return 123.456;
+}
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('test');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+$x = new LocalSoapClient(NULL,array('location'=>'test://',
+ 'uri'=>'http://testuri.org',
+ "trace"=>1));
+setlocale(LC_ALL,"sv_SE","sv_SE.ISO8859-1");
+var_dump($x->test());
+echo $x->__getLastResponse();
+setlocale(LC_ALL,"en_US","en_US.ISO8859-1");
+var_dump($x->test());
+echo $x->__getLastResponse();
+--EXPECT--
+float(123,456)
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:float">123.456</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+float(123.456)
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:float">123.456</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug39832.phpt b/ext/soap/tests/bugs/bug39832.phpt
new file mode 100644
index 0000000..6abc2f0
--- /dev/null
+++ b/ext/soap/tests/bugs/bug39832.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #39832 (SOAP Server: parameter not matching the WSDL specified type are set to 0)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test.pl"><SOAP-ENV:Body>
+<SOAP-ENV:Test>
+<parameters priority="high">
+<ns1:NetworkErrorCode>1</ns1:NetworkErrorCode>
+</parameters>
+</SOAP-ENV:Test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+
+function Test($x) {
+ return $x->priority;
+}
+
+$x = new SoapServer(dirname(__FILE__)."/bug39832.wsdl");
+$x->addFunction("Test");
+$x->handle($HTTP_RAW_POST_DATA);
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>SOAP-ERROR: Encoding: Violation of encoding rules</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug39832.wsdl b/ext/soap/tests/bugs/bug39832.wsdl
new file mode 100755
index 0000000..a71f581
--- /dev/null
+++ b/ext/soap/tests/bugs/bug39832.wsdl
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:s="http://www.w3.org/2001/XMLSchema"
+ xmlns:s0="http://test.pl"
+ targetNamespace="http://test.pl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://test.pl">
+ <s:complexType name="MessageInfoType">
+ <s:sequence>
+ <s:element name="NetworkErrorCode" type="s:integer" minOccurs="0"/>
+ </s:sequence>
+ <s:attribute name="priority" type="s0:PriorityType"/>
+ </s:complexType>
+ <s:simpleType name="PriorityType">
+ <s:restriction base="s:integer">
+ <s:minInclusive value="0"/>
+ <s:maxInclusive value="3"/>
+ </s:restriction>
+ </s:simpleType>
+ </s:schema>
+ </types>
+
+ <message name="TestSoapIn">
+ <part name="parameters" type="s0:MessageInfoType" />
+ </message>
+ <message name="TestSoapOut">
+ <part name="parameters" type="s:string" />
+ </message>
+ <portType name="TestSoap">
+ <operation name="Test">
+ <input message="s0:TestSoapIn"/>
+ <output message="s0:TestSoapOut"/>
+ </operation>
+ </portType>
+ <binding name="TestSoap" type="s0:TestSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="Test">
+ <soap:operation soapAction="http:/Test/Test" style="rpc"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Test">
+ <port name="TestSoapPort" binding="s0:TestSoap">
+ <soap:address location="http://localhost/server.php"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug40609.phpt b/ext/soap/tests/bugs/bug40609.phpt
new file mode 100644
index 0000000..198afc5
--- /dev/null
+++ b/ext/soap/tests/bugs/bug40609.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #40609 (Segfaults when using more than one SoapVar in a request)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled", 0);
+
+$c = new SoapClient(dirname(__FILE__)."/bug40609.wsdl", array('trace' => 1, 'exceptions' => 0));
+
+$c->update(array('symbol' => new SoapVar("<symbol>MSFT</symbol>", XSD_ANYXML),
+ 'price' => new SoapVar("<price>1000</price>", XSD_ANYXML)));
+echo $c->__getLastRequest();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://quickstart.samples/xsd"><SOAP-ENV:Body><ns1:update><symbol>MSFT</symbol><price>1000</price></ns1:update></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/bugs/bug40609.wsdl b/ext/soap/tests/bugs/bug40609.wsdl
new file mode 100755
index 0000000..0792e90
--- /dev/null
+++ b/ext/soap/tests/bugs/bug40609.wsdl
@@ -0,0 +1,26 @@
+<wsdl:definitions xmlns:axis2="http://quickstart.samples/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns="http://quickstart.samples/xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://quickstart.samples/"><wsdl:documentation>
+ Stock Quote Service
+ </wsdl:documentation><wsdl:types><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://quickstart.samples/xsd">
+<xs:element name="getPrice">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="symbol" nillable="true" type="xs:string" />
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="getPriceResponse">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="return" nillable="true" type="xs:double" />
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="update">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="symbol" nillable="true" type="xs:any" />
+<xs:element name="price" nillable="true" type="xs:any" />
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+</xs:schema></wsdl:types><wsdl:message name="updateMessage"><wsdl:part name="part1" element="ns:update" /></wsdl:message><wsdl:message name="getPriceMessage"><wsdl:part name="part1" element="ns:getPrice" /></wsdl:message><wsdl:message name="getPriceResponseMessage"><wsdl:part name="part1" element="ns:getPriceResponse" /></wsdl:message><wsdl:portType name="StockQuoteServicePortType"><wsdl:operation name="update"><wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:updateMessage" wsaw:Action="urn:update" /></wsdl:operation><wsdl:operation name="getPrice"><wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:getPriceMessage" wsaw:Action="urn:getPrice" /><wsdl:output xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:getPriceResponseMessage" wsaw:Action="http://quickstart.samples/StockQuoteServicePortType/getPriceResponse" /></wsdl:operation></wsdl:portType><wsdl:binding name="StockQuoteServiceSOAP11Binding" type="axis2:StockQuoteServicePortType"><soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /><wsdl:operation name="update"><soap:operation soapAction="urn:update" style="document" /><wsdl:input><soap:body use="literal" /></wsdl:input></wsdl:operation><wsdl:operation name="getPrice"><soap:operation soapAction="urn:getPrice" style="document" /><wsdl:input><soap:body use="literal" /></wsdl:input><wsdl:output><soap:body use="literal" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding name="StockQuoteServiceSOAP12Binding" type="axis2:StockQuoteServicePortType"><soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /><wsdl:operation name="update"><soap12:operation soapAction="urn:update" style="document" /><wsdl:input><soap12:body use="literal" /></wsdl:input></wsdl:operation><wsdl:operation name="getPrice"><soap12:operation soapAction="urn:getPrice" style="document" /><wsdl:input><soap12:body use="literal" /></wsdl:input><wsdl:output><soap12:body use="literal" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding name="StockQuoteServiceHttpBinding" type="axis2:StockQuoteServicePortType"><http:binding verb="POST" /><wsdl:operation name="update"><http:operation location="update" /><wsdl:input><mime:content type="text/xml" /></wsdl:input></wsdl:operation><wsdl:operation name="getPrice"><http:operation location="getPrice" /><wsdl:input><mime:content type="text/xml" /></wsdl:input><wsdl:output><mime:content type="text/xml" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name="StockQuoteService"><wsdl:port name="StockQuoteServiceSOAP11port_http" binding="axis2:StockQuoteServiceSOAP11Binding"><soap:address location="test://" /></wsdl:port><wsdl:port name="StockQuoteServiceSOAP12port_http" binding="axis2:StockQuoteServiceSOAP12Binding"><soap12:address location="test://" /></wsdl:port><wsdl:port name="StockQuoteServiceHttpport1" binding="axis2:StockQuoteServiceHttpBinding"><http:address location="test://" /></wsdl:port></wsdl:service></wsdl:definitions> \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug41004.phpt b/ext/soap/tests/bugs/bug41004.phpt
new file mode 100644
index 0000000..992c6b7
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41004.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Bug #41004 (minOccurs="0" and null class member variable)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ini_set('soap.wsdl_cache_enabled', false);
+
+class EchoBean{
+ public $mandatoryElement;
+ public $optionalElement;
+
+}
+
+class EchoRequest{
+ public $in;
+}
+
+class EchoResponse{
+ public $out;
+}
+
+$wsdl = dirname(__FILE__)."/bug41004.wsdl";
+$classmap = array('EchoBean'=>'EchoBean','echo'=>'EchoRequest','echoResponse'=>'EchoResponse');
+$client = new SoapClient($wsdl, array('location'=>'test://',"classmap" => $classmap, 'exceptions'=>0, 'trace'=>1));
+$echo=new EchoRequest();
+$in=new EchoBean();
+$in->mandatoryElement="REV";
+$in->optionalElement=NULL;
+$echo->in=$in;
+$client->echo($echo);
+echo $client->__getLastRequest();
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Formation"><SOAP-ENV:Body><ns1:echo><in><mandatoryElement>REV</mandatoryElement></in></ns1:echo></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug41004.wsdl b/ext/soap/tests/bugs/bug41004.wsdl
new file mode 100755
index 0000000..d683e5d
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41004.wsdl
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="urn:Formation" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Formation"
+ targetNamespace="urn:Formation">
+ <wsdl:types>
+ <xsd:schema targetNamespace="urn:Formation">
+ <xsd:element name="echo">
+ <xsd:complexType>
+ <xsd:sequence> <xsd:element name="in" type="tns:EchoBean"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="echoResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="tns:EchoBean"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:simpleType name="Product1Type">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="REV"></xsd:enumeration>
+ <xsd:enumeration value="CLA"></xsd:enumeration>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="EchoBean">
+ <xsd:sequence>
+ <xsd:element name="mandatoryElement"
+ type="tns:Product1Type">
+ </xsd:element>
+ <xsd:element name="optionalElement"
+ type="tns:Product1Type" maxOccurs="1" minOccurs="0">
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="echoRequest">
+ <wsdl:part name="parameters" element="tns:echo"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="echoResponse">
+ <wsdl:part name="parameters" element="tns:echoResponse"></wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="Formation">
+ <wsdl:operation name="echo">
+ <wsdl:input message="tns:echoRequest"></wsdl:input>
+ <wsdl:output message="tns:echoResponse"></wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="FormationServiceV1" type="tns:Formation"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="echo">
+ <soap:operation soapAction="urn:Formation/echo" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Formation">
+ <wsdl:port binding="tns:FormationServiceV1"
+ name="FormationSOAP">
+ <soap:address
+ location="http://localhost:8080/webapp/services/FormationServiceV1" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug41097.phpt b/ext/soap/tests/bugs/bug41097.phpt
new file mode 100644
index 0000000..a9cfd14
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41097.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #41097 (ext/soap returning associative array as indexed without using WSDL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test($soap, $array) {
+ $soap->test($array);
+ echo (strpos($soap->__getLastRequest(), ':Map"') != false)?"Map\n":"Array\n";
+}
+
+
+$soap = new SoapClient(null, array('uri' => 'http://uri/', 'location' => 'test://', 'exceptions' => 0, 'trace' => 1));
+test($soap, array('Foo', 'Bar'));
+test($soap, array(5 => 'Foo', 10 => 'Bar'));
+test($soap, array('5' => 'Foo', '10' => 'Bar'));
+$soap->test(new SoapVar(array('Foo', 'Bar'), APACHE_MAP));
+echo (strpos($soap->__getLastRequest(), ':Map"') != false)?"Map\n":"Array\n";
+$soap->test(new SoapVar(array('Foo', 'Bar'), SOAP_ENC_ARRAY));
+echo (strpos($soap->__getLastRequest(), ':Map"') != false)?"Map\n":"Array\n";
+?>
+--EXPECT--
+Array
+Map
+Map
+Map
+Array
diff --git a/ext/soap/tests/bugs/bug41337.phpt b/ext/soap/tests/bugs/bug41337.phpt
new file mode 100644
index 0000000..cd777d1
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41337.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #41337 (WSDL parsing doesn't ignore non soap bindings)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled",0);
+$client = new SoapClient(dirname(__FILE__)."/bug41337.wsdl");
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug41337.wsdl b/ext/soap/tests/bugs/bug41337.wsdl
new file mode 100755
index 0000000..14e5dc4
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41337.wsdl
@@ -0,0 +1,63 @@
+<?xml version="1.0" ?>
+<definitions
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:si="http://soapinterop.org/xsd"
+ xmlns:tns="http://linuxsrv.home/~dmitry/soap/test.wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl">
+
+ <types>
+ <xsd:schema targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl">
+ <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+ <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
+ </xsd:schema>
+ </types>
+
+ <message name="AddRequest">
+ <part name="x" type="xsd:double" />
+ <part name="y" type="xsd:double" />
+ </message>
+ <message name="AddResponse">
+ <part name="result" type="xsd:double" />
+ </message>
+
+ <portType name="TestServicePortType">
+ <operation name="Add">
+ <input message="tns:AddRequest" />
+ <output message="tns:AddResponse" />
+ </operation>
+ </portType>
+
+ <binding name="TestServiceBinding2" type="tns:TestServicePortType">
+ <operation name="Add">
+ <input/>
+ <output/>
+ </operation>
+ </binding>
+
+ <binding name="TestServiceBinding" type="tns:TestServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="Add">
+ <soap:operation soapAction="Add" style="rpc" />
+ <input>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </input>
+ <output>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="TestService">
+ <port name="TestServicePort2" binding="tns:TestServiceBinding"/>
+ <port name="TestServicePort" binding="tns:TestServiceBinding">
+ <soap:address location="http://linuxsrv.home/~dmitry/soap/soap_server.php" />
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/bugs/bug41337_2.phpt b/ext/soap/tests/bugs/bug41337_2.phpt
new file mode 100644
index 0000000..d594d25
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41337_2.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #41337 (WSDL parsing doesn't ignore non soap bindings)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled",0);
+$client = new SoapClient(dirname(__FILE__)."/bug41337_2.wsdl");
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug41337_2.wsdl b/ext/soap/tests/bugs/bug41337_2.wsdl
new file mode 100755
index 0000000..46c078a
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41337_2.wsdl
@@ -0,0 +1,36 @@
+<?xml version="1.0" ?>
+<definitions
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:si="http://soapinterop.org/xsd"
+ xmlns:tns="http://linuxsrv.home/~dmitry/soap/test.wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl">
+
+ <import namespace="http://linuxsrv.home/~dmitry/soap/test.wsdl"
+ location="bug41337_2_1.wsdl" />
+
+ <binding name="TestServiceBinding" type="tns:TestServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="Add">
+ <soap:operation soapAction="Add" style="rpc" />
+ <input>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </input>
+ <output>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="TestService">
+ <port name="TestServicePort" binding="tns:TestServiceBinding">
+ <soap:address location="http://linuxsrv.home/~dmitry/soap/soap_server.php" />
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/bugs/bug41337_2_1.wsdl b/ext/soap/tests/bugs/bug41337_2_1.wsdl
new file mode 100755
index 0000000..857dc6c
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41337_2_1.wsdl
@@ -0,0 +1,47 @@
+<?xml version="1.0" ?>
+<definitions
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:si="http://soapinterop.org/xsd"
+ xmlns:tns="http://linuxsrv.home/~dmitry/soap/test.wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl">
+
+ <types>
+ <xsd:schema targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl">
+ <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+ <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
+ </xsd:schema>
+ </types>
+
+ <message name="AddRequest">
+ <part name="x" type="xsd:double" />
+ <part name="y" type="xsd:double" />
+ </message>
+ <message name="AddResponse">
+ <part name="result" type="xsd:double" />
+ </message>
+
+ <portType name="TestServicePortType">
+ <operation name="Add">
+ <input message="tns:AddRequest" />
+ <output message="tns:AddResponse" />
+ </operation>
+ </portType>
+
+ <binding name="TestServiceBinding2" type="tns:TestServicePortType">
+ <operation name="Add">
+ <input/>
+ <output/>
+ </operation>
+ </binding>
+
+ <service name="TestService2">
+ <port name="TestServicePort2" binding="tns:TestServiceBinding"/>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/bugs/bug41477.phpt b/ext/soap/tests/bugs/bug41477.phpt
new file mode 100644
index 0000000..a103e69
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41477.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #41477 (no arginfo about SoapClient::__soapCall())
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$objRfClass = new ReflectionClass('SoapClient');
+$objRfMethod = $objRfClass->getMethod('__soapCall');
+$arrParams = $objRfMethod->getParameters();
+foreach($arrParams as $objRfParam)
+{
+ var_dump($objRfParam->getName());
+}
+?>
+--EXPECT--
+string(13) "function_name"
+string(9) "arguments"
+string(7) "options"
+string(13) "input_headers"
+string(14) "output_headers"
diff --git a/ext/soap/tests/bugs/bug41566.phpt b/ext/soap/tests/bugs/bug41566.phpt
new file mode 100644
index 0000000..03ecdde
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41566.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Bug #41566 (SOAP Server not properly generating href attributes)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test() {
+ $aUser = new User();
+ $aUser->sName = 'newUser';
+
+ $aUsers = Array();
+ $aUsers[] = $aUser;
+ $aUsers[] = $aUser;
+ $aUsers[] = $aUser;
+ $aUsers[] = $aUser;
+ return $aUsers;
+}
+
+/* Simple User definition */
+Class User {
+ /** @var string */
+ public $sName;
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org", 'soap_version'=>SOAP_1_2));
+$server->addfunction("test");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+ob_start();
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:ns1="http://testuri.org"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <env:Body>
+ <ns1:test env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </env:Body>
+</env:Envelope>
+EOF;
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+ob_flush();
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return SOAP-ENC:arrayType="SOAP-ENC:Struct[4]" xsi:type="SOAP-ENC:Array"><item xsi:type="SOAP-ENC:Struct" id="ref1"><sName xsi:type="xsd:string">newUser</sName></item><item href="#ref1"/><item href="#ref1"/><item href="#ref1"/></return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://testuri.org" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:testResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="enc:Struct" enc:arraySize="4" xsi:type="enc:Array"><item xsi:type="enc:Struct" enc:id="ref1"><sName xsi:type="xsd:string">newUser</sName></item><item enc:ref="#ref1"/><item enc:ref="#ref1"/><item enc:ref="#ref1"/></return></ns1:testResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/bugs/bug42086.phpt b/ext/soap/tests/bugs/bug42086.phpt
new file mode 100644
index 0000000..6edc06f
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42086.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Bug #42086 (SoapServer return Procedure '' not present for WSIBasic compliant wsdl)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$request = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><firstFunctionWithoutParam/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+
+class firstFunctionWithoutParamResponse {
+ public $param;
+}
+
+function firstFunctionWithoutParam() {
+ $ret = new firstFunctionWithoutParamResponse();
+ $ret->param = "firstFunctionWithoutParam";
+ return $ret;
+}
+
+$server = new SoapServer(dirname(__FILE__).'/bug42086.wsdl',
+ array('features'=>SOAP_SINGLE_ELEMENT_ARRAYS));
+$server->addFunction('firstFunctionWithoutParam');
+$server->handle($request);
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><firstFunctionWithoutParamReturn><param>firstFunctionWithoutParam</param></firstFunctionWithoutParamReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug42086.wsdl b/ext/soap/tests/bugs/bug42086.wsdl
new file mode 100755
index 0000000..5ec3d95
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42086.wsdl
@@ -0,0 +1,141 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!-- WSDL file generated by Zend Studio. -->
+
+<definitions name="LBAService" targetNamespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" xmlns:typens="http://xml.avaya.com/ws/device-management/distributed-enterprise" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xml.avaya.com/ws/device-management/distributed-enterprise">
+ <xsd:complexType name="firstFunctionClassParam">
+ <xsd:all>
+ <xsd:element name="param" type="xsd:string"/>
+ <xsd:element name="vectparam" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="firstFunctionClassParamResponse">
+ <xsd:all>
+ <xsd:element name="param" type="xsd:string"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="firstFunctionWithoutParamResponse">
+ <xsd:all>
+ <xsd:element name="param" type="xsd:string"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="secondFunctionClassParam">
+ <xsd:all>
+ <xsd:element name="param" type="xsd:string"/>
+ <xsd:element name="vectparam" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="secondFunctionClassParamResponse">
+ <xsd:all>
+ <xsd:element name="param" type="xsd:string"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="secondFunctionWithoutParamResponse">
+ <xsd:all>
+ <xsd:element name="param" type="xsd:string"/>
+ </xsd:all>
+ </xsd:complexType>
+ </xsd:schema>
+ </types>
+ <message name="firstFunctionClassParam">
+ <part name="firstFunctionClassParam" type="typens:firstFunctionClassParam"/>
+ </message>
+ <message name="firstFunctionClassParamResponse">
+ <part name="firstFunctionClassParamReturn" type="typens:firstFunctionClassParamResponse"/>
+ </message>
+ <message name="firstFunctionWithoutParam"/>
+<!--
+ <message name="firstFunctionWithoutParam">
+ <part name="firstFunctionWithoutParam"/>
+ </message>
+-->
+ <message name="firstFunctionWithoutParamResponse">
+ <part name="firstFunctionWithoutParamReturn" type="typens:firstFunctionWithoutParamResponse"/>
+ </message>
+ <message name="secondFunctionClassParam">
+ <part name="secondFunctionClassParam" type="typens:secondFunctionClassParam"/>
+ </message>
+ <message name="secondFunctionClassParamResponse">
+ <part name="secondFunctionClassParamReturn" type="typens:secondFunctionClassParamResponse"/>
+ </message>
+ <message name="secondFunctionWithoutParam"/>
+ <message name="secondFunctionWithoutParamResponse">
+ <part name="secondFunctionWithoutParamReturn" type="typens:secondFunctionWithoutParamResponse"/>
+ </message>
+ <portType name="wsImpPortType">
+ <operation name="firstFunctionClassParam">
+ <documentation>
+ Enter description here...
+ </documentation>
+ <input message="typens:firstFunctionClassParam"/>
+ <output message="typens:firstFunctionClassParamResponse"/>
+ </operation>
+ <operation name="firstFunctionWithoutParam">
+ <documentation>
+ Enter description here...
+ </documentation>
+ <input message="typens:firstFunctionWithoutParam"/>
+ <output message="typens:firstFunctionWithoutParamResponse"/>
+ </operation>
+ <operation name="secondFunctionClassParam">
+ <documentation>
+ Enter description here...
+ </documentation>
+ <input message="typens:secondFunctionClassParam"/>
+ <output message="typens:secondFunctionClassParamResponse"/>
+ </operation>
+ <operation name="secondFunctionWithoutParam">
+ <documentation>
+ Enter description here...
+ </documentation>
+ <input message="typens:secondFunctionWithoutParam"/>
+ <output message="typens:secondFunctionWithoutParamResponse"/>
+ </operation>
+ </portType>
+ <binding name="wsImpBinding" type="typens:wsImpPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="firstFunctionClassParam">
+ <soap:operation soapAction="urn:wsImpAction"/>
+ <input>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </input>
+ <output>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </output>
+ </operation>
+ <operation name="firstFunctionWithoutParam">
+ <soap:operation soapAction="urn:wsImpAction"/>
+ <input>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </input>
+ <output>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </output>
+ </operation>
+ <operation name="secondFunctionClassParam">
+ <soap:operation soapAction="urn:wsImpAction"/>
+ <input>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </input>
+ <output>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </output>
+ </operation>
+ <operation name="secondFunctionWithoutParam">
+ <soap:operation soapAction="urn:wsImpAction"/>
+ <input>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </input>
+ <output>
+ <soap:body namespace="http://xml.avaya.com/ws/device-management/distributed-enterprise" use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="LBAService">
+ <port name="wsImpPort" binding="typens:wsImpBinding">
+ <soap:address location="test://"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug42151.phpt b/ext/soap/tests/bugs/bug42151.phpt
new file mode 100644
index 0000000..ee53e6d
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42151.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Bug #42151 (__destruct functions not called after catching a SoapFault exception)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class foo {
+ function __construct(){
+ $foo = @ new SoapClient('httpx://');
+ }
+ function __destruct(){
+ echo 'I never get executed.' . "\n";
+ }
+}
+class bar {
+ function __destruct(){
+ echo 'I don\'t get executed either.' . "\n";
+ }
+}
+try {
+ $bar = new bar();
+ $foo = new foo();
+} catch (Exception $e){
+ echo $e->getMessage() . "\n";
+}
+echo "ok\n";
+?>
+--EXPECT--
+SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' : failed to load external entity "httpx://"
+
+ok
+I don't get executed either.
diff --git a/ext/soap/tests/bugs/bug42183.phpt b/ext/soap/tests/bugs/bug42183.phpt
new file mode 100644
index 0000000..d34311f
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42183.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #42183 (classmap cause crash in non-wsdl mode )
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class PHPObject {
+}
+
+$req = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ws.sit.com" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+
+function test() {
+ return new PHPObject();
+}
+
+$server = new SoapServer(NULL, array('uri' => 'http://ws.sit.com',
+ 'classmap' => array('Object' => 'PHPObject')));
+$server->addFunction("test");
+ob_start();
+$server->handle($req);
+ob_end_clean();
+echo "ok\n";
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug42214.phpt b/ext/soap/tests/bugs/bug42214.phpt
new file mode 100644
index 0000000..a31f16d
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42214.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #42214 (SoapServer sends clients internal PHP errors)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$request = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://localhost/server.php" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+
+function test() {
+ $a = $b;
+ obvious_error(); // will cause an error
+}
+
+$server = new SoapServer(NULL, array('uri' =>'http://localhost/server.php',
+ 'send_errors'=>0));
+$server->addFunction('test');
+$server->handle($request);
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Internal Error</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug42326.phpt b/ext/soap/tests/bugs/bug42326.phpt
new file mode 100644
index 0000000..2e6c7c3
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42326.phpt
@@ -0,0 +1,49 @@
+--TEST--
+Bug #42326 (SoapServer crash)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$request = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.com/"><SOAP-ENV:Body><ns1:GetProductsRequest><time></time></ns1:GetProductsRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+
+
+$soap_admin_classmap = array('productDetailsType' => 'SOAP_productDetailsType',
+ 'GetProductsRequest' => 'SOAP_GetProductsRequest',
+ 'GetProductsResponse' => 'SOAP_GetProductsResponse');
+
+class SOAP_productDetailsType {
+ public $id = 0;
+}
+
+class SOAP_GetProductsRequest {
+ public $time = '';
+}
+
+class SOAP_GetProductsResponse {
+ public $products;
+ function __construct(){
+ $this->products = new SOAP_productDetailsType();
+
+ }
+}
+
+class SOAP_Admin {
+ public function GetProducts($time){
+ return new SOAP_GetProductsResponse();
+ }
+}
+
+$soap = new SoapServer(dirname(__FILE__).'/bug42326.wsdl', array('classmap' => $soap_admin_classmap));
+$soap->setClass('SOAP_Admin');
+ob_start();
+$soap->handle($request);
+ob_end_clean();
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug42326.wsdl b/ext/soap/tests/bugs/bug42326.wsdl
new file mode 100755
index 0000000..a125ed8
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42326.wsdl
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+<wsdl:definitions name="OSCAdmin.wsdl"
+targetNamespace="http://www.example.com/"
+xmlns:tns="http://www.example.com/"
+xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <wsdl:types>
+
+ <xsd:schema targetNamespace="http://www.example.com/"
+ xmlns="http://www.w3.org/2000/10/XMLSchema">
+ <xsd:element name="productDetailsType">
+ <xsd:complexType>
+ <xsd:all>
+ <xsd:element name="id" type="xsd:integer"/>
+
+ </xsd:all>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+
+
+ <xsd:schema targetNamespace="http://www.example.com/"
+ xmlns="http://www.w3.org/2000/10/XMLSchema">
+ <xsd:element name="GetProductsRequest">
+ <xsd:complexType>
+ <xsd:all>
+ <xsd:element name="time" type="xsd:string"/>
+ </xsd:all>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+
+ <xsd:schema targetNamespace="http://www.example.com/"
+ xmlns="http://www.w3.org/2000/10/XMLSchema">
+ <xsd:element name="GetProductsResponse">
+ <xsd:complexType>
+ <xsd:all>
+ <xsd:element name="products" type="tns:productDetailsType"/>
+ </xsd:all>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+
+
+ </wsdl:types>
+
+ <wsdl:message name="GetProductsRequest">
+ <wsdl:part name="in" element="tns:GetProductsRequest"/>
+ </wsdl:message>
+
+ <wsdl:message name="GetProductsResponse">
+ <wsdl:part name="out" element="tns:GetProductsResponse"/>
+ </wsdl:message>
+
+ <wsdl:portType name="OSCAdminPortType">
+ <wsdl:operation name="GetProducts">
+ <wsdl:input message="tns:GetProductsRequest"/>
+ <wsdl:output message="tns:GetProductsResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="OSCAdminSoapBinding" type="tns:OSCAdminPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="GetProducts">
+ <soap:operation soapAction=""/>
+ <wsdl:input name="in">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="out">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="OSCAdminService">
+ <wsdl:port name="OSCAdminPort" binding="tns:OSCAdminSoapBinding">
+ <soap:address location="test://"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions> \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug42359.phpt b/ext/soap/tests/bugs/bug42359.phpt
new file mode 100644
index 0000000..94738ff
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42359.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #42326 (SoapServer crash)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$soap = new SoapClient(dirname(__FILE__)."/bug42359.wsdl");
+print_r($soap->__getTypes());
+?>
+--EXPECT--
+Array
+(
+ [0] => list listItem {anonymous1}
+ [1] => string anonymous1
+ [2] => string enumItem
+ [3] => list listItem2 {enumItem}
+)
+
diff --git a/ext/soap/tests/bugs/bug42359.wsdl b/ext/soap/tests/bugs/bug42359.wsdl
new file mode 100755
index 0000000..bc73ada
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42359.wsdl
@@ -0,0 +1,58 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<definitions name="listTest" targetNamespace="urn:listTest" xmlns:typens="urn:listTest" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:listTest">
+ <xsd:simpleType name="listItem">
+ <xsd:list>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="test1" />
+ <xsd:enumeration value="test2" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:list>
+ </xsd:simpleType>
+ <xsd:simpleType name="enumItem">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="test1" />
+ <xsd:enumeration value="test2" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:simpleType name="listItem2">
+ <xsd:list itemType="typens:enumItem"/>
+ </xsd:simpleType>
+ </xsd:schema>
+ </types>
+ <message name="testRequest">
+ <part name="item" type="typens:listItem"/>
+ </message>
+ <message name="testRequestResponse">
+ <part name="testRequestReturn" type="xsd:integer"/>
+ </message>
+ <portType name="listTestPortType">
+ <operation name="testRequest">
+ <documentation>
+ Test request
+ </documentation>
+ <input message="typens:testRequest"/>
+ <output message="typens:testRequestResponse"/>
+ </operation>
+ </portType>
+ <binding name="listTestBinding" type="typens:listTestPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="testRequest">
+ <soap:operation soapAction="urn:listTestAction"/>
+ <input>
+ <soap:body namespace="urn:listTest" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body namespace="urn:listTest" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="listTestService">
+ <port name="listTestPort" binding="typens:listTestBinding">
+ <soap:address location="http://test/service"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug42488.phpt b/ext/soap/tests/bugs/bug42488.phpt
new file mode 100644
index 0000000..4069c9f
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42488.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #42488 (SoapServer reports an encoding error and the error itself breaks)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$request = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test:\" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getBadUTF/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+$soap = new SoapServer(NULL, array('uri'=>'test://'));
+function getBadUTF(){
+ return "stuff\x93thing";
+}
+$soap->addFunction('getBadUTF');
+$soap->handle($request);
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>SOAP-ERROR: Encoding: string 'stuff\x93...' is not a valid utf-8 string</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope> \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug42692.phpt b/ext/soap/tests/bugs/bug42692.phpt
new file mode 100644
index 0000000..1436f88
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42692.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Bug #42692 (Procedure 'int1' not present with doc/lit SoapServer)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ini_set('soap.wsdl_cache_enabled','0');
+
+function checkAuth($peid,$auth) {
+ return $peid;
+}
+
+class TestSoap extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction("checkAuth");
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+}
+
+$client = new TestSoap(dirname(__FILE__) . "/bug42692.wsdl", array("trace"=>1));
+try {
+ $result = $client->checkAuth(1,"two");
+ echo "Auth for 1 is $result\n";
+} catch (Exception $e) {
+ echo $e->getMessage();
+}
+?>
+--EXPECT--
+Auth for 1 is 1
diff --git a/ext/soap/tests/bugs/bug42692.wsdl b/ext/soap/tests/bugs/bug42692.wsdl
new file mode 100755
index 0000000..c8928e3
--- /dev/null
+++ b/ext/soap/tests/bugs/bug42692.wsdl
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="netDB"
+ targetNamespace="urn:netDB"
+ xmlns:typens="urn:netDB"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <message name="checkAuthIN">
+ <part name="peid" type="xsd:integer" />
+ <part name="auth" type="xsd:string" />
+ </message>
+ <message name="checkAuthOUT">
+ <part name="peidx" type="xsd:integer" />
+ </message>
+ <portType name="netDB">
+ <operation name="checkAuth">
+ <input message="typens:checkAuthIN" />
+ <output message="typens:checkAuthOUT" />
+ </operation>
+ </portType>
+ <binding name="netDB" type="typens:netDB">
+ <soap:binding type="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="checkAuth">
+ <soap:operation soapAction="urn:checkAuth" />
+ <input>
+ <soap:body use="encoded" namespace="urn:netDB" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="urn:netDB" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </output>
+ </operation>
+ </binding>
+ <service name="netDB">
+ <port name="netDBPort" binding="typens:netDB">
+ <soap:address location="http://netdb.alphawest.com.au/xml/soap/server.php"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug43045.phpt b/ext/soap/tests/bugs/bug43045.phpt
new file mode 100644
index 0000000..a32acfe
--- /dev/null
+++ b/ext/soap/tests/bugs/bug43045.phpt
@@ -0,0 +1,52 @@
+--TEST--
+Bug #43045i (SOAP encoding violation on "INF" for type double/float)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test($x) {
+ return $x;
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('test');
+ }
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+
+ echo $request;
+ return '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+<soap:Body><testResponse xmlns="urn:TestSOAP">
+<s-gensym3>
+<doubleInfinity xsi:type="xsd:double">INF</doubleInfinity>
+</s-gensym3>
+</testResponse>
+</soap:Body></soap:Envelope>';
+ }
+}
+$client = new TestSoapClient(NULL, array(
+ "location" => "test://",
+ "uri" => 'urn:TestSOAP',
+ "style" => SOAP_RPC,
+ "use" => SOAP_ENCODED
+ ));
+var_dump($client->test(0.1));
+var_dump($client->test(NAN));
+var_dump($response = $client->test(INF));
+var_dump($response = $client->test(-INF));
+--EXPECT--
+float(0.1)
+float(NAN)
+float(INF)
+float(-INF)
diff --git a/ext/soap/tests/bugs/bug44686.phpt b/ext/soap/tests/bugs/bug44686.phpt
new file mode 100644
index 0000000..cff9799
--- /dev/null
+++ b/ext/soap/tests/bugs/bug44686.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #44686 (SOAP-ERROR: Parsing WSDL with references)
+--SKIPIF--
+<?php require_once 'skipif.inc'; ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+new SoapClient(dirname(__FILE__) . "/bug44686.wsdl");
+echo "ok\n";
+?>
+--EXPECT--
+ok
+
diff --git a/ext/soap/tests/bugs/bug44686.wsdl b/ext/soap/tests/bugs/bug44686.wsdl
new file mode 100644
index 0000000..87b4640
--- /dev/null
+++ b/ext/soap/tests/bugs/bug44686.wsdl
@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.gomeznetworks.com/webservices/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://www.gomeznetworks.com/webservices/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://www.gomeznetworks.com/webservices/">
+ <s:element name="ProvisionMonitors">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" ref="ProvisioningOrder" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="ProvisionMonitorsResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" ref="ProvisioningOrderResponse" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:schema>
+ <s:schema elementFormDefault="qualified">
+ <s:element name="ProvisioningOrder" type="ProvisioningOrder" />
+ <s:complexType name="ProvisioningOrder">
+ <s:complexContent mixed="false">
+ <s:extension base="CServiceObject">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="MonitorOrders" type="ArrayOfMonitorOrder" />
+ <s:element minOccurs="0" maxOccurs="1" name="MonitorSites" type="ArrayOfMonitorSiteOrder" />
+ <s:element minOccurs="0" maxOccurs="1" name="ReportOrders" type="ArrayOfReportOrder" />
+ <s:element minOccurs="0" maxOccurs="1" name="MonitorAttributes" type="ArrayOfMonitorAttribute" />
+ </s:sequence>
+ <s:attribute name="name" type="s:string" />
+ <s:attribute name="expirationDate" type="s:dateTime" use="required" />
+ <s:attribute name="autoDelete" type="s:boolean" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="CServiceObject" abstract="true" />
+ <s:complexType name="ArrayOfMonitorOrder">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="MonitorOrder" nillable="true" type="MonitorOrder" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="MonitorOrder">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="MonitorSites" type="ArrayOfMonitorSiteOrder" />
+ <s:element minOccurs="0" maxOccurs="1" name="MonitorAttributes" type="ArrayOfMonitorAttribute" />
+ </s:sequence>
+ <s:attribute name="name" type="s:string" />
+ <s:attribute name="url" type="s:string" />
+ <s:attribute name="frequencyInMins" type="s:int" use="required" />
+ <s:attribute name="targetClass" type="MonitorTargetClass" use="required" />
+ <s:attribute name="fileSizeOverrideInKB" type="s:int" use="required" />
+ </s:complexType>
+ <s:complexType name="ArrayOfMonitorSiteOrder">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="MonitorSite" nillable="true" type="MonitorSiteOrder" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="MonitorSiteOrder">
+ <s:attribute name="siteId" type="s:int" use="required" />
+ </s:complexType>
+ <s:complexType name="ArrayOfMonitorAttribute">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="MonitorAttribute" nillable="true" type="MonitorAttribute" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="MonitorAttribute">
+ <s:attribute name="name" type="s:string" />
+ <s:attribute name="value" type="s:string" />
+ </s:complexType>
+ <s:simpleType name="MonitorTargetClass">
+ <s:restriction base="s:string">
+ <s:enumeration value="eTransaction" />
+ <s:enumeration value="eSingleURL" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="ArrayOfReportOrder">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="ReportOrder" nillable="true" type="ReportOrder" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="ReportOrder">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="EmailTargets" type="ArrayOfEmailTarget" />
+ </s:sequence>
+ <s:attribute name="name" type="s:string" />
+ <s:attribute name="reportFormatType" type="ReportFormatType" use="required" />
+ <s:attribute name="reportDeliveryType" type="ReportDeliveryType" use="required" />
+ <s:attribute name="reportDelayInMins" type="s:int" use="required" />
+ </s:complexType>
+ <s:complexType name="ArrayOfEmailTarget">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="EmailTarget" nillable="true" type="EmailTarget" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="EmailTarget">
+ <s:attribute name="address" type="s:string" />
+ </s:complexType>
+ <s:simpleType name="ReportFormatType">
+ <s:restriction base="s:string">
+ <s:enumeration value="eBarChartTestByNode" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="ReportDeliveryType">
+ <s:restriction base="s:string">
+ <s:enumeration value="eHTML" />
+ </s:restriction>
+ </s:simpleType>
+ <s:element name="ProvisioningOrderResponse" type="ProvisioningOrderResponse" />
+ <s:complexType name="ProvisioningOrderResponse">
+ <s:complexContent mixed="false">
+ <s:extension base="CommonServiceResponse">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="MonitorOrderResponses" type="ArrayOfMonitorOrderResponse" />
+ <s:element minOccurs="0" maxOccurs="1" name="ReportOrderResponses" type="ArrayOfReportOrderResponse" />
+ </s:sequence>
+ <s:attribute name="name" type="s:string" />
+ <s:attribute name="groupId" type="s:int" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="CommonServiceResponse">
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="status" type="StatusType" />
+ <s:element minOccurs="0" maxOccurs="1" name="errorMessage" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ <s:simpleType name="StatusType">
+ <s:restriction base="s:string">
+ <s:enumeration value="SUCCESS" />
+ <s:enumeration value="FAILED" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="ReportOrderResponse">
+ <s:complexContent mixed="false">
+ <s:extension base="CommonServiceResponse">
+ <s:attribute name="name" type="s:string" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="MonitorOrderResponse">
+ <s:complexContent mixed="false">
+ <s:extension base="CommonServiceResponse">
+ <s:attribute name="monitorId" type="s:int" use="required" />
+ <s:attribute name="name" type="s:string" />
+ <s:attribute name="url" type="s:string" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="ArrayOfMonitorOrderResponse">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="MonitorOrderResponse" nillable="true" type="MonitorOrderResponse" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="ArrayOfReportOrderResponse">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="ReportOrderResponse" nillable="true" type="ReportOrderResponse" />
+ </s:sequence>
+ </s:complexType>
+ </s:schema>
+ </wsdl:types>
+ <wsdl:message name="ProvisionMonitorsSoapIn">
+ <wsdl:part name="parameters" element="tns:ProvisionMonitors" />
+ </wsdl:message>
+ <wsdl:message name="ProvisionMonitorsSoapOut">
+ <wsdl:part name="parameters" element="tns:ProvisionMonitorsResponse" />
+ </wsdl:message>
+ <wsdl:portType name="ProvisioningServiceSoap">
+ <wsdl:operation name="ProvisionMonitors">
+ <wsdl:input message="tns:ProvisionMonitorsSoapIn" />
+ <wsdl:output message="tns:ProvisionMonitorsSoapOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="ProvisioningServiceSoap" type="tns:ProvisioningServiceSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="ProvisionMonitors">
+ <soap:operation soapAction="http://www.gomeznetworks.com/webservices/ProvisionMonitors" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="ProvisioningService">
+ <wsdl:port name="ProvisioningServiceSoap" binding="tns:ProvisioningServiceSoap">
+ <soap:address location="test://" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug44811.phpt b/ext/soap/tests/bugs/bug44811.phpt
new file mode 100644
index 0000000..8cfc4a7
--- /dev/null
+++ b/ext/soap/tests/bugs/bug44811.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #44811 (Improve error messages when creating new SoapClient which contains invalid data)
+--SKIPIF--
+<?php require_once 'skipif.inc'; ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+try {
+ $x = new SoapClient('http://slashdot.org');
+} catch (SoapFault $e) {
+ echo $e->getMessage() . PHP_EOL;
+}
+die('ok');
+?>
+--EXPECTF--
+SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://slashdot.org' : %s
+
+ok
diff --git a/ext/soap/tests/bugs/bug44882.phpt b/ext/soap/tests/bugs/bug44882.phpt
new file mode 100644
index 0000000..366ddde
--- /dev/null
+++ b/ext/soap/tests/bugs/bug44882.phpt
@@ -0,0 +1,64 @@
+--TEST--
+Bug #44882 (SOAP extension object decoding bug)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class TestSoapClient extends SoapClient
+{
+ public function __doRequest($req, $loc, $act, $ver, $one_way = 0)
+ {
+ return <<<XML
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ns="urn:ebay:api:PayPalAPI">
+ <SOAP-ENV:Body id="_0">
+ <GetExpressCheckoutDetailsResponse xmlns="urn:ebay:api:PayPalAPI">
+ <Timestamp>2008-06-23T14:51:08Z</Timestamp>
+ <Ack>Success</Ack>
+ <CorrelationID>ae013a0ccdf13</CorrelationID>
+ <Version>50.000000</Version>
+ <Build>588340</Build>
+ <GetExpressCheckoutDetailsResponseDetails xsi:type="ns:GetExpressCheckoutDetailsResponseDetailsType">
+ <Token>EC-11Y75137T2399952C</Token>
+ <PayerInfo>
+ <Payer>example@example.com</Payer>
+ <PayerID>MU82WA43YXM9C</PayerID>
+ <PayerStatus>verified</PayerStatus>
+ </PayerInfo>
+ </GetExpressCheckoutDetailsResponseDetails>
+ </GetExpressCheckoutDetailsResponse>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+XML;
+ }
+}
+
+$client = new TestSoapClient(dirname(__FILE__).'/bug44882.wsdl');
+print_r($client->GetExpressCheckoutDetails());
+?>
+--EXPECT--
+stdClass Object
+(
+ [Timestamp] => 2008-06-23T14:51:08Z
+ [Ack] => Success
+ [CorrelationID] => ae013a0ccdf13
+ [Version] => 50.000000
+ [Build] => 588340
+ [GetExpressCheckoutDetailsResponseDetails] => stdClass Object
+ (
+ [Token] => EC-11Y75137T2399952C
+ [PayerInfo] => stdClass Object
+ (
+ [Payer] => example@example.com
+ [PayerID] => MU82WA43YXM9C
+ [PayerStatus] => verified
+ )
+
+ )
+
+)
diff --git a/ext/soap/tests/bugs/bug44882.wsdl b/ext/soap/tests/bugs/bug44882.wsdl
new file mode 100644
index 0000000..266f6a0
--- /dev/null
+++ b/ext/soap/tests/bugs/bug44882.wsdl
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns="urn:ebay:api:PayPalAPI"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ targetNamespace="urn:ebay:api:PayPalAPI">
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ebay:api:PayPalAPI" elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <complexType name="PayerInfoType">
+ <sequence>
+ <element name="Payer" type="xs:string" minOccurs="0"/>
+ <element name="PayerID" type="xs:string" minOccurs="0"/>
+ <element name="PayerStatus" type="xs:string" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <complexType name="AbstractResponseType" abstract="true">
+ <sequence>
+ <element name="Timestamp" type="xs:dateTime" minOccurs="0"/>
+ <element name="Ack" type="xs:string"/>
+ <element name="CorrelationID" type="xs:string" minOccurs="0"/>
+ <element name="Version" type="xs:string"/>
+ <element name="Build" type="xs:string"/>
+ <any processContents="lax" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <xs:element name="GetExpressCheckoutDetailsResponseDetails" type="ns:GetExpressCheckoutDetailsResponseDetailsType"/>
+ <xs:complexType name="GetExpressCheckoutDetailsResponseDetailsType">
+ <xs:sequence>
+ <xs:element name="Token" type="xs:string"/>
+ <xs:element name="PayerInfo" type="ns:PayerInfoType"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="GetExpressCheckoutDetailsResponse" type="ns:GetExpressCheckoutDetailsResponseType"/>
+ <xs:complexType name="GetExpressCheckoutDetailsResponseType">
+ <xs:complexContent>
+ <xs:extension base="ns:AbstractResponseType">
+ <xs:sequence>
+ <xs:element ref="ns:GetExpressCheckoutDetailsResponseDetails" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="GetExpressCheckoutDetailsRequest">
+ </wsdl:message>
+ <wsdl:message name="GetExpressCheckoutDetailsResponse">
+ <wsdl:part name="GetExpressCheckoutDetailsResponse" element="ns:GetExpressCheckoutDetailsResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="PayPalAPIAAInterface">
+ <wsdl:operation name="GetExpressCheckoutDetails">
+ <wsdl:input message="ns:GetExpressCheckoutDetailsRequest"/>
+ <wsdl:output message="ns:GetExpressCheckoutDetailsResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="PayPalAPIAASoapBinding" type="ns:PayPalAPIAAInterface">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="GetExpressCheckoutDetails">
+ <wsdlsoap:operation/>
+ <wsdl:input>
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="PayPalAPIInterfaceService">
+ <wsdl:port name="PayPalAPIAA" binding="ns:PayPalAPIAASoapBinding">
+ <wsdlsoap:address location="test://"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug46419.phpt b/ext/soap/tests/bugs/bug46419.phpt
new file mode 100644
index 0000000..cb113e2
--- /dev/null
+++ b/ext/soap/tests/bugs/bug46419.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #46419 (Elements of associative arrays with NULL value are lost)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function bar() {
+ return array('a' => 1, 'b' => NULL, 'c' => 2, 'd'=>'');
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('bar');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$x = new LocalSoapClient(NULL,array('location'=>'test://',
+ 'uri'=>'http://testuri.org'));
+var_dump($x->bar());
+?>
+--EXPECT--
+array(4) {
+ ["a"]=>
+ int(1)
+ ["b"]=>
+ NULL
+ ["c"]=>
+ int(2)
+ ["d"]=>
+ string(0) ""
+}
diff --git a/ext/soap/tests/bugs/bug46427.phpt b/ext/soap/tests/bugs/bug46427.phpt
new file mode 100644
index 0000000..a49071e
--- /dev/null
+++ b/ext/soap/tests/bugs/bug46427.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #46427 (SoapClient() stumbles over its "stream_context" parameter)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+error_reporting(E_ALL|E_STRICT);
+
+function getSoapClient_1() {
+ $ctx = stream_context_create();
+ return new SoapClient(NULL, array(
+ 'stream_context' => $ctx,
+ 'location' => 'test://',
+ 'uri' => 'test://',
+ 'exceptions' => false));
+}
+
+getSoapClient_1()->__soapCall('Help', array());
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug47049.phpt b/ext/soap/tests/bugs/bug47049.phpt
new file mode 100644
index 0000000..bdc1627
--- /dev/null
+++ b/ext/soap/tests/bugs/bug47049.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #47049 (SoapClient::__soapCall causes a segmentation fault)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__) . '/bug47049.wsdl',
+ array('trace' => 1 , 'exceptions' => 0));
+$host = array('uuid' => 'foo');
+$software_list = array(array('name' => 'package', 'version' => '1.2.3', 'state' => 'installed'));
+$updates = array();
+$report_id = $client->__soapCall('reportSoftwareStatus',array($host, $software_list, $updates));
+echo $client->__getLastRequest();
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/reporter/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:reportSoftwareStatus><host xsi:type="ns1:host"><uuid xsi:type="xsd:string">foo</uuid></host><software_list xsi:type="ns1:software_list"><software xsi:type="ns1:software"><name xsi:type="xsd:string">package</name><version xsi:type="xsd:string">1.2.3</version><state xsi:type="xsd:string">installed</state></software></software_list><updates xsi:type="ns1:updates"/></ns1:reportSoftwareStatus></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug47049.wsdl b/ext/soap/tests/bugs/bug47049.wsdl
new file mode 100644
index 0000000..b5730a3
--- /dev/null
+++ b/ext/soap/tests/bugs/bug47049.wsdl
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.example.org/reporter/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="reporter" targetNamespace="http://www.example.org/reporter/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <wsdl:types><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/reporter/">
+ <xsd:complexType name="host">
+ <xsd:sequence>
+ <xsd:element name="uuid" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="software_list">
+ <xsd:sequence>
+ <xsd:element name="software" type="tns:software"
+ maxOccurs="unbounded" minOccurs="1">
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="software">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
+ <xsd:element name="version" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
+ <xsd:element name="state" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="updates">
+ <xsd:sequence>
+ <xsd:element name="update" type="tns:update"
+ maxOccurs="unbounded" minOccurs="0">
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="update">
+ <xsd:sequence>
+ <xsd:element name="software" type="xsd:string"></xsd:element>
+ <xsd:element name="old_version" type="xsd:string"></xsd:element>
+ <xsd:element name="new_version" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema></wsdl:types>
+ <wsdl:message name="reportSoftwareStatusRequest">
+ <wsdl:part name="host" type="tns:host"/>
+ <wsdl:part name="software_list" type="tns:software_list"></wsdl:part>
+ <wsdl:part name="updates" type="tns:updates"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="reportSoftwareStatusResponse">
+ <wsdl:part name="report_id" type="xsd:int"/>
+ </wsdl:message>
+ <wsdl:portType name="reporter">
+ <wsdl:operation name="reportSoftwareStatus">
+ <wsdl:input message="tns:reportSoftwareStatusRequest"/>
+ <wsdl:output message="tns:reportSoftwareStatusResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="reporterHTTP" type="tns:reporter">
+
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="reportSoftwareStatus">
+
+ <soap:operation
+ soapAction="http://www.example.org/reporter/reportSoftwareStatus" />
+ <wsdl:input>
+
+
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+
+
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="reporter">
+ <wsdl:port binding="tns:reporterHTTP" name="reporterHTTP">
+ <http:address location="test://"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug47273.phpt b/ext/soap/tests/bugs/bug47273.phpt
new file mode 100644
index 0000000..174948f
--- /dev/null
+++ b/ext/soap/tests/bugs/bug47273.phpt
@@ -0,0 +1,53 @@
+--TEST--
+Bug #47273 (Encoding bug in SoapServer->fault)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+unicode.script_encoding=ISO-8859-1
+unicode.output_encoding=ISO-8859-1
+--FILE--
+<?php
+$request1 = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://127.0.0.1:8080/test/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test1/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+$request2 = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://127.0.0.1:8080/test/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test2/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+
+class SoapFaultTest
+{
+ public function test1() {
+ // Test #1
+ return 'Test #1 exception with some special chars: Äßö';
+ }
+ public function test2() {
+ // Test #2
+ //throw new SoapFault('Server', 'Test #2 exception with some special chars: Äßö');
+ throw new Exception('Test #2 exception with some special chars: Äßö');
+ }
+}
+
+$server = new SoapServer(null, array(
+'uri' => "http://127.0.0.1:8080/test/",
+'encoding' => 'ISO-8859-1'));
+$server->setClass('SoapFaultTest');
+
+try {
+ $server->handle($request1);
+} catch (Exception $e) {
+ $server->fault("Sender", $e->getMessage());
+}
+try {
+ $server->handle($request2);
+} catch (Exception $e) {
+ $server->fault("Sender", $e->getMessage());
+}
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://127.0.0.1:8080/test/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test1Response><return xsi:type="xsd:string">Test #1 exception with some special chars: Äßö</return></ns1:test1Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Sender</faultcode><faultstring>Test #2 exception with some special chars: Äßö</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+
diff --git a/ext/soap/tests/bugs/bug50698_1.phpt b/ext/soap/tests/bugs/bug50698_1.phpt
new file mode 100644
index 0000000..eb5f1e0
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50698_1.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Request #50698_1 (SoapClient should handle wsdls with some incompatiable endpoints)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+new SoapClient(dirname(__FILE__) . '/bug50698_1.wsdl');
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug50698_1.wsdl b/ext/soap/tests/bugs/bug50698_1.wsdl
new file mode 100644
index 0000000..9c6a9ad
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50698_1.wsdl
@@ -0,0 +1,228 @@
+<wsdl:definitions name="EchoService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
+ <wsp:Policy wsu:Id="WSHttpBinding_EchoService_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:SecureConversationToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ <sp:BootstrapPolicy>
+ <wsp:Policy>
+ <sp:SignedParts>
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SymmetricBinding>
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:SpnegoContextToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ </wsp:Policy>
+ </sp:SpnegoContextToken>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:EncryptSignature/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust10>
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens/>
+ <sp:RequireClientEntropy/>
+ <sp:RequireServerEntropy/>
+ </wsp:Policy>
+ </sp:Trust10>
+ </wsp:Policy>
+ </sp:BootstrapPolicy>
+ </wsp:Policy>
+ </sp:SecureConversationToken>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:EncryptSignature/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:Wss11 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens/>
+ <sp:RequireClientEntropy/>
+ <sp:RequireServerEntropy/>
+ </wsp:Policy>
+ </sp:Trust10>
+ <wsaw:UsingAddressing/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="WSHttpBinding_EchoService_Echo_Input_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:EncryptedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="WSHttpBinding_EchoService_Echo_output_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:EncryptedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="NetTcpBinding_EchoService_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"/>
+ <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <msf:WindowsTransportSecurity xmlns:msf="http://schemas.microsoft.com/ws/2006/05/framing/policy">
+ <msf:ProtectionLevel>EncryptAndSign</msf:ProtectionLevel>
+ </msf:WindowsTransportSecurity>
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ </wsp:Policy>
+ </sp:TransportBinding>
+ <wsaw:UsingAddressing/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsdl:types>
+ </wsdl:types>
+ <wsdl:message name="EchoService_Echo_InputMessage">
+ <wsdl:part name="parameters" element="tns:Echo"/>
+ </wsdl:message>
+ <wsdl:message name="EchoService_Echo_OutputMessage">
+ <wsdl:part name="parameters" element="tns:EchoResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="EchoService">
+ <wsdl:operation name="Echo">
+ <wsdl:input wsaw:Action="http://tempuri.org/EchoService/Echo" message="tns:EchoService_Echo_InputMessage"/>
+ <wsdl:output wsaw:Action="http://tempuri.org/EchoService/EchoResponse" message="tns:EchoService_Echo_OutputMessage"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="BasicHttpBinding_EchoService" type="tns:EchoService">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="Echo">
+ <soap:operation soapAction="http://tempuri.org/EchoService/Echo" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="NetTcpBinding_EchoService" type="tns:EchoService">
+ <wsp:PolicyReference URI="#NetTcpBinding_EchoService_policy"/>
+ <soap12:binding transport="http://schemas.microsoft.com/soap/tcp"/>
+ <wsdl:operation name="Echo">
+ <soap12:operation soapAction="http://tempuri.org/EchoService/Echo" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="EchoService">
+ <wsdl:port name="BasicHttpBinding_EchoService" binding="tns:BasicHttpBinding_EchoService">
+ <soap:address location="http://localhost:8731/EchoService/Basic"/>
+ </wsdl:port>
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug50698_2.phpt b/ext/soap/tests/bugs/bug50698_2.phpt
new file mode 100644
index 0000000..a39f4b5
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50698_2.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Request #50698_2 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large mix of compatiable and incompatiable endpoints.)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+try {
+ new SoapClient(dirname(__FILE__) . '/bug50698_2.wsdl');
+ echo "Call: \"new SoapClient(dirname(__FILE__).'/bug50698_2.wsdl');\" should throw an exception of type 'SoapFault'";
+} catch (SoapFault $e) {
+ if ($e->faultcode == 'WSDL' && $e->faultstring == 'SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL.') {
+ echo "ok\n";
+ } else {
+ echo "Call: \"new SoapClient(dirname(__FILE__).'/bug50698_2.wsdl');\" threw a SoapFault with an incorrect faultcode or faultmessage.";
+ print_r($e);
+ }
+}
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug50698_2.wsdl b/ext/soap/tests/bugs/bug50698_2.wsdl
new file mode 100644
index 0000000..e4dab6c
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50698_2.wsdl
@@ -0,0 +1,422 @@
+<wsdl:definitions name="EchoService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
+ <wsp:Policy wsu:Id="WSHttpBinding_EchoService_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:SecureConversationToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ <sp:BootstrapPolicy>
+ <wsp:Policy>
+ <sp:SignedParts>
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SymmetricBinding>
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:SpnegoContextToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ </wsp:Policy>
+ </sp:SpnegoContextToken>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:EncryptSignature/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust10>
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens/>
+ <sp:RequireClientEntropy/>
+ <sp:RequireServerEntropy/>
+ </wsp:Policy>
+ </sp:Trust10>
+ </wsp:Policy>
+ </sp:BootstrapPolicy>
+ </wsp:Policy>
+ </sp:SecureConversationToken>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:EncryptSignature/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:Wss11 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens/>
+ <sp:RequireClientEntropy/>
+ <sp:RequireServerEntropy/>
+ </wsp:Policy>
+ </sp:Trust10>
+ <wsaw:UsingAddressing/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="WSHttpBinding_EchoService_Echo_Input_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:EncryptedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="WSHttpBinding_EchoService_Echo_output_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:EncryptedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="NetTcpBinding_EchoService_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"/>
+ <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <msf:WindowsTransportSecurity xmlns:msf="http://schemas.microsoft.com/ws/2006/05/framing/policy">
+ <msf:ProtectionLevel>EncryptAndSign</msf:ProtectionLevel>
+ </msf:WindowsTransportSecurity>
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ </wsp:Policy>
+ </sp:TransportBinding>
+ <wsaw:UsingAddressing/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsdl:types>
+ </wsdl:types>
+ <wsdl:message name="EchoService_Echo_InputMessage">
+ <wsdl:part name="parameters" element="tns:Echo"/>
+ </wsdl:message>
+ <wsdl:message name="EchoService_Echo_OutputMessage">
+ <wsdl:part name="parameters" element="tns:EchoResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="EchoService">
+ <wsdl:operation name="Echo">
+ <wsdl:input wsaw:Action="http://tempuri.org/EchoService/Echo" message="tns:EchoService_Echo_InputMessage"/>
+ <wsdl:output wsaw:Action="http://tempuri.org/EchoService/EchoResponse" message="tns:EchoService_Echo_OutputMessage"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="NetTcpBinding_EchoService" type="tns:EchoService">
+ <wsp:PolicyReference URI="#NetTcpBinding_EchoService_policy"/>
+ <soap12:binding transport="http://schemas.microsoft.com/soap/tcp"/>
+ <wsdl:operation name="Echo">
+ <soap12:operation soapAction="http://tempuri.org/EchoService/Echo" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="EchoService-NetTcp-1">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-1">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="http://localhost:8731/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>http://localhost:8731/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-NetTcp-2">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-2">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="http://localhost:8731/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>http://localhost:8731/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-NetTcp-3">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-3">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="http://localhost:8731/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>http://localhost:8731/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-NetTcp-4">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-4">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="http://localhost:8731/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>http://localhost:8731/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-NetTcp-5">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-5">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="http://localhost:8731/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>http://localhost:8731/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-NetTcp-6">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-6">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="http://localhost:8731/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>http://localhost:8731/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-NetTcp-7">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-7">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="http://localhost:8731/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>http://localhost:8731/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-NetTcp-8">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-8">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="http://localhost:8731/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>http://localhost:8731/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-NetTcp-9">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-9">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="http://localhost:8731/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>http://localhost:8731/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-NetTcp-10">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-10">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="http://localhost:8731/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>http://localhost:8731/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug50698_3.phpt b/ext/soap/tests/bugs/bug50698_3.phpt
new file mode 100644
index 0000000..6cee6a6
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50698_3.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Request #50698_3 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large set of endpoints all incompatiable.)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+try {
+ new SoapClient(dirname(__FILE__) . '/bug50698_3.wsdl');
+ echo "Call: \"new SoapClient(dirname(__FILE__).'/bug50698_3.wsdl');\" should throw an exception of type 'SoapFault'";
+} catch (SoapFault $e) {
+ if ($e->faultcode == 'WSDL' && $e->faultstring == 'SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL.') {
+ echo "ok\n";
+ } else {
+ echo "Call: \"new SoapClient(dirname(__FILE__).'/bug50698_3.wsdl');\" threw a SoapFault with an incorrect faultcode or faultmessage.";
+ print_r($e);
+ }
+}
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug50698_3.wsdl b/ext/soap/tests/bugs/bug50698_3.wsdl
new file mode 100644
index 0000000..bed21df
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50698_3.wsdl
@@ -0,0 +1,312 @@
+<wsdl:definitions name="EchoService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
+ <wsp:Policy wsu:Id="WSHttpBinding_EchoService_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:SecureConversationToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ <sp:BootstrapPolicy>
+ <wsp:Policy>
+ <sp:SignedParts>
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SymmetricBinding>
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:SpnegoContextToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ </wsp:Policy>
+ </sp:SpnegoContextToken>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:EncryptSignature/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust10>
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens/>
+ <sp:RequireClientEntropy/>
+ <sp:RequireServerEntropy/>
+ </wsp:Policy>
+ </sp:Trust10>
+ </wsp:Policy>
+ </sp:BootstrapPolicy>
+ </wsp:Policy>
+ </sp:SecureConversationToken>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:EncryptSignature/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:Wss11 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens/>
+ <sp:RequireClientEntropy/>
+ <sp:RequireServerEntropy/>
+ </wsp:Policy>
+ </sp:Trust10>
+ <wsaw:UsingAddressing/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="WSHttpBinding_EchoService_Echo_Input_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:EncryptedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="WSHttpBinding_EchoService_Echo_output_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:EncryptedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="NetTcpBinding_EchoService_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"/>
+ <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <msf:WindowsTransportSecurity xmlns:msf="http://schemas.microsoft.com/ws/2006/05/framing/policy">
+ <msf:ProtectionLevel>EncryptAndSign</msf:ProtectionLevel>
+ </msf:WindowsTransportSecurity>
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ </wsp:Policy>
+ </sp:TransportBinding>
+ <wsaw:UsingAddressing/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsdl:types>
+ </wsdl:types>
+ <wsdl:message name="EchoService_Echo_InputMessage">
+ <wsdl:part name="parameters" element="tns:Echo"/>
+ </wsdl:message>
+ <wsdl:message name="EchoService_Echo_OutputMessage">
+ <wsdl:part name="parameters" element="tns:EchoResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="EchoService">
+ <wsdl:operation name="Echo">
+ <wsdl:input wsaw:Action="http://tempuri.org/EchoService/Echo" message="tns:EchoService_Echo_InputMessage"/>
+ <wsdl:output wsaw:Action="http://tempuri.org/EchoService/EchoResponse" message="tns:EchoService_Echo_OutputMessage"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="NetTcpBinding_EchoService" type="tns:EchoService">
+ <wsp:PolicyReference URI="#NetTcpBinding_EchoService_policy"/>
+ <soap12:binding transport="http://schemas.microsoft.com/soap/tcp"/>
+ <wsdl:operation name="Echo">
+ <soap12:operation soapAction="http://tempuri.org/EchoService/Echo" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="EchoService-1">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-2">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-3">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-4">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-5">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-6">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-7">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-8">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-9">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="EchoService-10">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug50698_4.phpt b/ext/soap/tests/bugs/bug50698_4.phpt
new file mode 100644
index 0000000..bb02d00
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50698_4.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Request #50698_4 (SoapClient should handle wsdls with some incompatiable endpoints)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+new SoapClient(dirname(__FILE__) . '/bug50698_4.wsdl');
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/bugs/bug50698_4.wsdl b/ext/soap/tests/bugs/bug50698_4.wsdl
new file mode 100644
index 0000000..dc9c329
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50698_4.wsdl
@@ -0,0 +1,228 @@
+<wsdl:definitions name="EchoService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
+ <wsp:Policy wsu:Id="WSHttpBinding_EchoService_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:SecureConversationToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ <sp:BootstrapPolicy>
+ <wsp:Policy>
+ <sp:SignedParts>
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SymmetricBinding>
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:SpnegoContextToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ </wsp:Policy>
+ </sp:SpnegoContextToken>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:EncryptSignature/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust10>
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens/>
+ <sp:RequireClientEntropy/>
+ <sp:RequireServerEntropy/>
+ </wsp:Policy>
+ </sp:Trust10>
+ </wsp:Policy>
+ </sp:BootstrapPolicy>
+ </wsp:Policy>
+ </sp:SecureConversationToken>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:EncryptSignature/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:Wss11 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens/>
+ <sp:RequireClientEntropy/>
+ <sp:RequireServerEntropy/>
+ </wsp:Policy>
+ </sp:Trust10>
+ <wsaw:UsingAddressing/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="WSHttpBinding_EchoService_Echo_Input_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:EncryptedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="WSHttpBinding_EchoService_Echo_output_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:EncryptedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="NetTcpBinding_EchoService_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"/>
+ <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <msf:WindowsTransportSecurity xmlns:msf="http://schemas.microsoft.com/ws/2006/05/framing/policy">
+ <msf:ProtectionLevel>EncryptAndSign</msf:ProtectionLevel>
+ </msf:WindowsTransportSecurity>
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ </wsp:Policy>
+ </sp:TransportBinding>
+ <wsaw:UsingAddressing/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsdl:types>
+ </wsdl:types>
+ <wsdl:message name="EchoService_Echo_InputMessage">
+ <wsdl:part name="parameters" element="tns:Echo"/>
+ </wsdl:message>
+ <wsdl:message name="EchoService_Echo_OutputMessage">
+ <wsdl:part name="parameters" element="tns:EchoResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="EchoService">
+ <wsdl:operation name="Echo">
+ <wsdl:input wsaw:Action="http://tempuri.org/EchoService/Echo" message="tns:EchoService_Echo_InputMessage"/>
+ <wsdl:output wsaw:Action="http://tempuri.org/EchoService/EchoResponse" message="tns:EchoService_Echo_OutputMessage"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="BasicHttpBinding_EchoService" type="tns:EchoService">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="Echo">
+ <soap:operation soapAction="http://tempuri.org/EchoService/Echo" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="NetTcpBinding_EchoService" type="tns:EchoService">
+ <wsp:PolicyReference URI="#NetTcpBinding_EchoService_policy"/>
+ <soap12:binding transport="http://schemas.microsoft.com/soap/tcp"/>
+ <wsdl:operation name="Echo">
+ <soap12:operation soapAction="http://tempuri.org/EchoService/Echo" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="EchoService">
+ <wsdl:port name="NetTcpBinding_EchoService" binding="tns:NetTcpBinding_EchoService">
+ <soap12:address location="net.tcp://localhost:8732/EchoService/"/>
+ <wsa10:EndpointReference>
+ <wsa10:Address>net.tcp://localhost:8732/EchoService/</wsa10:Address>
+ <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
+ <Upn>MAYA-DELL\Justin Dearing</Upn>
+ </Identity>
+ </wsa10:EndpointReference>
+ </wsdl:port>
+ <wsdl:port name="BasicHttpBinding_EchoService" binding="tns:BasicHttpBinding_EchoService">
+ <soap:address location="http://localhost:8731/EchoService/Basic"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug50762.phpt b/ext/soap/tests/bugs/bug50762.phpt
new file mode 100644
index 0000000..77eb6ee
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50762.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Bug #50762 (in WSDL mode Soap Header handler function only being called if defined in WSDL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class testSoap {
+ private $auth;
+ public function authToken($token){
+ $this->auth=true;
+ }
+ public function testHeader($param){
+ return 'header handler ' . ($this->auth ? 'called' : 'not called');
+ }
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->setObject(new testSoap());
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$cl = new LocalSoapClient(dirname(__FILE__).'/bug50762.wsdl', array('cache_wsdl'=>WSDL_CACHE_NONE, 'trace'=>true));
+
+class authToken{
+ public function __construct($token){
+ $this->authToken=$token;
+ }
+}
+
+$cl->__setSoapHeaders(array(new SoapHeader('http://sova.pronto.ru/', 'authToken', new authToken('tokendata'))));
+echo $cl->testHeader('param') . PHP_EOL;
+?>
+--EXPECT--
+header handler called
diff --git a/ext/soap/tests/bugs/bug50762.wsdl b/ext/soap/tests/bugs/bug50762.wsdl
new file mode 100644
index 0000000..2980589
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50762.wsdl
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://sova.pronto.ru/" xmlns:xsd1="http://sova.pronto.ru/schema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="sova" targetNamespace="http://sova.pronto.ru/">
+ <wsdl:message name="authToken">
+ <wsdl:part name="authToken" type="xsd:string"/>
+ </wsdl:message>
+ <wsdl:message name="message">
+ <wsdl:part name="param" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="sova">
+ <wsdl:operation name="testHeader">
+ <wsdl:input message="tns:message"/>
+ <wsdl:output message="tns:message"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="sovaSOAP" type="tns:sova">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="testHeader">
+ <soap:operation soapAction="http://sova.pronto.ru/testHeader"/>
+ <wsdl:input>
+ <soap:body namespace="http://sova.pronto.ru/" use="literal"/>
+ <soap:header use="literal" part="authToken" message="tns:authToken" wsdl:required="true"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body namespace="http://sova.pronto.ru/" use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+
+ </wsdl:binding>
+ <wsdl:service name="sova">
+ <wsdl:port binding="tns:sovaSOAP" name="sovaSOAP">
+ <soap:address location="http://sova.mephius.prontosoft.by/sova/soaptest.php"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug50997.phpt b/ext/soap/tests/bugs/bug50997.phpt
new file mode 100644
index 0000000..0508aac
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50997.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #50997 (SOAP Error when trying to submit 2nd Element of a choice)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$soapClient = new SoapClient(__DIR__ . '/bug50997.wsdl', array('trace' => 1, 'exceptions'=>0));
+$params = array('code'=>'foo');
+$soapClient->newOperation($params);
+echo $soapClient->__getLastRequest();
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/service2/"><SOAP-ENV:Body><ns1:NewOperation><code>foo</code></ns1:NewOperation></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug50997.wsdl b/ext/soap/tests/bugs/bug50997.wsdl
new file mode 100644
index 0000000..16c6d36
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50997.wsdl
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/service2/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="service2" targetNamespace="http://www.example.org/service2/">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://www.example.org/service2/">
+ <xsd:element name="NewOperation">
+ <xsd:complexType>
+ <xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="firstName" type="xsd:string"> </xsd:element>
+ <xsd:element name="surName" type="xsd:string"/>
+ </xsd:sequence>
+ <xsd:element name="code" type="xsd:string"/>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="NewOperationResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="NewOperationRequest">
+ <wsdl:part element="tns:NewOperation" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="NewOperationResponse">
+ <wsdl:part element="tns:NewOperationResponse" name="parameters"/>
+ </wsdl:message>
+ <wsdl:portType name="service2">
+ <wsdl:operation name="NewOperation">
+ <wsdl:input message="tns:NewOperationRequest"/>
+ <wsdl:output message="tns:NewOperationResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="service2SOAP" type="tns:service2">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="NewOperation">
+ <soap:operation soapAction="http://www.example.org/service2/NewOperation"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="service2">
+ <wsdl:port binding="tns:service2SOAP" name="service2SOAP">
+ <soap:address location="test://"/>
+ </wsdl:port>
+ </wsdl:service>
+ </wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug54911.phpt b/ext/soap/tests/bugs/bug54911.phpt
new file mode 100644
index 0000000..da57383
--- /dev/null
+++ b/ext/soap/tests/bugs/bug54911.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #54911 (Access to a undefined member in inherit SoapClient may cause Segmentation Fault)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ class XSoapClient extends SoapClient {
+ function __doRequest($request, $location, $action, $version, $one_way=false) {
+ echo self::$crash;
+ }
+ }
+ $client = new XSoapClient(null, array('uri'=>'', 'location'=>''));
+ $client->__soapCall('', array());
+?>
+--EXPECTF--
+Fatal error: Uncaught SoapFault exception: [Client] Access to undeclared static property: XSoapClient::$crash in %sbug54911.php:4
+Stack trace:
+#0 %sbug54911.php(4): XSoapClient::__doRequest()
+#1 [internal function]: XSoapClient->__doRequest('<?xml version="...', '', '#', 1, 0)
+#2 %sbug54911.php(8): SoapClient->__soapCall('', Array)
+#3 {main}
+ thrown in %sbug54911.php on line 4 \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug55323.phpt b/ext/soap/tests/bugs/bug55323.phpt
new file mode 100644
index 0000000..7855dd8
--- /dev/null
+++ b/ext/soap/tests/bugs/bug55323.phpt
@@ -0,0 +1,45 @@
+--TEST--
+Bug #55323 (SoapClient segmentation fault when XSD_TYPEKIND_EXTENSION contains itself)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled",0);
+$timestamp = "2011-07-30T03:25:00-05:00";
+$wsdl = dirname(__FILE__)."/bug55323.wsdl";
+
+class TestSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ return <<<EOF
+<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test.com/soap/v3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
+ <SOAP-ENV:Body>
+ <ns1:getObjectResponse>
+ <getObjectReturn xsi:type="ns1:Customer" id="ref1">
+ <accountId xsi:type="xsd:int">1234</accountId>
+ <parent href="#ref1"/>
+ </getObjectReturn>
+ </ns1:getObjectResponse>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+ }
+
+}
+
+$soapClient = new TestSoapClient($wsdl,
+ array('trace' => 1, 'exceptions' => 0));
+$result = $soapClient->getObject();
+var_dump($result);
+?>
+--EXPECTF--
+object(stdClass)#%d (2) {
+ ["accountId"]=>
+ int(1234)
+ ["parent"]=>
+ *RECURSION*
+}
diff --git a/ext/soap/tests/bugs/bug55323.wsdl b/ext/soap/tests/bugs/bug55323.wsdl
new file mode 100644
index 0000000..c260d34
--- /dev/null
+++ b/ext/soap/tests/bugs/bug55323.wsdl
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://test.com/soap/v3/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="slApi" targetNamespace="http://test.com/soap/v3/">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://test.com/soap/v3/"
+ xmlns:tns="http://test.com/soap/v3/"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ elementFormDefault="qualified">
+ <complexType name="Customer">
+ <complexContent>
+ <extension base="tns:Interface">
+ <sequence>
+ <element minOccurs="0" maxOccurs="1" nillable="true" name="accountId" type="int"/>
+ <element minOccurs="0" maxOccurs="1" name="parent" type="tns:Customer"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="Interface" abstract="true"/>
+ </xsd:schema>
+ </types>
+ <message name="getObject"/>
+ <message name="getObjectResponse">
+ <part name="getObjectReturn" type="tns:Customer"/>
+ </message>
+ <portType name="CustomerPortType">
+ <operation name="getObject">
+ <input message="tns:getObject"/>
+ <output message="tns:getObjectResponse"/>
+ </operation>
+ </portType>
+ <binding name="CustomerBinding" type="tns:CustomerPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="getObject">
+ <soap:operation soapAction="http://test.com/soap/v3/CustomerAction"/>
+ <input>
+ <soap:body namespace="http://test.com/soap/v3/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body namespace="http://test.com/soap/v3/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="CustomerService">
+ <port name="CustomerPort" binding="tns:CustomerBinding">
+ <soap:address location="test://"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/multiport.phpt b/ext/soap/tests/bugs/multiport.phpt
new file mode 100644
index 0000000..0b5e944
--- /dev/null
+++ b/ext/soap/tests/bugs/multiport.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Proper binding selection
+--SKIPIF--
+<?php require_once 'skipif.inc'; ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__).'/multiport.wsdl',
+ array('trace' => true, 'exceptions' => false));
+$response = $client->GetSessionId(array('userId'=>'user', 'password'=>'password'));
+echo $client->__getLastRequest();
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.reuters.com/"><SOAP-ENV:Body><ns1:GetSessionId><ns1:userId>user</ns1:userId><ns1:password>password</ns1:password></ns1:GetSessionId></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/multiport.wsdl b/ext/soap/tests/bugs/multiport.wsdl
new file mode 100644
index 0000000..604e963
--- /dev/null
+++ b/ext/soap/tests/bugs/multiport.wsdl
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://www.reuters.com/" xmlns:tns="http://www.reuters.com/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:s="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://www.reuters.com/">
+ <s:element name="GetSessionId">
+ <s:complexType>
+ <s:sequence>
+ <s:element maxOccurs="1" minOccurs="0" name="userId" type="s:string"/>
+ <s:element maxOccurs="1" minOccurs="0" name="password" type="s:string"/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetSessionIdResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element maxOccurs="1" minOccurs="0" name="GetSessionIdResult" type="s:string"/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:schema>
+ </wsdl:types>
+ <wsdl:message name="GetSessionIdHttpGetIn">
+ <wsdl:part name="userId" type="s:string">
+ </wsdl:part>
+ <wsdl:part name="password" type="s:string">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="GetSessionIdHttpGetOut">
+ <wsdl:part name="Body" element="tns:string">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="GetSessionIdSoapOut">
+ <wsdl:part name="parameters" element="tns:GetSessionIdResponse">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="GetSessionIdSoapIn">
+ <wsdl:part name="parameters" element="tns:GetSessionId">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="StocksDataSecureHttpGet">
+ <wsdl:operation name="GetSessionId">
+ <wsdl:input message="tns:GetSessionIdHttpGetIn">
+ </wsdl:input>
+ <wsdl:output message="tns:GetSessionIdHttpGetOut">
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:portType name="StocksDataSecureSoap">
+ <wsdl:operation name="GetSessionId">
+ <wsdl:input message="tns:GetSessionIdSoapIn">
+ </wsdl:input>
+ <wsdl:output message="tns:GetSessionIdSoapOut">
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="StocksDataSecureHttpGet" type="tns:StocksDataSecureHttpGet">
+ <http:binding verb="GET"/>
+ <wsdl:operation name="GetSessionId">
+ <http:operation location="/GetSessionId"/>
+ <wsdl:input>
+ <http:urlEncoded/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:mimeXml part="Body"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="StocksDataSecureSoap" type="tns:StocksDataSecureSoap">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="GetSessionId">
+ <soap:operation soapAction="http://www.reuters.com/GetSessionId" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="StocksDataSecure">
+ <wsdl:port name="StocksDataSecureHttpGet" binding="tns:StocksDataSecureHttpGet">
+ <http:address location="test://"/>
+ </wsdl:port>
+ <wsdl:port name="StocksDataSecureSoap" binding="tns:StocksDataSecureSoap">
+ <soap:address location="test://"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/skipif.inc b/ext/soap/tests/bugs/skipif.inc
new file mode 100644
index 0000000..fa8574e
--- /dev/null
+++ b/ext/soap/tests/bugs/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/bugs/xml.xsd b/ext/soap/tests/bugs/xml.xsd
new file mode 100644
index 0000000..abb844a
--- /dev/null
+++ b/ext/soap/tests/bugs/xml.xsd
@@ -0,0 +1,34 @@
+<?xml version='1.0'?>
+<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" >
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+
+ <xs:attribute name="lang" type="xs:language">
+ <xs:annotation>
+ <xs:documentation>In due course, we should install the relevant ISO 2- and 3-letter
+ codes as the enumerated possible values . . .</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="space" default="preserve">
+ <xs:simpleType>
+ <xs:restriction base="xs:NCName">
+ <xs:enumeration value="default"/>
+ <xs:enumeration value="preserve"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="base" type="xs:anyURI">
+ <xs:annotation>
+ <xs:documentation>See http://www.w3.org/TR/xmlbase/ for
+ information about this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+ <xs:attribute ref="xml:base"/>
+ <xs:attribute ref="xml:lang"/>
+ <xs:attribute ref="xml:space"/>
+ </xs:attributeGroup>
+
+</xs:schema>
diff --git a/ext/soap/tests/bugs/xml2.xsd b/ext/soap/tests/bugs/xml2.xsd
new file mode 100755
index 0000000..a8e2185
--- /dev/null
+++ b/ext/soap/tests/bugs/xml2.xsd
@@ -0,0 +1,146 @@
+<?xml version='1.0'?>
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+
+ <xs:annotation>
+ <xs:documentation>
+ See http://www.w3.org/XML/1998/namespace.html and
+ http://www.w3.org/TR/REC-xml for information about this namespace.
+
+ This schema document describes the XML namespace, in a form
+ suitable for import by other schema documents.
+
+ Note that local names in this namespace are intended to be defined
+ only by the World Wide Web Consortium or its subgroups. The
+ following names are currently defined in this namespace and should
+ not be used with conflicting semantics by any Working Group,
+ specification, or document instance:
+
+ base (as an attribute name): denotes an attribute whose value
+ provides a URI to be used as the base for interpreting any
+ relative URIs in the scope of the element on which it
+ appears; its value is inherited. This name is reserved
+ by virtue of its definition in the XML Base specification.
+
+ id (as an attribute name): denotes an attribute whose value
+ should be interpreted as if declared to be of type ID.
+ The xml:id specification is not yet a W3C Recommendation,
+ but this attribute is included here to facilitate experimentation
+ with the mechanisms it proposes. Note that it is _not_ included
+ in the specialAttrs attribute group.
+
+ lang (as an attribute name): denotes an attribute whose value
+ is a language code for the natural language of the content of
+ any element; its value is inherited. This name is reserved
+ by virtue of its definition in the XML specification.
+
+ space (as an attribute name): denotes an attribute whose
+ value is a keyword indicating what whitespace processing
+ discipline is intended for the content of the element; its
+ value is inherited. This name is reserved by virtue of its
+ definition in the XML specification.
+
+ Father (in any context at all): denotes Jon Bosak, the chair of
+ the original XML Working Group. This name is reserved by
+ the following decision of the W3C XML Plenary and
+ XML Coordination groups:
+
+ In appreciation for his vision, leadership and dedication
+ the W3C XML Plenary on this 10th day of February, 2000
+ reserves for Jon Bosak in perpetuity the XML name
+ xml:Father
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>This schema defines attributes and an attribute group
+ suitable for use by
+ schemas wishing to allow xml:base, xml:lang or xml:space attributes
+ on elements they define.
+
+ To enable this, such a schema must import this schema
+ for the XML namespace, e.g. as follows:
+ &lt;schema . . .>
+ . . .
+ &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+ schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
+
+ Subsequently, qualified reference to any of the attributes
+ or the group defined below will have the desired effect, e.g.
+
+ &lt;type . . .>
+ . . .
+ &lt;attributeGroup ref="xml:specialAttrs"/>
+
+ will define a type which will schema-validate an instance
+ element with any of those attributes</xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>In keeping with the XML Schema WG's standard versioning
+ policy, this schema document will persist at
+ http://www.w3.org/2005/08/xml.xsd.
+ At the date of issue it can also be found at
+ http://www.w3.org/2001/xml.xsd.
+ The schema document at that URI may however change in the future,
+ in order to remain compatible with the latest version of XML Schema
+ itself, or with the XML namespace itself. In other words, if the XML
+ Schema or XML namespaces change, the version of this document at
+ http://www.w3.org/2001/xml.xsd will change
+ accordingly; the version at
+ http://www.w3.org/2005/08/xml.xsd will not change.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang">
+ <xs:annotation>
+ <xs:documentation>Attempting to install the relevant ISO 2- and 3-letter
+ codes as the enumerated possible values is probably never
+ going to be a realistic possibility. See
+ RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry
+ at http://www.iana.org/assignments/lang-tag-apps.htm for
+ further information.
+
+ The union allows for the 'un-declaration' of xml:lang with
+ the empty string.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:union memberTypes="xs:language">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value=""/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="space">
+ <xs:simpleType>
+ <xs:restriction base="xs:NCName">
+ <xs:enumeration value="default"/>
+ <xs:enumeration value="preserve"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="base" type="xs:anyURI">
+ <xs:annotation>
+ <xs:documentation>See http://www.w3.org/TR/xmlbase/ for
+ information about this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="id" type="xs:ID">
+ <xs:annotation>
+ <xs:documentation>See http://www.w3.org/TR/xml-id/ for
+ information about this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+ <xs:attribute ref="xml:base"/>
+ <xs:attribute ref="xml:lang"/>
+ <xs:attribute ref="xml:space"/>
+ </xs:attributeGroup>
+
+</xs:schema>
diff --git a/ext/soap/tests/classmap.wsdl b/ext/soap/tests/classmap.wsdl
new file mode 100644
index 0000000..7fcf596
--- /dev/null
+++ b/ext/soap/tests/classmap.wsdl
@@ -0,0 +1,60 @@
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.nothing.com" targetNamespace="http://schemas.nothing.com">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://schemas.nothing.com">
+ <xsd:complexType name="book">
+ <xsd:all>
+ <xsd:element name="a" type="xsd:string"/>
+ <xsd:element name="b" type="xsd:string"/>
+ </xsd:all>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+ <message name="dotestRequest">
+ <part name="dotestReturn" type="tns:book"/>
+ </message>
+ <message name="dotestResponse">
+ <part name="res" type="xsi:string"/>
+ </message>
+ <message name="dotest2Request">
+ <part name="dotest2" type="xsi:string"/>
+ </message>
+ <message name="dotest2Response">
+ <part name="res" type="tns:book"/>
+ </message>
+ <portType name="testPortType">
+ <operation name="dotest">
+ <input message="tns:dotestRequest"/>
+ <output message="tns:dotestResponse"/>
+ </operation>
+ <operation name="dotest2">
+ <input message="tns:dotest2Request"/>
+ <output message="tns:dotest2Response"/>
+ </operation>
+ </portType>
+ <binding name="testBinding" type="tns:testPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="dotest">
+ <soap:operation soapAction="http://localhost:81/test/interface.php?class=test/dotest" style="rpc"/>
+ <input>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://schemas.nothing.com"/>
+ </input>
+ <output>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://schemas.nothing.com"/>
+ </output>
+ </operation>
+ <operation name="dotest2">
+ <soap:operation soapAction="http://localhost:81/test/interface.php?class=test/dotest2" style="rpc"/>
+ <input>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://schemas.nothing.com"/>
+ </input>
+ <output>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://schemas.nothing.com"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="test">
+ <port name="testPort" binding="tns:testBinding">
+ <soap:address location="http://localhost:81/test/interface.php?class=test"/>
+ </port>
+ </service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/classmap001.phpt b/ext/soap/tests/classmap001.phpt
new file mode 100644
index 0000000..247a1de
--- /dev/null
+++ b/ext/soap/tests/classmap001.phpt
@@ -0,0 +1,52 @@
+--TEST--
+SOAP Classmap 1: SoapServer support for classmap
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+ <dotest>
+ <book xsi:type=\"ns1:book\">
+ <a xsi:type=\"xsd:string\">Blaat</a>
+ <b xsi:type=\"xsd:string\">aap</b>
+</book>
+</dotest>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+class test{
+ function dotest(book $book){
+ $classname=get_class($book);
+ return "Classname: ".$classname;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+$options=Array(
+ 'actor' =>'http://schema.nothing.com',
+ 'classmap' => array('book'=>'book', 'wsdltype2'=>'classname2')
+ );
+
+$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options);
+$server->setClass("test");
+$server->handle($GLOBALS['HTTP_RAW_POST_DATA']);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotestResponse><res xsi:type="xsd:string">Classname: book</res></ns1:dotestResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/classmap002.phpt b/ext/soap/tests/classmap002.phpt
new file mode 100644
index 0000000..d79deb6
--- /dev/null
+++ b/ext/soap/tests/classmap002.phpt
@@ -0,0 +1,46 @@
+--TEST--
+SOAP Classmap 2: SoapClient support for classmap
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body>
+<ns1:dotest2Response><res xsi:type="ns1:book">
+ <a xsi:type="xsd:string">Blaat</a>
+ <b xsi:type="xsd:string">aap</b>
+</res>
+</ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+$options=Array(
+ 'actor' =>'http://schema.nothing.com',
+ 'classmap' => array('book'=>'book', 'wsdltype2'=>'classname2')
+ );
+
+$client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options);
+$ret = $client->dotest2("???");
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECT--
+object(book)#2 (2) {
+ ["a"]=>
+ string(5) "Blaat"
+ ["b"]=>
+ string(3) "aap"
+}
+ok
diff --git a/ext/soap/tests/classmap003.phpt b/ext/soap/tests/classmap003.phpt
new file mode 100644
index 0000000..4d0118f
--- /dev/null
+++ b/ext/soap/tests/classmap003.phpt
@@ -0,0 +1,54 @@
+--TEST--
+SOAP Classmap 3: encoding of inherited objects
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled",0);
+
+class A {
+ public $x;
+ function __construct($a){
+ $this->x = $a;
+ }
+}
+
+class B extends A {
+ public $y;
+ function __construct($a){
+ parent::__construct($a);
+ $this->y = $a + 1;
+ }
+}
+
+function f(){
+ return new B(5);
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction("f");
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)."/classmap003.wsdl",
+ array('classmap'=>array('A'=>'A','B'=>'B')));
+print_r($client->f());
+?>
+--EXPECT--
+B Object
+(
+ [y] => 6
+ [x] => 5
+)
diff --git a/ext/soap/tests/classmap003.wsdl b/ext/soap/tests/classmap003.wsdl
new file mode 100755
index 0000000..494c418
--- /dev/null
+++ b/ext/soap/tests/classmap003.wsdl
@@ -0,0 +1,51 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!-- WSDL file generated by Zend Studio. -->
+
+<definitions name="ab" targetNamespace="urn:ab" xmlns:typens="urn:ab" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ab">
+ <xsd:complexType name="A">
+ <xsd:sequence>
+ <xsd:element name="x" type="xsd:anyType"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="B">
+ <xsd:complexContent>
+ <xsd:extension base="typens:A">
+ <xsd:sequence>
+ <xsd:element name="y" type="xsd:anyType"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:schema>
+ </types>
+ <message name="f"/>
+ <message name="fResponse">
+ <part name="fReturn" type="typens:A"/>
+ </message>
+ <portType name="abServerPortType">
+ <operation name="f">
+ <input message="typens:f"/>
+ <output message="typens:fResponse"/>
+ </operation>
+ </portType>
+ <binding name="abServerBinding" type="typens:abServerPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="f">
+ <soap:operation soapAction="urn:abServerAction"/>
+ <input>
+ <soap:body namespace="urn:ab" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body namespace="urn:ab" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="abService">
+ <port name="abServerPort" binding="typens:abServerBinding">
+ <soap:address location="http://localhost/abServer.php"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/classmap004.phpt b/ext/soap/tests/classmap004.phpt
new file mode 100644
index 0000000..e8bf58a
--- /dev/null
+++ b/ext/soap/tests/classmap004.phpt
@@ -0,0 +1,66 @@
+--TEST--
+SOAP Classmap 4: encoding of objects with __get()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled",0);
+
+class A {
+ public $a;
+ function __construct($a){
+ $this->x = $a;
+ }
+ function __get($name) {
+ return @$this->a[$name];
+ }
+ function __set($name, $val) {
+ $this->a[$name] = $val;
+ }
+ function __unset($name) {
+ unset($this->a[$name]);
+ }
+}
+
+class B extends A {
+ function __construct($a){
+ parent::__construct($a);
+ $this->y = $a + 1;
+ }
+}
+
+function f(){
+ return new B(5);
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction("f");
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)."/classmap003.wsdl",
+ array('classmap'=>array('A'=>'A','B'=>'B')));
+print_r($client->f());
+?>
+--EXPECT--
+B Object
+(
+ [a] => Array
+ (
+ [x] => 5
+ [y] => 6
+ )
+
+)
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_001p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_001p.phpt
new file mode 100644
index 0000000..f88cddd
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_001p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 001 (php/direct): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array("Hello World!"), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><param0 xsi:type="xsd:string">Hello World!</param0></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:type="xsd:string">Hello World!</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_001s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_001s.phpt
new file mode 100644
index 0000000..a25eea5
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_001s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 001 (soap/direct): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(new SoapParam(new SoapVar("Hello World!",XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:type="xsd:string">Hello World!</inputString></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:type="xsd:string">Hello World!</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_001w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_001w.phpt
new file mode 100644
index 0000000..2442933
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_001w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World!");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:type="xsd:string">Hello World!</inputString></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:type="xsd:string">Hello World!</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_002p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_002p.phpt
new file mode 100644
index 0000000..a5c6242
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_002p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 002 (php/direct): echoString(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(""), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><param0 xsi:type="xsd:string"></param0></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:type="xsd:string"></outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_002s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_002s.phpt
new file mode 100644
index 0000000..3a25624
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_002s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 002 (soap/direct): echoString(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(new SoapParam(new SoapVar("",XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:type="xsd:string"></inputString></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:type="xsd:string"></outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_002w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_002w.phpt
new file mode 100644
index 0000000..b2a21f3
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_002w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 002 (php/wsdl): echoString(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:type="xsd:string"></inputString></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:type="xsd:string"></outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt
new file mode 100644
index 0000000..8aadcbb
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 003 (php/direct): echoString(NULL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(NULL), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><param0 xsi:nil="true"/></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:nil="true"/></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_003s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_003s.phpt
new file mode 100644
index 0000000..e215ec1
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_003s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 003 (soap/direct): echoString(NULL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(new SoapParam(new SoapVar(NULL,XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:nil="true"/></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:nil="true"/></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_003w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_003w.phpt
new file mode 100644
index 0000000..7dbaa23
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_003w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 003 (php/wsdl): echoString(NULL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString(NULL);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:nil="true"/></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:nil="true"/></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_004p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_004p.phpt
new file mode 100644
index 0000000..cb56ce6
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_004p.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 004 (php/direct): echoString(entities)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(">,<,&,\",',\\,\n"), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><param0 xsi:type="xsd:string">&gt;,&lt;,&amp;,",',\,
+</param0></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:type="xsd:string">&gt;,&lt;,&amp;,",',\,
+</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_004s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_004s.phpt
new file mode 100644
index 0000000..20c899e
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_004s.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 004 (soap/direct): echoString(entities)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(new SoapParam(new SoapVar(">,<,&,\",',\\,\n",XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:type="xsd:string">&gt;,&lt;,&amp;,",',\,
+</inputString></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:type="xsd:string">&gt;,&lt;,&amp;,",',\,
+</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_004w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_004w.phpt
new file mode 100644
index 0000000..2843519
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_004w.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round2 base 004 (php/wsdl): echoString(entities)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString(">,<,&,\",',\\,\n");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:type="xsd:string">&gt;,&lt;,&amp;,",',\,
+</inputString></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:type="xsd:string">&gt;,&lt;,&amp;,",',\,
+</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_005p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_005p.phpt
new file mode 100644
index 0000000..22bab4e
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_005p.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round2 base 005 (php/direct): echoString(utf-8)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php if (!function_exists('utf8_encode')) die('skip utf8_encode() not available'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(utf8_encode('ỗÈéóÒ₧⅜ỗỸ')), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><param0 xsi:type="xsd:string">ỗÈéóÒ₧⅜ỗỸ</param0></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:type="xsd:string">ỗÈéóÒ₧⅜ỗỸ</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_005s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_005s.phpt
new file mode 100644
index 0000000..f94c06f
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_005s.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round2 base 005 (soap/direct): echoString(utf-8)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php if (!function_exists('utf8_encode')) die('skip utf8_encode() not available'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(new SoapParam(new SoapVar(utf8_encode('ỗÈéóÒ₧⅜ỗỸ'),XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:type="xsd:string">ỗÈéóÒ₧⅜ỗỸ</inputString></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:type="xsd:string">ỗÈéóÒ₧⅜ỗỸ</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_005w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_005w.phpt
new file mode 100644
index 0000000..3bb1368
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_005w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round2 base 005 (php/wsdl): echoString(utf-8)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php if (!function_exists('utf8_encode')) die('skip utf8_encode() not available'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString(utf8_encode('ỗÈéóÒ₧⅜ỗỸ'));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:type="xsd:string">ỗÈéóÒ₧⅜ỗỸ</inputString></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:type="xsd:string">ỗÈéóÒ₧⅜ỗỸ</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt
new file mode 100644
index 0000000..a85d3c4
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 006 (php/direct): echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array(array('good','bad')), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 SOAP-ENC:arrayType="xsd:string[2]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></param0></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_006s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_006s.phpt
new file mode 100644
index 0000000..8ea498a
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_006s.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round2 base 006 (soap/direct): echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar('good', XSD_STRING),
+ new SoapVar('bad', XSD_STRING)
+ ), SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd"), "inputStringArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></inputStringArray></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_006w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_006w.phpt
new file mode 100644
index 0000000..6b63f45
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_006w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 006 (php/wsdl): echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(array('good','bad'));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></inputStringArray></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_007p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_007p.phpt
new file mode 100644
index 0000000..bfa5e1c
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_007p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 007 (php/direct): echoStringArray(one)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array(array('good')), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 SOAP-ENC:arrayType="xsd:string[1]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">good</item></param0></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_007s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_007s.phpt
new file mode 100644
index 0000000..6d46588
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_007s.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round2 base 007 (soap/direct): echoStringArray(one)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar('good', XSD_STRING)
+ ), SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd"), "inputStringArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></inputStringArray></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_007w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_007w.phpt
new file mode 100644
index 0000000..53a9161
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_007w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 007 (php/wsdl): echoStringArray(one)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(array('good'));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></inputStringArray></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_008p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_008p.phpt
new file mode 100644
index 0000000..2112558
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_008p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 008 (php/direct): echoStringArray(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array(array()), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 SOAP-ENC:arrayType="xsd:ur-type[0]" xsi:type="SOAP-ENC:Array"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_008s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_008s.phpt
new file mode 100644
index 0000000..2bae845
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_008s.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 008 (soap/direct): echoStringArray(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ ), SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd"), "inputStringArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:ur-type[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_008w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_008w.phpt
new file mode 100644
index 0000000..a99a0fc
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_008w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 008 (php/wsdl): echoStringArray(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(array());
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_009p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_009p.phpt
new file mode 100644
index 0000000..bee2f79
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_009p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 009 (php/direct): echoStringArray(NULL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array(NULL), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 xsi:nil="true"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt
new file mode 100644
index 0000000..6aec611
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round2 base 009 (soap/direct): echoStringArray(NULL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(NULL, SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd"), "inputStringArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_009w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_009w.phpt
new file mode 100644
index 0000000..16ae634
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_009w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 009 (php/wsdl): echoStringArray(NULL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(NULL);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_010p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_010p.phpt
new file mode 100644
index 0000000..9c2aa0f
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_010p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 010 (php/direct): echoInteger
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoInteger", array(34345), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoInteger><param0 xsi:type="xsd:int">34345</param0></ns1:echoInteger></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerResponse><outputInteger xsi:type="xsd:int">34345</outputInteger></ns1:echoIntegerResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_010s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_010s.phpt
new file mode 100644
index 0000000..1f012ca
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_010s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 010 (soap/direct): echoInteger
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoInteger", array(new SoapParam(new soapVar(34345, XSD_INT), "inputInteger")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoInteger><inputInteger xsi:type="xsd:int">34345</inputInteger></ns1:echoInteger></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerResponse><outputInteger xsi:type="xsd:int">34345</outputInteger></ns1:echoIntegerResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_010w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_010w.phpt
new file mode 100644
index 0000000..c7689fa
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_010w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 010 (php/wsdl): echoInteger
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoInteger(34345);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoInteger><inputInteger xsi:type="xsd:int">34345</inputInteger></ns1:echoInteger></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerResponse><outputInteger xsi:type="xsd:int">34345</outputInteger></ns1:echoIntegerResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_011p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_011p.phpt
new file mode 100644
index 0000000..739ded9
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_011p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 011 (php/direct): echoIntegerArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoIntegerArray", array(array(1,234324324,2)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArray><param0 SOAP-ENC:arrayType="xsd:int[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></param0></ns1:echoIntegerArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArrayResponse><outputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></outputIntegerArray></ns1:echoIntegerArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_011s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_011s.phpt
new file mode 100644
index 0000000..d7699e2
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_011s.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round2 base 011 (soap/direct): echoIntegerArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar(1,XSD_INT),
+ new SoapVar(234324324,XSD_INT),
+ new SoapVar(2,XSD_INT)
+ ), SOAP_ENC_ARRAY, "ArrayOfint","http://soapinterop.org/xsd"), "inputIntegerArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoIntegerArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArray><inputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></inputIntegerArray></ns1:echoIntegerArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArrayResponse><outputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></outputIntegerArray></ns1:echoIntegerArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_011w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_011w.phpt
new file mode 100644
index 0000000..05b27c8
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_011w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 011 (php/wsdl): echoIntegerArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoIntegerArray(array(1,234324324,2));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArray><inputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></inputIntegerArray></ns1:echoIntegerArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArrayResponse><outputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></outputIntegerArray></ns1:echoIntegerArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_012p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_012p.phpt
new file mode 100644
index 0000000..7cee319
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_012p.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 012 (php/direct): echoFloat
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoFloat", array(342.23), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloat><param0 xsi:type="xsd:float">342.23</param0></ns1:echoFloat></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatResponse><outputFloat xsi:type="xsd:float">342.23</outputFloat></ns1:echoFloatResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_012s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_012s.phpt
new file mode 100644
index 0000000..e004339
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_012s.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 012 (soap/direct): echoFloat
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoFloat", array(new SoapParam(new SoapVar(342.23,XSD_FLOAT),"inputFloat")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloat><inputFloat xsi:type="xsd:float">342.23</inputFloat></ns1:echoFloat></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatResponse><outputFloat xsi:type="xsd:float">342.23</outputFloat></ns1:echoFloatResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_012w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_012w.phpt
new file mode 100644
index 0000000..63a506c
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_012w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round2 base 012 (php/wsdl): echoFloat
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoFloat(342.23);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloat><inputFloat xsi:type="xsd:float">342.23</inputFloat></ns1:echoFloat></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatResponse><outputFloat xsi:type="xsd:float">342.23</outputFloat></ns1:echoFloatResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_013p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_013p.phpt
new file mode 100644
index 0000000..c680182
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_013p.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 013 (php/direct): echoFloatArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoFloatArray", array(array(1.3223,34.2,325.325)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArray><param0 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></param0></ns1:echoFloatArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArrayResponse><outputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></outputFloatArray></ns1:echoFloatArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_013s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_013s.phpt
new file mode 100644
index 0000000..9ebc294
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_013s.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP Interop Round2 base 013 (soap/direct): echoFloatArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar(1.3223, XSD_FLOAT),
+ new SoapVar(34.2, XSD_FLOAT),
+ new SoapVar(325.325, XSD_FLOAT)
+ ), SOAP_ENC_ARRAY, "ArrayOffloat","http://soapinterop.org/xsd"), "inputFloatArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoFloatArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArray><inputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></inputFloatArray></ns1:echoFloatArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArrayResponse><outputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></outputFloatArray></ns1:echoFloatArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_013w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_013w.phpt
new file mode 100644
index 0000000..6c28380
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_013w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round2 base 013 (php/wsdl): echoFloatArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoFloatArray(array(1.3223,34.2,325.325));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArray><inputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></inputFloatArray></ns1:echoFloatArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArrayResponse><outputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></outputFloatArray></ns1:echoFloatArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt
new file mode 100644
index 0000000..61a2213
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP Interop Round2 base 014 (php/direct): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStruct", array(new SOAPStruct('arg',34,325.325)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><param0 xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></param0></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><outputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></outputStruct></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_014s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_014s.phpt
new file mode 100644
index 0000000..681f604
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_014s.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP Interop Round2 base 014 (soap/direct): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar('arg', XSD_STRING, null, null, 'varString'),
+ new SoapVar('34', XSD_INT, null, null, 'varInt'),
+ new SoapVar('325.325', XSD_FLOAT, null, null, 'varFloat')
+ ),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), "inputStruct");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStruct", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></inputStruct></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><outputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></outputStruct></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt
new file mode 100644
index 0000000..b03cc19
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Interop Round2 base 014 (php/wsdl): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStruct(new SOAPStruct('arg',34,325.325));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></inputStruct></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><outputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></outputStruct></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt
new file mode 100644
index 0000000..930c277
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP Interop Round2 base 015 (php/direct): echoStructArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+
+$struct1 = new SOAPStruct('arg',34,325.325);
+$struct2 = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStructArray", array(array($struct1,$struct2)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArray><param0 SOAP-ENC:arrayType="SOAP-ENC:Struct[2]" xsi:type="SOAP-ENC:Array"><item xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></param0></ns1:echoStructArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArrayResponse><outputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></outputStructArray></ns1:echoStructArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt
new file mode 100644
index 0000000..e1052df
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt
@@ -0,0 +1,44 @@
+--TEST--
+SOAP Interop Round2 base 015 (soap/direct): echoStructArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+
+$struct1 = new SoapVar(array(
+ new SoapVar('arg', XSD_STRING, null, null, 'varString'),
+ new SoapVar('34', XSD_INT, null, null, 'varInt'),
+ new SoapVar('325.325', XSD_FLOAT, null, null, 'varFloat')
+ ),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd");
+$struct2 = new SoapVar(array(
+ new SoapVar('arg', XSD_STRING, null, null, 'varString'),
+ new SoapVar('34', XSD_INT, null, null, 'varInt'),
+ new SoapVar('325.325', XSD_FLOAT, null, null, 'varFloat')
+ ),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd");
+
+$param = new SoapParam(new SoapVar(array(
+ $struct1,
+ $struct2
+ ),SOAP_ENC_ARRAY,"ArrayOfSOAPStruct","http://soapinterop.org/xsd"), "inputStructArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStructArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArray><inputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></inputStructArray></ns1:echoStructArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArrayResponse><outputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></outputStructArray></ns1:echoStructArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt
new file mode 100644
index 0000000..46b8d7d
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP Interop Round2 base 015 (php/wsdl): echoStructArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+
+$struct1 = new SOAPStruct('arg',34,325.325);
+$struct2 = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStructArray(array($struct1,$struct2));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArray><inputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></inputStructArray></ns1:echoStructArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArrayResponse><outputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></outputStructArray></ns1:echoStructArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_016p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_016p.phpt
new file mode 100644
index 0000000..0c3a028
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_016p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 016 (php/direct): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoid", array(), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_016s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_016s.phpt
new file mode 100644
index 0000000..24cd42b
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_016s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 016 (soap/direct): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoid", array(), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_016w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_016w.phpt
new file mode 100644
index 0000000..11e379c
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_016w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 016 (php/wsdl): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoVoid();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_017p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_017p.phpt
new file mode 100644
index 0000000..5f6b3c3
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_017p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 017 (php/direct): echoBase64
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBase64", array('Nebraska'), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBase64><param0 xsi:type="xsd:string">Nebraska</param0></ns1:echoBase64></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBase64Response><outputBase64 xsi:type="xsd:base64Binary">TmVicmFza2E=</outputBase64></ns1:echoBase64Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_017s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_017s.phpt
new file mode 100644
index 0000000..3e3c6e1
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_017s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 017 (soap/direct): echoBase64
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBase64", array(new SoapParam(new SoapVar('Nebraska',XSD_BASE64BINARY),"inputBase64")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBase64><inputBase64 xsi:type="xsd:base64Binary">TmVicmFza2E=</inputBase64></ns1:echoBase64></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBase64Response><outputBase64 xsi:type="xsd:base64Binary">TmVicmFza2E=</outputBase64></ns1:echoBase64Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_017w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_017w.phpt
new file mode 100644
index 0000000..e82360e
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_017w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 017 (php/wsdl): echoBase64
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBase64('Nebraska');
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBase64><inputBase64 xsi:type="xsd:base64Binary">TmVicmFza2E=</inputBase64></ns1:echoBase64></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBase64Response><outputBase64 xsi:type="xsd:base64Binary">TmVicmFza2E=</outputBase64></ns1:echoBase64Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_018p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_018p.phpt
new file mode 100644
index 0000000..3738148
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_018p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 018 (php/direct): echoHexBinary
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoHexBinary", array('soapx4'), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoHexBinary><param0 xsi:type="xsd:string">soapx4</param0></ns1:echoHexBinary></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoHexBinaryResponse><outputHexBinary xsi:type="xsd:hexBinary">736F61707834</outputHexBinary></ns1:echoHexBinaryResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_018s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_018s.phpt
new file mode 100644
index 0000000..a531069
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_018s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 018 (soap/direct): echoHexBinary
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoHexBinary", array(new SoapParam(new SoapVar('soapx4',XSD_HEXBINARY),"inputHexBinary")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoHexBinary><inputHexBinary xsi:type="xsd:hexBinary">736F61707834</inputHexBinary></ns1:echoHexBinary></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoHexBinaryResponse><outputHexBinary xsi:type="xsd:hexBinary">736F61707834</outputHexBinary></ns1:echoHexBinaryResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_018w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_018w.phpt
new file mode 100644
index 0000000..2c0380f
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_018w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 018 (php/wsdl): echoHexBinary
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoHexBinary('soapx4');
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoHexBinary><inputHexBinary xsi:type="xsd:hexBinary">736F61707834</inputHexBinary></ns1:echoHexBinary></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoHexBinaryResponse><outputHexBinary xsi:type="xsd:hexBinary">736F61707834</outputHexBinary></ns1:echoHexBinaryResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_019p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_019p.phpt
new file mode 100644
index 0000000..a767301
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_019p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 019 (php/direct): echoDecimal
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoDecimal", array('12345.67890'), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoDecimal><param0 xsi:type="xsd:string">12345.67890</param0></ns1:echoDecimal></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoDecimalResponse><outputDecimal xsi:type="xsd:decimal">12345.67890</outputDecimal></ns1:echoDecimalResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_019s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_019s.phpt
new file mode 100644
index 0000000..56bea8b
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_019s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 019 (soap/direct): echoDecimal
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoDecimal", array(new SoapParam(new SoapVar('12345.67890',XSD_DECIMAL), "inputDecimal")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoDecimal><inputDecimal xsi:type="xsd:decimal">12345.67890</inputDecimal></ns1:echoDecimal></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoDecimalResponse><outputDecimal xsi:type="xsd:decimal">12345.67890</outputDecimal></ns1:echoDecimalResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_019w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_019w.phpt
new file mode 100644
index 0000000..45278ef
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_019w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 019 (php/wsdl): echoDecimal
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoDecimal('12345.67890');
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoDecimal><inputDecimal xsi:type="xsd:decimal">12345.67890</inputDecimal></ns1:echoDecimal></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoDecimalResponse><outputDecimal xsi:type="xsd:decimal">12345.67890</outputDecimal></ns1:echoDecimalResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_020p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_020p.phpt
new file mode 100644
index 0000000..4afe922
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_020p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 020 (php/direct): echoDate
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoDate", array('2001-05-24T17:31:41Z'), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoDate><param0 xsi:type="xsd:string">2001-05-24T17:31:41Z</param0></ns1:echoDate></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoDateResponse><outputDate xsi:type="xsd:dateTime">2001-05-24T17:31:41Z</outputDate></ns1:echoDateResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_020s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_020s.phpt
new file mode 100644
index 0000000..6ced748
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_020s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 020 (soap/direct): echoDate
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoDate", array(new SoapParam(new SoapVar('2001-05-24T17:31:41Z', XSD_DATETIME), "inputDate")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoDate><inputDate xsi:type="xsd:dateTime">2001-05-24T17:31:41Z</inputDate></ns1:echoDate></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoDateResponse><outputDate xsi:type="xsd:dateTime">2001-05-24T17:31:41Z</outputDate></ns1:echoDateResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_020w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_020w.phpt
new file mode 100644
index 0000000..787d1e9
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_020w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 020 (php/wsdl): echoDate
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoDate('2001-05-24T17:31:41Z');
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoDate><inputDate xsi:type="xsd:dateTime">2001-05-24T17:31:41Z</inputDate></ns1:echoDate></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoDateResponse><outputDate xsi:type="xsd:dateTime">2001-05-24T17:31:41Z</outputDate></ns1:echoDateResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_021p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_021p.phpt
new file mode 100644
index 0000000..69edf34
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_021p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 021 (php/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(true), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBoolean><param0 xsi:type="xsd:boolean">true</param0></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">true</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_021s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_021s.phpt
new file mode 100644
index 0000000..8f2a66f
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_021s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 021 (soap/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(new SoapParam(new SoapVar(true, XSD_BOOLEAN), "inputBoolean")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBoolean><inputBoolean xsi:type="xsd:boolean">true</inputBoolean></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">true</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_021w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_021w.phpt
new file mode 100644
index 0000000..140a823
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_021w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 021 (php/wsdl): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBoolean(true);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBoolean><inputBoolean xsi:type="xsd:boolean">true</inputBoolean></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">true</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_022p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_022p.phpt
new file mode 100644
index 0000000..07322b9
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_022p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 022 (php/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(false), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBoolean><param0 xsi:type="xsd:boolean">false</param0></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">false</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_022s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_022s.phpt
new file mode 100644
index 0000000..9f4309c
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_022s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 022 (soap/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(new SoapParam(new SoapVar(false, XSD_BOOLEAN), "inputBoolean")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBoolean><inputBoolean xsi:type="xsd:boolean">false</inputBoolean></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">false</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_022w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_022w.phpt
new file mode 100644
index 0000000..699a5f5
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_022w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 022 (php/wsdl): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBoolean(false);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBoolean><inputBoolean xsi:type="xsd:boolean">false</inputBoolean></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">false</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_023p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_023p.phpt
new file mode 100644
index 0000000..65dcad2
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_023p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 023 (php/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(1), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBoolean><param0 xsi:type="xsd:int">1</param0></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">true</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_023s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_023s.phpt
new file mode 100644
index 0000000..8985f38
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_023s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 023 (soap/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(new SoapParam(new SoapVar(1, XSD_BOOLEAN), "inputBoolean")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBoolean><inputBoolean xsi:type="xsd:boolean">true</inputBoolean></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">true</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_023w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_023w.phpt
new file mode 100644
index 0000000..356cdcc
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_023w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 023 (php/wsdl): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBoolean(1);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBoolean><inputBoolean xsi:type="xsd:boolean">true</inputBoolean></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">true</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_024p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_024p.phpt
new file mode 100644
index 0000000..f55f095
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_024p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 024 (php/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(0), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBoolean><param0 xsi:type="xsd:int">0</param0></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">false</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_024s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_024s.phpt
new file mode 100644
index 0000000..f10e762
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_024s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 024 (soap/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(new SoapParam(new SoapVar(0, XSD_BOOLEAN), "inputBoolean")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBoolean><inputBoolean xsi:type="xsd:boolean">false</inputBoolean></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">false</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_024w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_024w.phpt
new file mode 100644
index 0000000..9fde836
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_024w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 024 (php/wsdl): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBoolean(0);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBoolean><inputBoolean xsi:type="xsd:boolean">false</inputBoolean></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">false</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/round2_base.inc b/ext/soap/tests/interop/Round2/Base/round2_base.inc
new file mode 100644
index 0000000..48eaf40
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/round2_base.inc
@@ -0,0 +1,81 @@
+<?php
+class SOAP_Interop_Base {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+ function echoStringArray($inputStringArray)
+ {
+ return $inputStringArray;
+ }
+
+
+ function echoInteger($inputInteger)
+ {
+ return $inputInteger;
+ }
+
+ function echoIntegerArray($inputIntegerArray)
+ {
+ return $inputIntegerArray;
+ }
+
+ function echoFloat($inputFloat)
+ {
+ return $inputFloat;
+ }
+
+ function echoFloatArray($inputFloatArray)
+ {
+ return $inputFloatArray;
+ }
+
+ function echoStruct($inputStruct)
+ {
+ return $inputStruct;
+ }
+
+ function echoStructArray($inputStructArray)
+ {
+ return $inputStructArray;
+ }
+
+ function echoVoid()
+ {
+ return NULL;
+ }
+
+ function echoBase64($b_encoded)
+ {
+ return $b_encoded;
+ }
+
+ function echoDate($timeInstant)
+ {
+ return $timeInstant;
+ }
+
+ function echoHexBinary($hb)
+ {
+ return $hb;
+ }
+
+ function echoDecimal($dec)
+ {
+ return $dec;
+ }
+
+ function echoBoolean($boolean)
+ {
+ return $boolean;
+ }
+
+}
+
+ini_set("soap.wsdl_cache_enabled",0);
+$server = new SoapServer(dirname(__FILE__)."/round2_base.wsdl");
+$server->setClass("SOAP_Interop_Base");
+$server->handle($HTTP_RAW_POST_DATA);
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round2/Base/round2_base.wsdl b/ext/soap/tests/interop/Round2/Base/round2_base.wsdl
new file mode 100644
index 0000000..c7c7031
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/round2_base.wsdl
@@ -0,0 +1,332 @@
+<?xml version="1.0"?>
+<definitions name="InteropTest"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="http://soapinterop.org/"
+ xmlns:s="http://soapinterop.org/xsd"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://soapinterop.org/">
+
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd">
+ <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+ <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
+ <xsd:complexType name="ArrayOfstring">
+ <xsd:complexContent>
+ <xsd:restriction base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="ArrayOfint">
+ <xsd:complexContent>
+ <xsd:restriction base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="ArrayOffloat">
+ <xsd:complexContent>
+ <xsd:restriction base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="SOAPStruct">
+ <xsd:all>
+ <xsd:element name="varString" type="string"/>
+ <xsd:element name="varInt" type="int"/>
+ <xsd:element name="varFloat" type="float"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="ArrayOfSOAPStruct">
+ <xsd:complexContent>
+ <xsd:restriction base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </schema>
+ </types>
+
+ <message name="echoStringRequest">
+ <part name="inputString" type="xsd:string" />
+ </message>
+ <message name="echoStringResponse">
+ <part name="outputString" type="xsd:string" />
+ </message>
+ <message name="echoStringArrayRequest">
+ <part name="inputStringArray" type="s:ArrayOfstring" />
+ </message>
+ <message name="echoStringArrayResponse">
+ <part name="outputStringArray" type="s:ArrayOfstring" />
+ </message>
+ <message name="echoIntegerRequest">
+ <part name="inputInteger" type="xsd:int" />
+ </message>
+ <message name="echoIntegerResponse">
+ <part name="outputInteger" type="xsd:int" />
+ </message>
+ <message name="echoIntegerArrayRequest">
+ <part name="inputIntegerArray" type="s:ArrayOfint" />
+ </message>
+ <message name="echoIntegerArrayResponse">
+ <part name="outputIntegerArray" type="s:ArrayOfint" />
+ </message>
+ <message name="echoFloatRequest">
+ <part name="inputFloat" type="xsd:float" />
+ </message>
+ <message name="echoFloatResponse">
+ <part name="outputFloat" type="xsd:float" />
+ </message>
+ <message name="echoFloatArrayRequest">
+ <part name="inputFloatArray" type="s:ArrayOffloat" />
+ </message>
+ <message name="echoFloatArrayResponse">
+ <part name="outputFloatArray" type="s:ArrayOffloat" />
+ </message>
+ <message name="echoStructRequest">
+ <part name="inputStruct" type="s:SOAPStruct" />
+ </message>
+ <message name="echoStructResponse">
+ <part name="outputStruct" type="s:SOAPStruct" />
+ </message>
+ <message name="echoStructArrayRequest">
+ <part name="inputStructArray" type="s:ArrayOfSOAPStruct" />
+ </message>
+ <message name="echoStructArrayResponse">
+ <part name="outputStructArray" type="s:ArrayOfSOAPStruct" />
+ </message>
+ <message name="echoVoidRequest">
+ </message>
+ <message name="echoVoidResponse">
+ </message>
+ <message name="echoBase64Request">
+ <part name="inputBase64" type="xsd:base64Binary" />
+ </message>
+ <message name="echoBase64Response">
+ <part name="outputBase64" type="xsd:base64Binary" />
+ </message>
+ <message name="echoDateRequest">
+ <part name="inputDate" type="xsd:dateTime" />
+ </message>
+ <message name="echoDateResponse">
+ <part name="outputDate" type="xsd:dateTime" />
+ </message>
+ <message name="echoHexBinaryRequest">
+ <part name="inputHexBinary" type="xsd:hexBinary" />
+ </message>
+ <message name="echoHexBinaryResponse">
+ <part name="outputHexBinary" type="xsd:hexBinary" />
+ </message>
+ <message name="echoDecimalRequest">
+ <part name="inputDecimal" type="xsd:decimal" />
+ </message>
+ <message name="echoDecimalResponse">
+ <part name="outputDecimal" type="xsd:decimal" />
+ </message>
+ <message name="echoBooleanRequest">
+ <part name="inputBoolean" type="xsd:boolean" />
+ </message>
+ <message name="echoBooleanResponse">
+ <part name="outputBoolean" type="xsd:boolean" />
+ </message>
+
+ <portType name="InteropTestPortType">
+ <operation name="echoString">
+ <input message="tns:echoStringRequest"/>
+ <output message="tns:echoStringResponse"/>
+ </operation>
+ <operation name="echoStringArray">
+ <input message="tns:echoStringArrayRequest"/>
+ <output message="tns:echoStringArrayResponse"/>
+ </operation>
+ <operation name="echoInteger">
+ <input message="tns:echoIntegerRequest"/>
+ <output message="tns:echoIntegerResponse"/>
+ </operation>
+ <operation name="echoIntegerArray">
+ <input message="tns:echoIntegerArrayRequest"/>
+ <output message="tns:echoIntegerArrayResponse"/>
+ </operation>
+ <operation name="echoFloat">
+ <input message="tns:echoFloatRequest"/>
+ <output message="tns:echoFloatResponse"/>
+ </operation>
+ <operation name="echoFloatArray">
+ <input message="tns:echoFloatArrayRequest"/>
+ <output message="tns:echoFloatArrayResponse"/>
+ </operation>
+ <operation name="echoStruct">
+ <input message="tns:echoStructRequest"/>
+ <output message="tns:echoStructResponse"/>
+ </operation>
+ <operation name="echoStructArray">
+ <input message="tns:echoStructArrayRequest"/>
+ <output message="tns:echoStructArrayResponse"/>
+ </operation>
+ <operation name="echoVoid">
+ <input message="tns:echoVoidRequest"/>
+ <output message="tns:echoVoidResponse"/>
+ </operation>
+ <operation name="echoBase64">
+ <input message="tns:echoBase64Request"/>
+ <output message="tns:echoBase64Response"/>
+ </operation>
+ <operation name="echoDate">
+ <input message="tns:echoDateRequest"/>
+ <output message="tns:echoDateResponse"/>
+ </operation>
+ <operation name="echoHexBinary">
+ <input message="tns:echoHexBinaryRequest"/>
+ <output message="tns:echoHexBinaryResponse"/>
+ </operation>
+ <operation name="echoDecimal">
+ <input message="tns:echoDecimalRequest"/>
+ <output message="tns:echoDecimalResponse"/>
+ </operation>
+ <operation name="echoBoolean">
+ <input message="tns:echoBooleanRequest"/>
+ <output message="tns:echoBooleanResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="InteropTestBinding" type="tns:InteropTestPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStringArray">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoInteger">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoIntegerArray">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoFloat">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoFloatArray">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStructArray">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoVoid">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoBase64">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoDate">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoHexBinary">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoDecimal">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoBoolean">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="InteropTest">
+ <port name="InteropTestPort" binding="tns:InteropTestBinding">
+ <soap:address location="round2_base.inc"/>
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/interop/Round2/Base/skipif.inc b/ext/soap/tests/interop/Round2/Base/skipif.inc
new file mode 100644
index 0000000..fa8574e
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt
new file mode 100644
index 0000000..88080cf
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 groupB 001 (php/direct): echoStructAsSimpleTypes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStructAsSimpleTypes", array((object)array('varString'=>"arg",'varInt'=>34,'varFloat'=>34.345)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypes><param0 xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></param0></ns1:echoStructAsSimpleTypes></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypesResponse><outputString xsi:type="xsd:string">arg</outputString><outputInteger xsi:type="xsd:int">34</outputInteger><outputFloat xsi:type="xsd:float">34.345</outputFloat></ns1:echoStructAsSimpleTypesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001s.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001s.phpt
new file mode 100644
index 0000000..3f59200
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001s.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP Interop Round2 groupB 001 (soap/direct): echoStructAsSimpleTypes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar("arg", XSD_STRING, null, null, "varString"),
+ new SoapVar(34, XSD_INT, null, null, "varInt"),
+ new SoapVar(34.345, XSD_FLOAT, null, null, "varFloat")
+ ), SOAP_ENC_OBJECT, "SOAPStruct", "http://soapinterop.org/xsd"), "inputStruct");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStructAsSimpleTypes", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypes><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></inputStruct></ns1:echoStructAsSimpleTypes></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypesResponse><outputString xsi:type="xsd:string">arg</outputString><outputInteger xsi:type="xsd:int">34</outputInteger><outputFloat xsi:type="xsd:float">34.345</outputFloat></ns1:echoStructAsSimpleTypesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001w.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001w.phpt
new file mode 100644
index 0000000..2d7fb63
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round2 groupB 001 (php/wsdl): echoStructAsSimpleTypes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStructAsSimpleTypes((object)array('varString'=>"arg",'varInt'=>34,'varFloat'=>34.345));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypes><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></inputStruct></ns1:echoStructAsSimpleTypes></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypesResponse><outputString xsi:type="xsd:string">arg</outputString><outputInteger xsi:type="xsd:int">34</outputInteger><outputFloat xsi:type="xsd:float">34.345</outputFloat></ns1:echoStructAsSimpleTypesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002p.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002p.phpt
new file mode 100644
index 0000000..3dba334
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002p.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 groupB 002 (php/direct): echoSimpleTypesAsStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoSimpleTypesAsStruct", array("arg",34,34.345), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStruct><param0 xsi:type="xsd:string">arg</param0><param1 xsi:type="xsd:int">34</param1><param2 xsi:type="xsd:float">34.345</param2></ns1:echoSimpleTypesAsStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStructResponse><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></return></ns1:echoSimpleTypesAsStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002s.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002s.phpt
new file mode 100644
index 0000000..bda5baa
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002s.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round2 groupB 002 (soap/direct): echoSimpleTypesAsStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoSimpleTypesAsStruct", array(
+ new SoapParam(new SoapVar("arg",XSD_STRING), "inputString"),
+ new SoapParam(new SoapVar(34,XSD_INT), "inputInteger"),
+ new SoapParam(new SoapVar(34.345,XSD_FLOAT), "inputFloat")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStruct><inputString xsi:type="xsd:string">arg</inputString><inputInteger xsi:type="xsd:int">34</inputInteger><inputFloat xsi:type="xsd:float">34.345</inputFloat></ns1:echoSimpleTypesAsStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStructResponse><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></return></ns1:echoSimpleTypesAsStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002w.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002w.phpt
new file mode 100644
index 0000000..c2b0c05
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round2 groupB 002 (php/wsdl): echoSimpleTypesAsStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoSimpleTypesAsStruct("arg",34,34.345);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStruct><inputString xsi:type="xsd:string">arg</inputString><inputInteger xsi:type="xsd:int">34</inputInteger><inputFloat xsi:type="xsd:float">34.345</inputFloat></ns1:echoSimpleTypesAsStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStructResponse><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></return></ns1:echoSimpleTypesAsStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003p.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003p.phpt
new file mode 100644
index 0000000..417ae10
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003p.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round2 groupB 003 (php/direct): echo2DStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = array(
+ array('row0col0', 'row0col1', 'row0col2'),
+ array('row1col0', 'row1col1', 'row1col2'));
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echo2DStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArray><param0 SOAP-ENC:arrayType="SOAP-ENC:Array[2]" xsi:type="SOAP-ENC:Array"><item SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item></item><item SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></item></param0></ns1:echo2DStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArrayResponse><return SOAP-ENC:arrayType="xsd:string[2,3]" xsi:type="ns2:ArrayOfString2D"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></return></ns1:echo2DStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003s.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003s.phpt
new file mode 100644
index 0000000..59f2134
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003s.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP Interop Round2 groupB 003 (soap/direct): echo2DStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar(array(
+ new SoapVar('row0col0', XSD_STRING),
+ new SoapVar('row0col1', XSD_STRING),
+ new SoapVar('row0col2', XSD_STRING)
+ ), SOAP_ENC_ARRAY),
+ new SoapVar(array(
+ new SoapVar('row1col0', XSD_STRING),
+ new SoapVar('row1col1', XSD_STRING),
+ new SoapVar('row1col2', XSD_STRING)
+ ), SOAP_ENC_ARRAY)
+ ), SOAP_ENC_ARRAY, "ArrayOfString2D", "http://soapinterop.org/xsd"),"input2DStringArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echo2DStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArray><input2DStringArray SOAP-ENC:arrayType="SOAP-ENC:Array[2]" xsi:type="ns2:ArrayOfString2D"><item SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item></item><item SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></item></input2DStringArray></ns1:echo2DStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArrayResponse><return SOAP-ENC:arrayType="xsd:string[2,3]" xsi:type="ns2:ArrayOfString2D"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></return></ns1:echo2DStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003w.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003w.phpt
new file mode 100644
index 0000000..cb89dc0
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003w.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round2 groupB 003 (php/wsdl): echo2DStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$param = array(
+ array('row0col0', 'row0col1', 'row0col2'),
+ array('row1col0', 'row1col1', 'row1col2'));
+$client = new SoapClient(dirname(__FILE__)."/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echo2DStringArray($param);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArray><input2DStringArray SOAP-ENC:arrayType="xsd:string[2,3]" xsi:type="ns2:ArrayOfString2D"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></input2DStringArray></ns1:echo2DStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArrayResponse><return SOAP-ENC:arrayType="xsd:string[2,3]" xsi:type="ns2:ArrayOfString2D"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></return></ns1:echo2DStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004p.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004p.phpt
new file mode 100644
index 0000000..fb5f485
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004p.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP Interop Round2 groupB 004 (php/direct): echoNestedStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$param = (object)array(
+ 'varString' => "arg",
+ 'varInt' => 34,
+ 'varFloat' => 123.45,
+ 'varStruct' => (object)array(
+ 'varString' => "arg2",
+ 'varInt' => 342,
+ 'varFloat' => 123.452,
+ ));
+
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoNestedStruct", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStruct><param0 xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></param0></ns1:echoNestedStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStructResponse><return xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></return></ns1:echoNestedStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004s.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004s.phpt
new file mode 100644
index 0000000..126bdff
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004s.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP Interop Round2 groupB 004 (soap/direct): echoNestedStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar("arg", XSD_STRING, null, null, "varString"),
+ new SoapVar(34, XSD_INT, null, null, "varInt"),
+ new SoapVar(123.45, XSD_FLOAT, null, null, "varFloat"),
+ new SoapVar(array(
+ new SoapVar("arg2", XSD_STRING, null, null, "varString"),
+ new SoapVar(342, XSD_INT, null, null, "varInt"),
+ new SoapVar(123.452, XSD_FLOAT, null, null, "varFloat")
+ ), SOAP_ENC_OBJECT, "SOAPStruct", "http://soapinterop.org/xsd", 'varStruct')
+ ), SOAP_ENC_OBJECT, "SOAPStructStruct", "http://soapinterop.org/xsd"), "inputStruct");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoNestedStruct", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStruct><inputStruct xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></inputStruct></ns1:echoNestedStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStructResponse><return xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></return></ns1:echoNestedStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004w.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004w.phpt
new file mode 100644
index 0000000..a51ab2b
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004w.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP Interop Round2 groupB 004 (php/wsdl): echoNestedStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$param = (object)array(
+ 'varString' => "arg",
+ 'varInt' => 34,
+ 'varFloat' => 123.45,
+ 'varStruct' => (object)array(
+ 'varString' => "arg2",
+ 'varInt' => 342,
+ 'varFloat' => 123.452,
+ ));
+
+$client = new SoapClient(dirname(__FILE__)."/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoNestedStruct($param);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStruct><inputStruct xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></inputStruct></ns1:echoNestedStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStructResponse><return xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></return></ns1:echoNestedStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005p.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005p.phpt
new file mode 100644
index 0000000..3dd17e6
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005p.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP Interop Round2 groupB 005 (php/direct): echoNestedArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$param = (object)array(
+ 'varString'=>'arg',
+ 'varInt'=>34,
+ 'varFloat'=>325.325,
+ 'varArray' => array('red','blue','green'));
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoNestedArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArray><param0 xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></param0></ns1:echoNestedArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArrayResponse><return xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></return></ns1:echoNestedArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005s.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005s.phpt
new file mode 100644
index 0000000..e8cacfa
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005s.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP Interop Round2 groupB 005 (soap/direct): echoNestedArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar("arg", XSD_STRING, null, null, "varString"),
+ new SoapVar(34, XSD_INT, null, null, "varInt"),
+ new SoapVar(325.325, XSD_FLOAT, null, null, "varFloat"),
+ new SoapVar(array(
+ new SoapVar("red", XSD_STRING),
+ new SoapVar("blue", XSD_STRING),
+ new SoapVar("green", XSD_STRING),
+ ), SOAP_ENC_ARRAY, "ArrayOfString", "http://soapinterop.org/xsd", 'varArray')
+ ), SOAP_ENC_OBJECT, "SOAPArrayStruct", "http://soapinterop.org/xsd"), "inputStruct");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoNestedArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArray><inputStruct xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></inputStruct></ns1:echoNestedArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArrayResponse><return xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></return></ns1:echoNestedArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005w.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005w.phpt
new file mode 100644
index 0000000..e11051f
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round2 groupB 005 (php/wsdl): echoNestedArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$param = (object)array(
+ 'varString'=>'arg',
+ 'varInt'=>34,
+ 'varFloat'=>325.325,
+ 'varArray' => array('red','blue','green'));
+$client = new SoapClient(dirname(__FILE__)."/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoNestedArray($param);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArray><inputStruct xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></inputStruct></ns1:echoNestedArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArrayResponse><return xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></return></ns1:echoNestedArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/round2_groupB.inc b/ext/soap/tests/interop/Round2/GroupB/round2_groupB.inc
new file mode 100644
index 0000000..77b8127
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/round2_groupB.inc
@@ -0,0 +1,38 @@
+<?php
+class SOAP_Interop_GroupB {
+
+ function echoStructAsSimpleTypes ($struct)
+ {
+ return array('outputString' => $struct->varString,
+ 'outputInteger' => $struct->varInt,
+ 'outputFloat' => $struct->varFloat);
+ }
+
+ function echoSimpleTypesAsStruct($string, $int, $float)
+ {
+ return (object)array("varString" => $string,
+ "varInt" => $int,
+ "varFloat" => $float);
+ }
+
+ function echoNestedStruct($struct)
+ {
+ return $struct;
+ }
+
+ function echo2DStringArray($ary)
+ {
+ return $ary;
+ }
+
+ function echoNestedArray($ary)
+ {
+ return $ary;
+ }
+}
+
+ini_set("soap.wsdl_cache_enabled",0);
+$server = new SoapServer(dirname(__FILE__)."/round2_groupB.wsdl");
+$server->setClass("SOAP_Interop_GroupB");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round2/GroupB/round2_groupB.wsdl b/ext/soap/tests/interop/Round2/GroupB/round2_groupB.wsdl
new file mode 100644
index 0000000..8fc2a1b
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/round2_groupB.wsdl
@@ -0,0 +1,192 @@
+<?xml version="1.0"?>
+<definitions name="InteropTest"
+ targetNamespace="http://soapinterop.org/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="http://soapinterop.org/"
+ xmlns:s="http://soapinterop.org/xsd"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://soapinterop.org/xsd">
+
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+
+ <complexType name="ArrayOfstring">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOfint">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOffloat">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOfSOAPStruct">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varString" type="string" nillable="true"/>
+ <element name="varInt" type="int" nillable="true"/>
+ <element name="varFloat" type="float" nillable="true"/>
+ </all>
+ </complexType>
+ <complexType name="SOAPStructStruct">
+ <all>
+ <element name="varString" type="string" nillable="true"/>
+ <element name="varInt" type="int" nillable="true"/>
+ <element name="varFloat" type="float" nillable="true"/>
+ <element name="varStruct" type="s:SOAPStruct"/>
+ </all>
+ </complexType>
+ <complexType name="SOAPArrayStruct">
+ <all>
+ <element name="varString" type="string" nillable="true"/>
+ <element name="varInt" type="int" nillable="true"/>
+ <element name="varFloat" type="float" nillable="true"/>
+ <element name="varArray" type="s:ArrayOfstring"/>
+ </all>
+ </complexType>
+ <complexType name="ArrayOfString2D">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[,]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="echoStructAsSimpleTypesRequest">
+ <part name="inputStruct" type="s:SOAPStruct"/>
+ </message>
+ <message name="echoStructAsSimpleTypesResponse">
+ <part name="outputString" type="xsd:string"/>
+ <part name="outputInteger" type="xsd:int"/>
+ <part name="outputFloat" type="xsd:float"/>
+ </message>
+ <message name="echoSimpleTypesAsStructRequest">
+ <part name="inputString" type="xsd:string"/>
+ <part name="inputInteger" type="xsd:int"/>
+ <part name="inputFloat" type="xsd:float"/>
+ </message>
+ <message name="echoSimpleTypesAsStructResponse">
+ <part name="return" type="s:SOAPStruct"/>
+ </message>
+ <message name="echo2DStringArrayRequest">
+ <part name="input2DStringArray" type="s:ArrayOfString2D"/>
+ </message>
+ <message name="echo2DStringArrayResponse">
+ <part name="return" type="s:ArrayOfString2D"/>
+ </message>
+ <message name="echoNestedStructRequest">
+ <part name="inputStruct" type="s:SOAPStructStruct"/>
+ </message>
+ <message name="echoNestedStructResponse">
+ <part name="return" type="s:SOAPStructStruct"/>
+ </message>
+ <message name="echoNestedArrayRequest">
+ <part name="inputStruct" type="s:SOAPArrayStruct"/>
+ </message>
+ <message name="echoNestedArrayResponse">
+ <part name="return" type="s:SOAPArrayStruct"/>
+ </message>
+
+ <portType name="InteropTestPortTypeB">
+ <operation name="echoStructAsSimpleTypes" parameterOrder="inputStruct outputString outputInteger outputFloat">
+ <input message="tns:echoStructAsSimpleTypesRequest" name="echoStructAsSimpleTypes"/>
+ <output message="tns:echoStructAsSimpleTypesResponse" name="echoStructAsSimpleTypesResponse"/>
+ </operation>
+ <operation name="echoSimpleTypesAsStruct" parameterOrder="inputString inputInteger inputFloat">
+ <input message="tns:echoSimpleTypesAsStructRequest" name="echoSimpleTypesAsStruct"/>
+ <output message="tns:echoSimpleTypesAsStructResponse" name="echoSimpleTypesAsStructResponse"/>
+ </operation>
+ <operation name="echo2DStringArray" parameterOrder="input2DStringArray">
+ <input message="tns:echo2DStringArrayRequest" name="echo2DStringArray"/>
+ <output message="tns:echo2DStringArrayResponse" name="echo2DStringArrayResponse"/>
+ </operation>
+ <operation name="echoNestedStruct" parameterOrder="inputStruct">
+ <input message="tns:echoNestedStructRequest" name="echoNestedStruct"/>
+ <output message="tns:echoNestedStructResponse" name="echoNestedStructResponse"/>
+ </operation>
+ <operation name="echoNestedArray" parameterOrder="inputStruct">
+ <input message="tns:echoNestedArrayRequest" name="echoNestedArray"/>
+ <output message="tns:echoNestedArrayResponse" name="echoNestedArrayResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="InteropTestSoapBindingB" type="tns:InteropTestPortTypeB">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoStructAsSimpleTypes">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoSimpleTypesAsStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echo2DStringArray">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoNestedStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoNestedArray">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="interopLabB">
+ <port name="interopTestPortB" binding="tns:InteropTestSoapBindingB">
+ <soap:address location="round2_groupB.inc"/>
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/interop/Round2/GroupB/skipif.inc b/ext/soap/tests/interop/Round2/GroupB/skipif.inc
new file mode 100644
index 0000000..fa8574e
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round3/GroupD/imported/import1B.wsdl b/ext/soap/tests/interop/Round3/GroupD/imported/import1B.wsdl
new file mode 100644
index 0000000..26ab6db
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/imported/import1B.wsdl
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop.org/definitions/"
+ xmlns:wsdlns="http://soapinterop.org/definitions/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types/>
+ <message name="echoStringRequest">
+ <part name="x" type="xsd:string"/>
+ </message>
+ <message name="echoStringResponse">
+ <part name="Result" type="xsd:string"/>
+ </message>
+ <portType name="SoapInteropImport1PortType">
+ <operation name="echoString" parameterOrder="x">
+ <input message="wsdlns:echoStringRequest"/>
+ <output message="wsdlns:echoStringResponse"/>
+ </operation>
+ </portType>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/imported/import2B.wsdl b/ext/soap/tests/interop/Round3/GroupD/imported/import2B.wsdl
new file mode 100644
index 0000000..8a397bc
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/imported/import2B.wsdl
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop.org/definitions/"
+ xmlns:wsdlns="http://soapinterop.org/definitions/"
+ xmlns:typens="http://soapinterop.org/xsd"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <import location="import2B.xsd" namespace="http://soapinterop.org/xsd" />
+ <message name='Server.echoStruct'>
+ <part name='inputStruct' type='typens:SOAPStruct'/>
+ </message>
+ <message name='Server.echoStructResponse'>
+ <part name='Result' type='typens:SOAPStruct'/>
+ </message>
+
+ <portType name="SoapInteropImport2PortType">
+ <operation name='echoStruct' parameterOrder='inputStruct'>
+ <input message='wsdlns:Server.echoStruct' />
+ <output message='wsdlns:Server.echoStructResponse' />
+ </operation>
+ </portType>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/imported/import2B.xsd b/ext/soap/tests/interop/Round3/GroupD/imported/import2B.xsd
new file mode 100644
index 0000000..b35eded
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/imported/import2B.xsd
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<schema targetNamespace='http://soapinterop.org/xsd'
+ xmlns='http://www.w3.org/2001/XMLSchema'
+ elementFormDefault='unqualified'>
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varString" type="string" />
+ <element name="varInt" type="int" />
+ <element name="varFloat" type="float" />
+ </all>
+ </complexType>
+</schema> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt
new file mode 100644
index 0000000..edff0a4
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP Interop Round3 GroupD Compound1 001 (php/wsdl): echoPerson
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class Person {
+ function Person($a=NULL, $i=NULL, $n=NULL, $m=NULL) {
+ $this->Age = $a;
+ $this->ID = $i;
+ $this->Name = $n;
+ $this->Male = $m;
+ }
+}
+$person = new Person(32,12345,'Shane',TRUE);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_compound1.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoPerson($person);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_compound1.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:x_Person Name="Shane" Male="true"><ns1:Age>32</ns1:Age><ns1:ID>12345</ns1:ID></ns1:x_Person></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:result_Person Name="Shane" Male="true"><ns1:Age>32</ns1:Age><ns1:ID>12345</ns1:ID></ns1:result_Person></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_002w.phpt
new file mode 100644
index 0000000..9b80248
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_002w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD Compound1 002 (php/wsdl): echoDocument
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_compound1.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoDocument("Test Document Here");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_compound1.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:x_Document>Test Document Here</ns1:x_Document></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:result_Document>Test Document Here</ns1:result_Document></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_003w.phpt
new file mode 100644
index 0000000..d8dbf28
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_003w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD Compound1 003 (php/wsdl): echoDocument
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_compound1.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoDocument((object)array("_"=>"Test Document Here","ID"=>1));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_compound1.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:x_Document ID="1">Test Document Here</ns1:x_Document></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:result_Document ID="1">Test Document Here</ns1:result_Document></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt
new file mode 100644
index 0000000..b1a60df
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt
@@ -0,0 +1,40 @@
+--TEST--
+SOAP Interop Round3 GroupD Compound2 001 (php/wsdl): echoEmployee
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class Person {
+ function Person($a=NULL, $i=NULL, $n=NULL, $m=NULL) {
+ $this->Age = $a;
+ $this->ID = $i;
+ $this->Name = $n;
+ $this->Male = $m;
+ }
+}
+class Employee {
+ function Employee($person=NULL,$id=NULL,$salary=NULL) {
+ $this->person = $person;
+ $this->ID = $id;
+ $this->salary = $salary;
+ }
+}
+$person = new Person(32,12345,'Shane',TRUE);
+$employee = new Employee($person,12345,1000000.00);
+
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_compound2.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoEmployee($employee);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_compound2.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/person" xmlns:ns2="http://soapinterop.org/employee"><SOAP-ENV:Body><ns2:x_Employee><ns2:person><ns1:Name>Shane</ns1:Name><ns1:Male>true</ns1:Male></ns2:person><ns2:salary>1000000</ns2:salary><ns2:ID>12345</ns2:ID></ns2:x_Employee></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/person" xmlns:ns2="http://soapinterop.org/employee"><SOAP-ENV:Body><ns2:result_Employee><ns2:person><ns1:Name>Shane</ns1:Name><ns1:Male>true</ns1:Male></ns2:person><ns2:salary>1000000</ns2:salary><ns2:ID>12345</ns2:ID></ns2:result_Employee></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_001w.phpt
new file mode 100644
index 0000000..9f6fc41
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_001w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringParam>Hello World</ns1:echoStringParam></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringReturn>Hello World</ns1:echoStringReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_002w.phpt
new file mode 100644
index 0000000..f3e035e
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_002w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit 002 (php/wsdl): echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(array("one","two","three"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringArrayParam><ns1:string>one</ns1:string><ns1:string>two</ns1:string><ns1:string>three</ns1:string></ns1:echoStringArrayParam></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringArrayReturn><ns1:string>one</ns1:string><ns1:string>two</ns1:string><ns1:string>three</ns1:string></ns1:echoStringArrayReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt
new file mode 100644
index 0000000..2e74e7c
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit 003 (php/wsdl): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStruct($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStructParam><ns1:varFloat>325.325</ns1:varFloat><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString></ns1:echoStructParam></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStructReturn><ns1:varFloat>325.325</ns1:varFloat><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString></ns1:echoStructReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_004w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_004w.phpt
new file mode 100644
index 0000000..32fedea
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_004w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit 004 (php/wsdl): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoVoid();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body/></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body/></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_001w.phpt
new file mode 100644
index 0000000..3fd9c5e
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_001w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit Parameters 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclitparams.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString(array("param0"=>"Hello World"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclitparams.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoString><ns1:param0>Hello World</ns1:param0></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringResponse><ns1:return>Hello World</ns1:return></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_002w.phpt
new file mode 100644
index 0000000..564407d
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_002w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit Parameters 002 (php/wsdl): echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclitparams.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(array("param0"=>array("one","two","three")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclitparams.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringArray><ns1:param0><ns1:string>one</ns1:string><ns1:string>two</ns1:string><ns1:string>three</ns1:string></ns1:param0></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringArrayResponse><ns1:return><ns1:string>one</ns1:string><ns1:string>two</ns1:string><ns1:string>three</ns1:string></ns1:return></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt
new file mode 100644
index 0000000..26ce8de
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit Parameters 003 (php/wsdl): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclitparams.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStruct(array("param0"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclitparams.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStruct><ns1:param0><ns1:varFloat>325.325</ns1:varFloat><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString></ns1:param0></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStructResponse><ns1:return><ns1:varFloat>325.325</ns1:varFloat><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString></ns1:return></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_004w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_004w.phpt
new file mode 100644
index 0000000..79b0ced
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_004w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit Parameters 004 (php/wsdl): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclitparams.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoVoid();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclitparams.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_emptysa_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_emptysa_001w.phpt
new file mode 100644
index 0000000..47e2900
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_emptysa_001w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD EmptySA 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_emptysa.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_emptysa.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><a xsi:type="xsd:string">Hello World</a></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><Result xsi:type="xsd:string">Hello World</Result></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import1_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import1_001w.phpt
new file mode 100644
index 0000000..34eac1c
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import1_001w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD Import1 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_import1.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_import1.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/echoString/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><x xsi:type="xsd:string">Hello World</x></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/echoStringResponse/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><Result xsi:type="xsd:string">Hello World</Result></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt
new file mode 100644
index 0000000..270b30f
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Interop Round3 GroupD Import2 001 (php/wsdl): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_import2.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStruct($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_import2.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></inputStruct></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><Result xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></Result></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt
new file mode 100644
index 0000000..892ef45
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Interop Round3 GroupD Import3 001 (php/wsdl): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_import3.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStruct($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_import3.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></inputStruct></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><Result xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></Result></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt
new file mode 100644
index 0000000..e4279fc
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP Interop Round3 GroupD Import3 002 (php/wsdl): echoStructArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct1 = new SOAPStruct('arg',34,325.325);
+$struct2 = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_import3.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStructArray(array($struct1,$struct2));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_import3.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://soapinterop.org/xsd2" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArray><inputArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns3:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></inputArray></ns1:echoStructArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://soapinterop.org/xsd2" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArrayResponse><Result SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns3:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></Result></ns1:echoStructArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_001w.phpt
new file mode 100644
index 0000000..c70eae0
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_001w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD RPC Encoded 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><param0 xsi:type="xsd:string">Hello World</param0></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><return xsi:type="xsd:string">Hello World</return></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_002w.phpt
new file mode 100644
index 0000000..839afde
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_002w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD RPC Encoded 002 (php/wsdl): echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(array("one","two","three"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param0></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><return SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></return></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt
new file mode 100644
index 0000000..cc27d6f
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Interop Round3 GroupD RPC Encoded 003 (php/wsdl): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStruct($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><param0 xsi:type="ns2:SOAPStruct"><varFloat xsi:type="xsd:float">325.325</varFloat><varInt xsi:type="xsd:int">34</varInt><varString xsi:type="xsd:string">arg</varString></param0></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><return xsi:type="ns2:SOAPStruct"><varFloat xsi:type="xsd:float">325.325</varFloat><varInt xsi:type="xsd:int">34</varInt><varString xsi:type="xsd:string">arg</varString></return></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_004w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_004w.phpt
new file mode 100644
index 0000000..a6cbbe8
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_004w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupD RPC Encoded 004 (php/wsdl): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoVoid();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.inc
new file mode 100644
index 0000000..8e28669
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.inc
@@ -0,0 +1,17 @@
+<?php
+class SOAP_Interop_GroupD {
+ function echoPerson($person)
+ {
+ return $person;
+ }
+
+ function echoDocument($doc)
+ {
+ return $doc;
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_compound1.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.wsdl
new file mode 100644
index 0000000..6a8f851
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.wsdl
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInteropCompound"
+ targetNamespace="http://soapinterop.org/"
+ xmlns:wsdlns="http://soapinterop.org/"
+ xmlns:typens="http://soapinterop.org/xsd"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ >
+ <complexType name="Person">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" name="Age" type="double"/>
+ <element minOccurs="1" maxOccurs="1" name="ID" type="xsd:float"/>
+ </sequence>
+ <attribute name="Name" type="string"/>
+ <attribute name="Male" type="boolean"/>
+ </complexType>
+ <element name="x_Person" type="typens:Person"/>
+ <element name="result_Person" type="typens:Person"/>
+
+ <complexType name="Document">
+ <simpleContent>
+ <extension base="string">
+ <xsd:attribute name ="ID" type="string"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <element name="x_Document" type="typens:Document"/>
+ <element name="result_Document" type="typens:Document"/>
+ </schema>
+ </types>
+ <message name="echoPerson">
+ <part name="x" element="typens:x_Person"/>
+ </message>
+ <message name="echoPersonResponse">
+ <part name="Result" element="typens:result_Person"/>
+ </message>
+ <message name="echoDocument">
+ <part name="x" element="typens:x_Document"/>
+ </message>
+ <message name="echoDocumentResponse">
+ <part name="Result" element="typens:result_Document"/>
+ </message>
+ <portType name="SoapInteropCompound1PortType">
+ <operation name="echoPerson" parameterOrder="x">
+ <input message="wsdlns:echoPerson"/>
+ <output message="wsdlns:echoPersonResponse"/>
+ </operation>
+ <operation name="echoDocument" parameterOrder="x">
+ <input message="wsdlns:echoDocument"/>
+ <output message="wsdlns:echoDocumentResponse"/>
+ </operation>
+ </portType>
+ <binding name="SoapInteropCompound1Binding" type="wsdlns:SoapInteropCompound1PortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoPerson">
+ <soap:operation soapAction="http://soapinterop/echoPerson"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoDocument">
+ <soap:operation soapAction="http://soapinterop/echoDocument"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+
+ </binding>
+ <service name="Compound1">
+ <port name="SoapInteropCompound1Port" binding="wsdlns:SoapInteropCompound1Binding">
+ <soap:address location="round3_groupD_compound1.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.inc
new file mode 100644
index 0000000..8f470ba
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.inc
@@ -0,0 +1,12 @@
+<?php
+class SOAP_Interop_GroupD {
+ function echoEmployee($employee)
+ {
+ return $employee;
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_compound2.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.wsdl
new file mode 100644
index 0000000..e8b63e0
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.wsdl
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInteropCompound" targetNamespace="http://soapinterop.org/"
+ xmlns:wsdlns="http://soapinterop.org/"
+ xmlns:emp="http://soapinterop.org/employee"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <schema targetNamespace="http://soapinterop.org/person"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <complexType name="Person">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" name="Name" type="string"/>
+ <element minOccurs="1" maxOccurs="1" name="Male" type="boolean"/>
+ </sequence>
+ </complexType>
+ </schema>
+ <schema targetNamespace = "http://soapinterop.org/employee"
+ xmlns:prs = "http://soapinterop.org/person"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+ <import namespace="http://soapinterop.org/person" />
+ <complexType name="Employee">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" name="person" type="prs:Person"/>
+ <element minOccurs="1" maxOccurs="1" name="salary" type="double"/>
+ <element minOccurs="1" maxOccurs="1" name="ID" type="int"/>
+ </sequence>
+ </complexType>
+ <element name="x_Employee" type="emp:Employee"/>
+ <element name="result_Employee" type="emp:Employee"/>
+ </schema>
+ </types>
+ <message name="echoEmployee">
+ <part name="x" element="emp:x_Employee"/>
+ </message>
+ <message name="echoEmployeeResponse">
+ <part name="result" element="emp:result_Employee"/>
+ </message>
+ <portType name="SoapInteropCompound2PortType">
+ <operation name="echoEmployee" parameterOrder="x">
+ <input message="wsdlns:echoEmployee"/>
+ <output message="wsdlns:echoEmployeeResponse"/>
+ </operation>
+ </portType>
+ <binding name="SoapInteropCompound2Binding" type="wsdlns:SoapInteropCompound2PortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoEmployee">
+ <soap:operation soapAction="#echoEmployee"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Compound2">
+ <port name="SoapInteropCompound2Port" binding="wsdlns:SoapInteropCompound2Binding">
+ <soap:address location="round3_groupD_compound2.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.inc
new file mode 100644
index 0000000..a9da565
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.inc
@@ -0,0 +1,28 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+ function echoStringArray($inputStringArray)
+ {
+ return $inputStringArray;
+ }
+
+ function echoStruct($inputStruct)
+ {
+ return $inputStruct;
+ }
+
+ function echoVoid()
+ {
+ return NULL;
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_doclit.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle($HTTP_RAW_POST_DATA);
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.wsdl
new file mode 100644
index 0000000..4febca8
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.wsdl
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="WSDLInteropTestDocLitService"
+ targetNamespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://soapinterop.org/WSDLInteropTestDocLit"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://soapinterop.org/xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <types>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ elementFormDefault="qualified">
+ <complexType name="ArrayOfstring_literal">
+ <sequence>
+ <element maxOccurs="unbounded" minOccurs="1" name="string" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varFloat" type="xsd:float"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varString" type="xsd:string"/>
+ </all>
+ </complexType>
+
+ <element name="echoStringParam" type="xsd:string"/>
+
+ <element name="echoStringReturn" type="xsd:string"/>
+ <element name="echoStringArrayParam" type="xsd1:ArrayOfstring_literal"/>
+
+ <element name="echoStringArrayReturn" type="xsd1:ArrayOfstring_literal"/>
+
+ <element name="echoStructParam" type="xsd1:SOAPStruct"/>
+
+ <element name="echoStructReturn" type="xsd1:SOAPStruct"/>
+ </schema>
+ </types>
+ <message name="echoString">
+ <part element="xsd1:echoStringParam" name="a"/>
+ </message>
+ <message name="echoStringResponse">
+ <part element="xsd1:echoStringReturn" name="result"/>
+ </message>
+ <message name="echoStringArray">
+ <part element="xsd1:echoStringArrayParam" name="a"/>
+ </message>
+ <message name="echoStringArrayResponse">
+ <part element="xsd1:echoStringArrayReturn" name="result"/>
+ </message>
+ <message name="echoStruct">
+ <part element="xsd1:echoStructParam" name="a"/>
+ </message>
+ <message name="echoStructResponse">
+ <part element="xsd1:echoStructReturn" name="result"/>
+ </message>
+ <message name="echoVoid"/>
+ <message name="echoVoidResponse"/>
+
+ <portType name="WSDLInteropTestDocLitPortType">
+ <operation name="echoString">
+ <input message="tns:echoString" name="echoString"/>
+ <output message="tns:echoStringResponse" name="echoStringResponse"/>
+ </operation>
+ <operation name="echoStringArray">
+ <input message="tns:echoStringArray" name="echoStringArray"/>
+ <output message="tns:echoStringArrayResponse" name="echoStringArrayResponse"/>
+ </operation>
+ <operation name="echoStruct">
+ <input message="tns:echoStruct" name="echoStruct"/>
+ <output message="tns:echoStructResponse" name="echoStructResponse"/>
+ </operation>
+ <operation name="echoVoid">
+ <input message="tns:echoVoid" name="echoVoid"/>
+ <output message="tns:echoVoidResponse" name="echoVoidResponse"/>
+ </operation>
+ </portType>
+ <binding name="WSDLInteropTestDocLitPortBinding"
+ type="tns:WSDLInteropTestDocLitPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoString">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStringResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoStringArray">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoStringArray">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStringArrayResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoStruct">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStructResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoVoid">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoVoid">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoVoidResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="WSDLInteropTestDocLitService">
+ <port binding="tns:WSDLInteropTestDocLitPortBinding"
+ name="WSDLInteropTestDocLitPort">
+ <soap:address
+ location="round3_groupD_doclit.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.inc
new file mode 100644
index 0000000..6561ff1
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.inc
@@ -0,0 +1,29 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoString($inputString)
+ {
+ return array("return"=>$inputString->param0);
+ }
+
+ function echoStringArray($inputStringArray)
+ {
+ return array("return"=>$inputStringArray->param0);
+ }
+
+ function echoStruct($inputStruct)
+ {
+ return array("return"=>$inputStruct->param0);
+ }
+
+ function echoVoid()
+ {
+ return NULL;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_doclitparams.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle($HTTP_RAW_POST_DATA);
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl
new file mode 100644
index 0000000..9ecf1e1
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="WSDLInteropTestDocLitService"
+ targetNamespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://soapinterop.org/WSDLInteropTestDocLit"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://soapinterop.org/xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <types>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified">
+ <complexType name="ArrayOfstring_literal">
+ <sequence>
+ <element maxOccurs="unbounded" minOccurs="1" name="string" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varFloat" type="xsd:float"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varString" type="xsd:string"/>
+ </all>
+ </complexType>
+
+ <element name="echoString">
+ <complexType>
+ <sequence>
+ <element name="param0" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoStringResponse">
+ <complexType>
+ <sequence>
+ <element name="return" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoStringArray">
+ <complexType>
+ <sequence>
+ <element name="param0" type="xsd1:ArrayOfstring_literal"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoStringArrayResponse">
+ <complexType>
+ <sequence>
+ <element name="return" type="xsd1:ArrayOfstring_literal"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoStruct">
+ <complexType>
+ <sequence>
+ <element name="param0" type="xsd1:SOAPStruct"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoStructResponse">
+ <complexType>
+ <sequence>
+ <element name="return" type="xsd1:SOAPStruct"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoVoid">
+ <complexType/>
+ </element>
+ <element name="echoVoidResponse">
+ <complexType/>
+ </element>
+ </schema>
+ </types>
+ <message name="echoString">
+ <part element="xsd1:echoString" name="parameters"/>
+ </message>
+ <message name="echoStringResponse">
+ <part element="xsd1:echoStringResponse" name="parameters"/>
+ </message>
+ <message name="echoStringArray">
+ <part element="xsd1:echoStringArray" name="parameters"/>
+ </message>
+ <message name="echoStringArrayResponse">
+ <part element="xsd1:echoStringArrayResponse" name="parameters"/>
+ </message>
+ <message name="echoStruct">
+ <part element="xsd1:echoStruct" name="parameters"/>
+ </message>
+ <message name="echoStructResponse">
+ <part element="xsd1:echoStructResponse" name="parameters"/>
+ </message>
+ <message name="echoVoid">
+ <part element="xsd1:echoVoid" name="parameters"/>
+ </message>
+ <message name="echoVoidResponse">
+ <part element="xsd1:echoVoidResponse" name="parameters"/>
+ </message>
+ <portType name="WSDLInteropTestDocLitPortType">
+ <operation name="echoString">
+ <input message="tns:echoString" name="echoString"/>
+ <output message="tns:echoStringResponse" name="echoStringResponse"/>
+ </operation>
+ <operation name="echoStringArray">
+ <input message="tns:echoStringArray" name="echoStringArray"/>
+ <output message="tns:echoStringArrayResponse" name="echoStringArrayResponse"/>
+ </operation>
+ <operation name="echoStruct">
+ <input message="tns:echoStruct" name="echoStruct"/>
+ <output message="tns:echoStructResponse" name="echoStructResponse"/>
+ </operation>
+ <operation name="echoVoid">
+ <input message="tns:echoVoid" name="echoVoid"/>
+ <output message="tns:echoVoidResponse" name="echoVoidResponse"/>
+ </operation>
+ </portType>
+ <binding name="WSDLInteropTestDocLitPortBinding"
+ type="tns:WSDLInteropTestDocLitPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoString">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStringResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoStringArray">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoStringArray">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStringArrayResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoStruct">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStructResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoVoid">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoVoid">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoVoidResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="WSDLInteropTestDocLitService">
+ <port binding="tns:WSDLInteropTestDocLitPortBinding"
+ name="WSDLInteropTestDocLitPort">
+ <soap:address
+ location="round3_groupD_doclitparams.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.inc
new file mode 100644
index 0000000..ee38a12
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.inc
@@ -0,0 +1,14 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_emptysa.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle($HTTP_RAW_POST_DATA);
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.wsdl
new file mode 100644
index 0000000..09a09a4
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.wsdl
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop/"
+ xmlns:wsdlns="http://soapinterop/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types/>
+ <message name="echoStringRequest">
+ <part name="a" type="xsd:string"/>
+ </message>
+ <message name="echoStringResponse">
+ <part name="Result" type="xsd:string"/>
+ </message>
+ <portType name="SoapInteropEmptySAPortType">
+ <operation name="echoString" parameterOrder="a">
+ <input message="wsdlns:echoStringRequest"/>
+ <output message="wsdlns:echoStringResponse"/>
+ </operation>
+ </portType>
+ <binding name="SoapInteropEmptySABinding" type="wsdlns:SoapInteropEmptySAPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="EmptySA">
+ <port name="SoapInteropEmptySAPort" binding="wsdlns:SoapInteropEmptySABinding">
+ <soap:address location="round3_groupD_emptysa.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.inc
new file mode 100644
index 0000000..ecde53e
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.inc
@@ -0,0 +1,14 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_import1.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle($HTTP_RAW_POST_DATA);
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.wsdl
new file mode 100644
index 0000000..d928830
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.wsdl
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop.org/"
+ xmlns:wsdlns1="http://soapinterop.org/definitions/"
+ xmlns:wsdlns="http://soapinterop.org/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <import location="imported/import1B.wsdl" namespace="http://soapinterop.org/definitions/" />
+
+ <binding name="SoapInteropImport1Binding" type="wsdlns1:SoapInteropImport1PortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop/echoString/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop/echoStringResponse/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Import1">
+ <port name="SoapInteropImport1Port" binding="wsdlns:SoapInteropImport1Binding">
+ <soap:address location="round3_groupD_import1.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.inc
new file mode 100644
index 0000000..5957c37
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.inc
@@ -0,0 +1,14 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoStruct($inputStruct)
+ {
+ return $inputStruct;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_import2.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle($HTTP_RAW_POST_DATA);
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.wsdl
new file mode 100644
index 0000000..fc0f8ae
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.wsdl
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop.org/main/"
+ xmlns:wsdlns1="http://soapinterop.org/definitions/"
+ xmlns:wsdlns="http://soapinterop.org/main/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <import location="imported/import2B.wsdl" namespace="http://soapinterop.org/definitions/" />
+
+ <binding name="SoapInteropImport2Binding" type="wsdlns1:SoapInteropImport2PortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Import2">
+ <port name="SoapInteropImport2Port" binding="wsdlns:SoapInteropImport2Binding">
+ <soap:address location="round3_groupD_import2.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl
new file mode 100644
index 0000000..fc0f8ae
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop.org/main/"
+ xmlns:wsdlns1="http://soapinterop.org/definitions/"
+ xmlns:wsdlns="http://soapinterop.org/main/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <import location="imported/import2B.wsdl" namespace="http://soapinterop.org/definitions/" />
+
+ <binding name="SoapInteropImport2Binding" type="wsdlns1:SoapInteropImport2PortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Import2">
+ <port name="SoapInteropImport2Port" binding="wsdlns:SoapInteropImport2Binding">
+ <soap:address location="round3_groupD_import2.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.inc
new file mode 100644
index 0000000..3a3df97
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.inc
@@ -0,0 +1,19 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoStruct($inputStruct)
+ {
+ return $inputStruct;
+ }
+
+ function echoStructArray($inputStructArray)
+ {
+ return $inputStructArray;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_import3.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle($HTTP_RAW_POST_DATA);
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.wsdl
new file mode 100644
index 0000000..3dd2642
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.wsdl
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop.org/main2/"
+ xmlns:wsdlns="http://soapinterop.org/main2/"
+ xmlns:impns="http://soapinterop.org/definitions/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:typens2="http://soapinterop.org/xsd2"
+ xmlns:typens="http://soapinterop.org/xsd"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <import namespace = "http://soapinterop.org/xsd" location = "round3_groupD_import2.wsdl"/>
+ <import namespace = "http://soapinterop.org/definitions/" location = "round3_groupD_import2.wsdl"/>
+
+ <types>
+ <schema targetNamespace='http://soapinterop.org/xsd2'
+ xmlns='http://www.w3.org/2001/XMLSchema'
+ xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
+ xmlns:wsdl = "http://schemas.xmlsoap.org/wsdl/"
+ elementFormDefault='unqualified'>
+ <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/>
+ <import namespace = "http://soapinterop.org/xsd"/>
+ <complexType name ='ArrayOfSOAPStruct'>
+ <complexContent>
+ <restriction base='SOAP-ENC:Array'>
+ <attribute ref='SOAP-ENC:arrayType' wsdl:arrayType='typens:SOAPStruct[]'/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name='Server.echoStructArray'>
+ <part name='inputArray' type='typens2:ArrayOfSOAPStruct'/>
+ </message>
+ <message name='Server.echoStructArrayResponse'>
+ <part name='Result' type='typens2:ArrayOfSOAPStruct'/>
+ </message>
+
+ <portType name="SoapInteropImport3PortType">
+ <operation name='echoStruct' parameterOrder='inputStruct'>
+ <input message='impns:Server.echoStruct' />
+ <output message='impns:Server.echoStructResponse' />
+ </operation>
+ <operation name='echoStructArray' parameterOrder='inputArray'>
+ <input message='wsdlns:Server.echoStructArray' />
+ <output message='wsdlns:Server.echoStructArrayResponse' />
+ </operation>
+ </portType>
+
+ <binding name="SoapInteropImport3Binding" type="wsdlns:SoapInteropImport3PortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStructArray">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Import3">
+ <port name="SoapInteropImport3Port" binding="wsdlns:SoapInteropImport3Binding">
+ <soap:address location="round3_groupD_import3.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.inc
new file mode 100644
index 0000000..e88df33
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.inc
@@ -0,0 +1,28 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+ function echoStringArray($inputStringArray)
+ {
+ return $inputStringArray;
+ }
+
+ function echoStruct($inputStruct)
+ {
+ return $inputStruct;
+ }
+
+ function echoVoid()
+ {
+ return NULL;
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_rpcenc.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle($HTTP_RAW_POST_DATA);
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl
new file mode 100644
index 0000000..5e24411
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="WSDLInteropTestRpcEncService"
+ targetNamespace="http://soapinterop.org/WSDLInteropTestRpcEnc"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://soapinterop.org/WSDLInteropTestRpcEnc"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://soapinterop.org/xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <types>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified">
+ <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="ArrayOfstring">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varFloat" type="xsd:float"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varString" type="xsd:string"/>
+ </all>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="echoString">
+ <part name="param0" type="xsd:string"/>
+ </message>
+ <message name="echoStringResponse">
+ <part name="return" type="xsd:string"/>
+ </message>
+ <message name="echoStringArray">
+ <part name="param0" type="xsd1:ArrayOfstring"/>
+ </message>
+ <message name="echoStringArrayResponse">
+ <part name="return" type="xsd1:ArrayOfstring"/>
+ </message>
+ <message name="echoStruct">
+ <part name="param0" type="xsd1:SOAPStruct"/>
+ </message>
+ <message name="echoStructResponse">
+ <part name="return" type="xsd1:SOAPStruct"/>
+ </message>
+ <message name="echoVoid"/>
+ <message name="echoVoidResponse"/>
+ <portType name="WSDLInteropTestRpcEncPortType">
+ <operation name="echoString">
+ <input message="tns:echoString" name="echoString"/>
+ <output message="tns:echoStringResponse" name="echoStringResponse"/>
+ </operation>
+ <operation name="echoStringArray">
+ <input message="tns:echoStringArray" name="echoStringArray"/>
+ <output message="tns:echoStringArrayResponse" name="echoStringArrayResponse"/>
+ </operation>
+ <operation name="echoStruct">
+ <input message="tns:echoStruct" name="echoStruct"/>
+ <output message="tns:echoStructResponse" name="echoStructResponse"/>
+ </operation>
+ <operation name="echoVoid">
+ <input message="tns:echoVoid" name="echoVoid"/>
+ <output message="tns:echoVoidResponse" name="echoVoidResponse"/>
+ </operation>
+ </portType>
+ <binding name="WSDLInteropTestRpcEncPortBinding"
+ type="tns:WSDLInteropTestRpcEncPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction="" style="rpc"/>
+ <input name="echoString">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </input>
+ <output name="echoStringResponse">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </output>
+ </operation>
+ <operation name="echoStringArray">
+ <soap:operation soapAction="" style="rpc"/>
+ <input name="echoStringArray">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </input>
+ <output name="echoStringArrayResponse">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </output>
+ </operation>
+ <operation name="echoStruct">
+ <soap:operation soapAction="" style="rpc"/>
+ <input name="echoStruct">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </input>
+ <output name="echoStructResponse">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </output>
+ </operation>
+ <operation name="echoVoid">
+ <soap:operation soapAction="" style="rpc"/>
+ <input name="echoVoid">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </input>
+ <output name="echoVoidResponse">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="WSDLInteropTestRpcEncService">
+ <port binding="tns:WSDLInteropTestRpcEncPortBinding"
+ name="WSDLInteropTestRpcEncPort">
+ <soap:address
+ location="round3_groupD_rpcenc.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/skipif.inc b/ext/soap/tests/interop/Round3/GroupD/skipif.inc
new file mode 100644
index 0000000..fa8574e
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt
new file mode 100644
index 0000000..07b087e
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP Interop Round3 GroupE List 001 (php/wsdl): echoLinkedList
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPList {
+ function SOAPList($s, $i, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->child = $c;
+ }
+}
+$struct = new SOAPList('arg1',1,NULL);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoLinkedList($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupE_list.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:nil="true" xsi:type="ns2:List"/></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:nil="true" xsi:type="ns2:List"/></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#5 (3) {
+ ["varInt"]=>
+ int(1)
+ ["varString"]=>
+ string(4) "arg1"
+ ["child"]=>
+ NULL
+}
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt
new file mode 100644
index 0000000..efc25e2
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt
@@ -0,0 +1,44 @@
+--TEST--
+SOAP Interop Round3 GroupE List 002 (php/wsdl): echoLinkedList
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPList {
+ function SOAPList($s, $i, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->child = $c;
+ }
+}
+$struct = new SOAPList('arg1',1, new SOAPList('arg2',2,NULL));
+$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoLinkedList($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupE_list.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:nil="true" xsi:type="ns2:List"/></child></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:nil="true" xsi:type="ns2:List"/></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#6 (3) {
+ ["varInt"]=>
+ int(1)
+ ["varString"]=>
+ string(4) "arg1"
+ ["child"]=>
+ object(stdClass)#7 (3) {
+ ["varInt"]=>
+ int(2)
+ ["varString"]=>
+ string(4) "arg2"
+ ["child"]=>
+ NULL
+ }
+}
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt
new file mode 100644
index 0000000..705e203
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt
@@ -0,0 +1,51 @@
+--TEST--
+SOAP Interop Round3 GroupE List 003 (php/wsdl): echoLinkedList
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPList {
+ function SOAPList($s, $i, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->child = $c;
+ }
+}
+$struct = new SOAPList('arg1',1,new SOAPList('arg2',2,new SOAPList('arg3',3,NULL)));
+$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoLinkedList($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupE_list.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child xsi:nil="true" xsi:type="ns2:List"/></child></child></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child xsi:nil="true" xsi:type="ns2:List"/></child></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#7 (3) {
+ ["varInt"]=>
+ int(1)
+ ["varString"]=>
+ string(4) "arg1"
+ ["child"]=>
+ object(stdClass)#8 (3) {
+ ["varInt"]=>
+ int(2)
+ ["varString"]=>
+ string(4) "arg2"
+ ["child"]=>
+ object(stdClass)#9 (3) {
+ ["varInt"]=>
+ int(3)
+ ["varString"]=>
+ string(4) "arg3"
+ ["child"]=>
+ NULL
+ }
+ }
+}
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt
new file mode 100644
index 0000000..ade6d83
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Interop Round3 GroupE List 004 (php/wsdl): echoLinkedList
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPList {
+ function SOAPList($s, $i, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->child = $c;
+ }
+}
+$struct = NULL;
+$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoLinkedList($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupE_list.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:nil="true" xsi:type="ns2:List"/></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:nil="true" xsi:type="ns2:List"/></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+NULL
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt
new file mode 100644
index 0000000..8d149a3
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt
@@ -0,0 +1,52 @@
+--TEST--
+SOAP Interop Round3 GroupE List 005 (php/wsdl): echoLinkedList (cyclic)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPList {
+ function SOAPList($s, $i, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->child = $c;
+ }
+}
+$struct = new SOAPList('arg1',1,new SOAPList('arg2',2,new SOAPList('arg3',3,NULL)));
+$struct->child->child->child = $struct;
+$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoLinkedList($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupE_list.inc");
+echo "ok\n";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 id="ref1" xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child href="#ref1"/></child></child></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return id="ref1" xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child href="#ref1"/></child></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (3) {
+ ["varInt"]=>
+ int(1)
+ ["varString"]=>
+ string(4) "arg1"
+ ["child"]=>
+ object(stdClass)#%d (3) {
+ ["varInt"]=>
+ int(2)
+ ["varString"]=>
+ string(4) "arg2"
+ ["child"]=>
+ object(stdClass)#%d (3) {
+ ["varInt"]=>
+ int(3)
+ ["varString"]=>
+ string(4) "arg3"
+ ["child"]=>
+ *RECURSION*
+ }
+ }
+}
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt
new file mode 100644
index 0000000..3549f45
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt
@@ -0,0 +1,52 @@
+--TEST--
+SOAP Interop Round3 GroupE List 006 (php/wsdl): echoLinkedList (cyclic)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPList {
+ function SOAPList($s, $i, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->child = $c;
+ }
+}
+$struct = new SOAPList('arg1',1,new SOAPList('arg2',2,new SOAPList('arg3',3,NULL)));
+$struct->child->child->child = $struct->child;
+$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoLinkedList($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupE_list.inc");
+echo "ok\n";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child id="ref1" xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child href="#ref1"/></child></child></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child id="ref1" xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child href="#ref1"/></child></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (3) {
+ ["varInt"]=>
+ int(1)
+ ["varString"]=>
+ string(4) "arg1"
+ ["child"]=>
+ &object(stdClass)#%d (3) {
+ ["varInt"]=>
+ int(2)
+ ["varString"]=>
+ string(4) "arg2"
+ ["child"]=>
+ object(stdClass)#%d (3) {
+ ["varInt"]=>
+ int(3)
+ ["varString"]=>
+ string(4) "arg3"
+ ["child"]=>
+ *RECURSION*
+ }
+ }
+}
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.inc b/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.inc
new file mode 100644
index 0000000..19a769c
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.inc
@@ -0,0 +1,17 @@
+<?php
+class SOAP_Interop_GroupE {
+
+ function echoLinkedList($inputList)
+ {
+ global $d;
+ $d = $inputList;
+ return $inputList;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupE_list.wsdl");
+$server->setClass("SOAP_Interop_GroupE");
+$server->handle($HTTP_RAW_POST_DATA);
+var_dump($d);
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.wsdl b/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.wsdl
new file mode 100644
index 0000000..49e6a8c
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.wsdl
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="WSDLInteropTestList"
+ targetNamespace="http://soapinterop.org/WSDLInteropTestList"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://soapinterop.org/WSDLInteropTestList"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://soapinterop.org/xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <types>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <complexType name="List">
+ <all>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varString" type="xsd:string"/>
+ <element name="child" type = "xsd1:List"/>
+ </all>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="echoLinkedList">
+ <part name="param0" type="xsd1:List"/>
+ </message>
+ <message name="echoLinkedListResponse">
+ <part name="return" type="xsd1:List"/>
+ </message>
+ <portType name="WSDLInteropTestListPortType">
+ <operation name="echoLinkedList">
+ <input message="tns:echoLinkedList"/>
+ <output message="tns:echoLinkedListResponse"/>
+ </operation>
+ </portType>
+ <binding name="WSDLInteropTestListBinding"
+ type="tns:WSDLInteropTestListPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoLinkedList">
+ <soap:operation soapAction="" style="rpc"/>
+ <input>
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </input>
+ <output>
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </output>
+ </operation>
+
+ </binding>
+ <service name="WSDLInteropTestListService">
+ <port binding="tns:WSDLInteropTestListBinding"
+ name="WSDLInteropTestListPort">
+ <soap:address
+ location="round3_groupE_list.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupE/skipif.inc b/ext/soap/tests/interop/Round3/GroupE/skipif.inc
new file mode 100644
index 0000000..fa8574e
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_ext_001w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_ext_001w.phpt
new file mode 100644
index 0000000..bc6af1a
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_ext_001w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupF Extensibility 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupF_ext.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupF_ext.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringParam>Hello World</ns1:echoStringParam></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringReturn>Hello World</ns1:echoStringReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt
new file mode 100644
index 0000000..fa8940e
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt
@@ -0,0 +1,17 @@
+--TEST--
+SOAP Interop Round3 GroupF Extensibility Required 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupF_extreq.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+//$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+//include("round3_groupF_extreq.inc");
+echo "ok\n";
+?>
+--EXPECTF--
+Fatal error: SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension 'http://soapinterop.org/ext' in %sr3_groupF_extreq_001w.php on line %d
diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_001w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_001w.phpt
new file mode 100644
index 0000000..65bda0c
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_001w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round3 GroupF Headers 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupF_headers.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupF_headers.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringParam>Hello World</ns1:echoStringParam></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringReturn>Hello World</ns1:echoStringReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_002w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_002w.phpt
new file mode 100644
index 0000000..ae723a3
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_002w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round3 GroupF Headers 002 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/xsd","Header1", array("int"=>34,"string"=>"arg"));
+$client = new SoapClient(dirname(__FILE__)."/round3_groupF_headers.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString",array("Hello World"),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupF_headers.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Header><ns1:Header1><ns1:string>arg</ns1:string><ns1:int>34</ns1:int></ns1:Header1></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoStringParam>Hello World</ns1:echoStringParam></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringReturn>Hello World</ns1:echoStringReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_003w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_003w.phpt
new file mode 100644
index 0000000..b4cb283
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_003w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round3 GroupF Headers 003 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/xsd","Header2", array("int"=>34,"string"=>"arg"));
+$client = new SoapClient(dirname(__FILE__)."/round3_groupF_headers.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString",array("Hello World"),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupF_headers.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Header><ns1:Header2><ns1:int>34</ns1:int><ns1:string>arg</ns1:string></ns1:Header2></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoStringParam>Hello World</ns1:echoStringParam></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringReturn>Hello World</ns1:echoStringReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_004w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_004w.phpt
new file mode 100644
index 0000000..f0a427a
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_004w.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP Interop Round3 GroupF Headers 004 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$hdr = array(
+ new SoapHeader("http://soapinterop.org/xsd","Header1", array("int"=>34,"string"=>"arg1")),
+ new SoapHeader("http://soapinterop.org/xsd","Header2", array("int"=>43,"string"=>"arg2"))
+);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupF_headers.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString",array("Hello World"),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupF_headers.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Header><ns1:Header1><ns1:string>arg1</ns1:string><ns1:int>34</ns1:int></ns1:Header1><ns1:Header2><ns1:int>43</ns1:int><ns1:string>arg2</ns1:string></ns1:Header2></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoStringParam>Hello World</ns1:echoStringParam></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringReturn>Hello World</ns1:echoStringReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.inc b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.inc
new file mode 100644
index 0000000..e90586e
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.inc
@@ -0,0 +1,14 @@
+<?php
+class SOAP_Interop_GroupF {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupF_ext.wsdl");
+$server->setClass("SOAP_Interop_GroupF");
+$server->handle($HTTP_RAW_POST_DATA);
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.wsdl b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.wsdl
new file mode 100644
index 0000000..74ec018
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.wsdl
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="WSDLInteropTestDocLitService"
+ targetNamespace="http://soapinterop.org/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://soapinterop.org/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://soapinterop.org/xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ext="http://soapinterop.org/ext">
+ <ext:types/>
+
+ <types>
+ <ext:schema targetNamespace="http://soapinterop.org/xsd"/>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <element name="echoStringParam" type="xsd:string"/>
+
+ <element name="echoStringReturn" type="xsd:string"/>
+ </schema>
+ </types>
+ <ext:message name="echoString"/>
+ <message name="echoString">
+ <part element="xsd1:echoStringParam" name="a"/>
+ </message>
+ <message name="echoStringResponse">
+ <part element="xsd1:echoStringReturn" name="result"/>
+ </message>
+
+ <ext:portType name="WSDLInteropTestDocLitPortType"/>
+
+ <portType name="WSDLInteropTestDocLitPortType">
+ <operation name="echoString">
+ <input message="tns:echoString" name="echoString"/>
+ <output message="tns:echoStringResponse" name="echoStringResponse"/>
+ </operation>
+ </portType>
+ <ext:binding name="WSDLInteropTestDocLitPortBinding"/>
+ <binding name="WSDLInteropTestDocLitPortBinding"
+ type="tns:WSDLInteropTestDocLitPortType">
+ <ext:binding style ="chunked"/>
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <ext:operation style ="chunked"/>
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoString">
+ <ext:body use ="direct"/>
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStringResponse">
+ <ext:body use ="direct"/>
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <ext:service name="WSDLInteropTestDocLitService"/>
+ <service name="WSDLInteropTestDocLitService">
+ <ext:port binding="tns:WSDLInteropTestDocLitPortBinding"
+ name="WSDLInteropTestDocLitPort"/>
+ <port binding="tns:WSDLInteropTestDocLitPortBinding"
+ name="WSDLInteropTestDocLitPort">
+ <ext:address location=""/>
+ <soap:address
+ location="round3_groupF_ext.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_extreq.wsdl b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_extreq.wsdl
new file mode 100644
index 0000000..8dfd65e
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_extreq.wsdl
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="WSDLInteropTestDocLitService"
+ targetNamespace="http://soapinterop.org/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://soapinterop.org/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://soapinterop.org/xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ext="http://soapinterop.org/ext">
+ <ext:types/>
+
+ <types>
+ <ext:schema targetNamespace="http://soapinterop.org/xsd"/>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <element name="echoStringParam" type="xsd:string"/>
+
+ <element name="echoStringReturn" type="xsd:string"/>
+ </schema>
+ </types>
+ <ext:message name="echoString"/>
+ <message name="echoString">
+ <part element="xsd1:echoStringParam" name="a"/>
+ </message>
+ <message name="echoStringResponse">
+ <part element="xsd1:echoStringReturn" name="result"/>
+ </message>
+
+ <ext:portType name="WSDLInteropTestDocLitPortType"/>
+
+ <portType name="WSDLInteropTestDocLitPortType">
+ <operation name="echoString">
+ <input message="tns:echoString" name="echoString"/>
+ <output message="tns:echoStringResponse" name="echoStringResponse"/>
+ </operation>
+ </portType>
+ <ext:binding name="WSDLInteropTestDocLitPortBinding"/>
+ <binding name="WSDLInteropTestDocLitPortBinding"
+ type="tns:WSDLInteropTestDocLitPortType">
+ <ext:binding style ="chunked" wsdl:required="true"/>
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <ext:operation style ="chunked"/>
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoString">
+ <ext:body use ="direct"/>
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStringResponse">
+ <ext:body use ="direct"/>
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <ext:service name="WSDLInteropTestDocLitService"/>
+ <service name="WSDLInteropTestDocLitService">
+ <ext:port binding="tns:WSDLInteropTestDocLitPortBinding"
+ name="WSDLInteropTestDocLitPort"/>
+ <port binding="tns:WSDLInteropTestDocLitPortBinding"
+ name="WSDLInteropTestDocLitPort">
+ <ext:address location=""/>
+ <soap:address
+ location="round3_groupF_extreq.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.inc b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.inc
new file mode 100644
index 0000000..b7e67b0
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.inc
@@ -0,0 +1,22 @@
+<?php
+class SOAP_Interop_GroupF {
+
+ function Header1($input)
+ {
+ }
+
+ function Header2($input)
+ {
+ }
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupF_ext.wsdl");
+$server->setClass("SOAP_Interop_GroupF");
+$server->handle($HTTP_RAW_POST_DATA);
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.wsdl b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.wsdl
new file mode 100644
index 0000000..d03fc32
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.wsdl
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:s="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/"
+ xmlns:types="http://soapinterop.org/xsd"
+ targetNamespace="http://soapinterop.org/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd">
+ <s:element name="echoStringParam" type="s:string"/>
+
+ <s:element name="echoStringReturn" type="s:string"/>
+
+ <s:element name="Header1" type="types:Header1" />
+ <s:complexType name="Header1">
+ <s:sequence>
+ <s:element name="string" type="s:string" />
+ <s:element name="int" type="s:int" />
+ </s:sequence>
+ <s:anyAttribute />
+ </s:complexType>
+ <s:element name="Header2" type="types:Header2" />
+ <s:complexType name="Header2">
+ <s:sequence>
+ <s:element name="int" type="s:int" />
+ <s:element name="string" type="s:string" />
+ </s:sequence>
+ <s:anyAttribute />
+ </s:complexType>
+ </s:schema>
+ </types>
+ <message name="echoString">
+ <part element="types:echoStringParam" name="a"/>
+ </message>
+ <message name="echoStringResponse">
+ <part element="types:echoStringReturn" name="result"/>
+ </message>
+ <message name="Header1">
+ <part name="Header1" element="types:Header1" />
+ </message>
+ <message name="Header2">
+ <part name="Header2" element="types:Header2" />
+ </message>
+ <portType name="RetHeaderPortType">
+ <operation name="echoString">
+ <input message="tns:echoString" />
+ <output message="tns:echoStringResponse" />
+ </operation>
+ </portType>
+ <binding name = "RetHeaderBinding" type="tns:RetHeaderPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="echoString">
+ <soap:operation soapAction="http://soapinterop.org/" style="document" />
+ <input>
+ <soap:body use="literal" />
+ <soap:header message="tns:Header1" part="Header1" use="literal"/>
+ <soap:header message="tns:Header2" part="Header2" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <service name="RetHeaderService">
+ <port name="RetHeaderPort" binding="tns:RetHeaderBinding">
+ <soap:address location="round3_groupF_headers.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupF/skipif.inc b/ext/soap/tests/interop/Round3/GroupF/skipif.inc
new file mode 100644
index 0000000..fa8574e
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.inc b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.inc
new file mode 100644
index 0000000..bf95d0a
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.inc
@@ -0,0 +1,33 @@
+<?php
+class SOAP_Interop_GroupG {
+
+ function EchoBase64AsAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachmentAsBase64($in) {
+ return $in;
+ }
+
+ function EchoAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachments($in) {
+ return $in;
+ }
+
+ function EchoAttachmentAsString($in) {
+ return $in;
+ }
+
+ function EchoUnrefAttachments($in) {
+ return $in;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupG_dimedoc.wsdl");
+$server->setClass("SOAP_Interop_GroupG");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.wsdl b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.wsdl
new file mode 100644
index 0000000..f82216e
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.wsdl
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions name="SOAPBuilders" xmlns="http://soapinterop.org/attachments/wsdl" xmlns:types="http://soapinterop.org/attachments/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:dime="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/" xmlns:content="http://schemas.xmlsoap.org/ws/2002/04/content-type/" xmlns:ref="http://schemas.xmlsoap.org/ws/2002/04/reference/" targetNamespace="http://soapinterop.org/attachments/wsdl">
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/attachments/xsd" elementFormDefault="qualified" attributeFormDefault="qualified">
+ <import namespace="http://schemas.xmlsoap.org/ws/2002/04/reference/"/>
+ <import namespace="http://schemas.xmlsoap.org/ws/2002/04/content-type/"/>
+ <complexType name="ReferencedBinary">
+ <simpleContent>
+ <restriction base="xsd:base64Binary">
+ <annotation>
+ <appinfo>
+ <content:mediaType value="application/octetstream"/>
+ </appinfo>
+ </annotation>
+ <attribute ref="ref:location" use="optional"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <complexType name="ReferencedText">
+ <simpleContent>
+ <restriction base="xsd:base64Binary">
+ <annotation>
+ <appinfo>
+ <content:mediaType value="text/plain"/>
+ </appinfo>
+ </annotation>
+ <attribute ref="ref:location" use="optional"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <element name="EchoAttachment" type="types:EchoAttachment"/>
+ <element name="EchoAttachmentResponse" type="types:EchoAttachmentResponse"/>
+ <complexType name="EchoAttachment">
+ <sequence>
+ <element name="In" type="types:ReferencedBinary"/>
+ </sequence>
+ </complexType>
+ <complexType name="EchoAttachmentResponse">
+ <sequence>
+ <element name="Out" type="types:ReferencedBinary"/>
+ </sequence>
+ </complexType>
+ <element name="EchoAttachments" type="types:Attachments"/>
+ <element name="EchoAttachmentsResponse" type="types:Attachments"/>
+ <complexType name="Attachments">
+ <sequence>
+ <element name="Item" minOccurs="0" maxOccurs="unbounded" type="types:ReferencedBinary"/>
+ </sequence>
+ </complexType>
+ <element name="EchoAttachmentAsBase64" type="types:EchoAttachment"/>
+ <element name="EchoAttachmentAsBase64Response" type="types:base64Out"/>
+ <element name="EchoBase64AsAttachment" type="types:base64In"/>
+ <element name="EchoBase64AsAttachmentResponse" type="types:EchoAttachmentResponse"/>
+ <complexType name="base64In">
+ <sequence>
+ <element name="In" type="xsd:base64Binary"/>
+ </sequence>
+ </complexType>
+ <complexType name="base64Out">
+ <sequence>
+ <element name="Out" type="xsd:base64Binary"/>
+ </sequence>
+ </complexType>
+ <element name="EchoUnrefAttachments" type="types:emptyType"/>
+ <element name="EchoUnrefAttachmentsResponse" type="types:emptyType"/>
+ <complexType name="emptyType">
+ <sequence/>
+ </complexType>
+ <element name="EchoAttachmentAsString" type="types:EchoAttachmentAsString"/>
+ <element name="EchoAttachmentAsStringResponse" type="types:EchoAttachmentAsStringResponse"/>
+ <complexType name="EchoAttachmentAsString">
+ <sequence>
+ <element name="In" type="types:ReferencedText"/>
+ </sequence>
+ </complexType>
+ <complexType name="EchoAttachmentAsStringResponse">
+ <sequence>
+ <element name="Out" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="EchoAttachmentIn">
+ <wsdl:part name="In" element="types:EchoAttachment"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentOut">
+ <wsdl:part name="Out" element="types:EchoAttachmentResponse"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsIn">
+ <wsdl:part name="In" element="types:EchoAttachments"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsOut">
+ <wsdl:part name="Out" element="types:EchoAttachmentsResponse"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64In">
+ <wsdl:part name="In" element="types:EchoAttachmentAsBase64"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64Out">
+ <wsdl:part name="Out" element="types:EchoAttachmentAsBase64Response"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentIn">
+ <wsdl:part name="In" element="types:EchoBase64AsAttachment"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentOut">
+ <wsdl:part name="Out" element="types:EchoBase64AsAttachmentResponse"/>
+ </wsdl:message>
+ <wsdl:message name="EchoUnrefAttachmentsIn">
+ <wsdl:part name="In" element="types:EchoUnrefAttachments"/>
+ </wsdl:message>
+ <wsdl:message name="EchoUnrefAttachmentsOut">
+ <wsdl:part name="Out" element="types:EchoUnrefAttachmentsResponse"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsStringIn">
+ <wsdl:part name="In" element="types:EchoAttachmentAsString"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsStringOut">
+ <wsdl:part name="Out" element="types:EchoAttachmentAsStringResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="AttachmentsPortType">
+ <wsdl:operation name="EchoAttachment">
+ <wsdl:input name="EchoAttachmentInput" message="EchoAttachmentIn"/>
+ <wsdl:output name="EchoAttachmentOutput" message="EchoAttachmentOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <wsdl:input name="EchoAttachmentsInput" message="EchoAttachmentsIn"/>
+ <wsdl:output name="EchoAttachmentsOutput" message="EchoAttachmentsOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <wsdl:input name="EchoAttachmentAsBase64Input" message="EchoAttachmentAsBase64In"/>
+ <wsdl:output name="EchoAttachmentAsBase64Output" message="EchoAttachmentAsBase64Out"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <wsdl:input name="EchoBase64AsAttachmentInput" message="EchoBase64AsAttachmentIn"/>
+ <wsdl:output name="EchoBase64AsAttachmentOutput" message="EchoBase64AsAttachmentOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoUnrefAttachments">
+ <wsdl:input name="EchoUnrefAttachmentsInput" message="EchoUnrefAttachmentsIn"/>
+ <wsdl:output name="EchoUnrefAttachmentsOutput" message="EchoUnrefAttachmentsOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsString">
+ <wsdl:input name="EchoAttachmentAsStringInput" message="EchoAttachmentAsStringIn"/>
+ <wsdl:output name="EchoAttachmentAsStringOutput" message="EchoAttachmentAsStringOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="AttachmentsBinding" type="AttachmentsPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="EchoAttachment">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentsInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentsOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentAsBase64Input">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentAsBase64Output">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoBase64AsAttachmentInput">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="EchoBase64AsAttachmentOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoUnrefAttachments">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoUnrefAttachmentsInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="EchoUnrefAttachmentsOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsString">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentAsStringInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentAsStringOutput">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Round4DIMEDOC">
+ <wsdl:port name="Round4DIMEDOCTestSoap" binding="AttachmentsBinding">
+ <soap:address location="test://" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.inc b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.inc
new file mode 100644
index 0000000..9dcbed7
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.inc
@@ -0,0 +1,33 @@
+<?php
+class SOAP_Interop_GroupG {
+
+ function EchoBase64AsAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachmentAsBase64($in) {
+ return $in;
+ }
+
+ function EchoAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachments($in) {
+ return $in;
+ }
+
+ function EchoAttachmentAsString($in) {
+ return $in;
+ }
+
+ function EchoUnrefAttachments($in) {
+ return $in;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupG_dimerpc.wsdl");
+$server->setClass("SOAP_Interop_GroupG");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.wsdl b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.wsdl
new file mode 100644
index 0000000..d837da0
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.wsdl
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions name="SOAPBuilders" xmlns="http://soapinterop.org/attachments/wsdl" xmlns:types="http://soapinterop.org/attachments/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:dime="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/" xmlns:content="http://schemas.xmlsoap.org/ws/2002/04/content-type/" targetNamespace="http://soapinterop.org/attachments/wsdl">
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/attachments/xsd">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/" location="http://schemas.xmlsoap.org/soap/encoding/" />
+ <import namespace="http://schemas.xmlsoap.org/ws/2002/04/content-type/"/>
+ <import namespace="http://schemas.xmlsoap.org/ws/2002/04/reference/"/>
+ <complexType name="ReferencedBinary">
+ <simpleContent>
+ <restriction base="soap-enc:base64Binary">
+ <annotation>
+ <appinfo>
+ <content:mediaType value="application/octetstream"/>
+ </appinfo>
+ </annotation>
+ <attributeGroup ref="soap-enc:commonAttributes"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <complexType name="ArrayOfBinary">
+ <complexContent>
+ <restriction base="soap-enc:Array">
+ <attribute ref="soap-enc:arrayType" wsdl:arrayType="types:ReferencedBinary[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ReferencedText">
+ <simpleContent>
+ <restriction base="soap-enc:base64Binary">
+ <annotation>
+ <appinfo>
+ <content:mediaType value="text/plain"/>
+ </appinfo>
+ </annotation>
+ <attributeGroup ref="soap-enc:commonAttributes"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="EchoAttachmentIn">
+ <wsdl:part name="In" type="types:ReferencedBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentOut">
+ <wsdl:part name="Out" type="types:ReferencedBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsIn">
+ <wsdl:part name="In" type="types:ArrayOfBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsOut">
+ <wsdl:part name="Out" type="types:ArrayOfBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64In">
+ <wsdl:part name="In" type="types:ReferencedBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64Out">
+ <wsdl:part name="Out" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentIn">
+ <wsdl:part name="In" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentOut">
+ <wsdl:part name="Out" type="types:ReferencedBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoUnrefAttachmentsIn" />
+ <wsdl:message name="EchoUnrefAttachmentsOut" />
+ <wsdl:message name="EchoAttachmentAsStringIn">
+ <wsdl:part name="In" type="types:ReferencedText"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsStringOut">
+ <wsdl:part name="Out" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="AttachmentsPortType">
+ <wsdl:operation name="EchoAttachment">
+ <wsdl:input name="EchoAttachmentInput" message="EchoAttachmentIn"/>
+ <wsdl:output name="EchoAttachmentOutput" message="EchoAttachmentOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <wsdl:input name="EchoAttachmentsInput" message="EchoAttachmentsIn"/>
+ <wsdl:output name="EchoAttachmentsOutput" message="EchoAttachmentsOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <wsdl:input name="EchoAttachmentAsBase64Input" message="EchoAttachmentAsBase64In"/>
+ <wsdl:output name="EchoAttachmentAsBase64Output" message="EchoAttachmentAsBase64Out"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <wsdl:input name="EchoBase64AsAttachmentInput" message="EchoBase64AsAttachmentIn"/>
+ <wsdl:output name="EchoBase64AsAttachmentOutput" message="EchoBase64AsAttachmentOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoUnrefAttachments">
+ <wsdl:input name="EchoUnrefAttachmentsInput" message="EchoUnrefAttachmentsIn"/>
+ <wsdl:output name="EchoUnrefAttachmentsOutput" message="EchoUnrefAttachmentsOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsString">
+ <wsdl:input name="EchoAttachmentAsStringInput" message="EchoAttachmentAsStringIn"/>
+ <wsdl:output name="EchoAttachmentAsStringOutput" message="EchoAttachmentAsStringOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="AttachmentsBinding" type="AttachmentsPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="EchoAttachment">
+ <soap:operation style="rpc" soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <soap:operation style="rpc" soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentsInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentsOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <soap:operation style="rpc" soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentAsBase64Input">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentAsBase64Output">
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <soap:operation style="rpc" soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoBase64AsAttachmentInput">
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoBase64AsAttachmentOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoUnrefAttachments">
+ <soap:operation style="rpc" soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoUnrefAttachmentsInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoUnrefAttachmentsOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsString">
+ <soap:operation style="rpc" soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentAsStringInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentAsStringOutput">
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Round4DIMERPC">
+ <wsdl:port name="Round4DIMERPCTestSoap" binding="AttachmentsBinding">
+ <soap:address location="test://" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.inc b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.inc
new file mode 100644
index 0000000..ef9d9b8
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.inc
@@ -0,0 +1,25 @@
+<?php
+class SOAP_Interop_GroupG {
+
+ function EchoBase64AsAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachmentAsBase64($in) {
+ return $in;
+ }
+
+ function EchoAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachments($in) {
+ return $in;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupG_dimedoc.wsdl");
+$server->setClass("SOAP_Interop_GroupG");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl
new file mode 100644
index 0000000..c67172e
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions name="SOAPBuilders"
+ xmlns="http://soapinterop.org/attachments/wsdl"
+ xmlns:types="http://soapinterop.org/attachments/xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+ xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
+ targetNamespace="http://soapinterop.org/attachments/wsdl">
+ <wsdl:types>
+ <schema
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://soapinterop.org/attachments/xsd"
+ elementFormDefault="qualified"
+ attributeFormDefault="qualified">
+
+ <complexType name="binary">
+ <simpleContent>
+ <extension base="xsd:base64Binary">
+ <attribute name="href" type="xsd:anyURI"/>
+ </extension>
+ </simpleContent>
+ </complexType >
+
+ <element name="EchoAttachment" type="types:EchoAttachment"/>
+ <element name="EchoAttachmentResponse" type="types:EchoAttachmentResponse"/>
+ <complexType name="EchoAttachment">
+ <sequence>
+ <element name="In" type="types:binary"/>
+ </sequence>
+ </complexType>
+ <complexType name="EchoAttachmentResponse">
+ <sequence>
+ <element name="Out" type="types:binary"/>
+ </sequence>
+ </complexType>
+
+ <element name="EchoAttachments" type="types:Attachments"/>
+ <element name="EchoAttachmentsResponse" type="types:Attachments"/>
+ <complexType name="Attachments">
+ <sequence>
+ <element name="Item" minOccurs="0" maxOccurs="unbounded" type="types:binary">
+ </element>
+ </sequence>
+ </complexType>
+
+ <element name="EchoAttachmentAsBase64" type="types:EchoAttachment"/>
+ <element name="EchoAttachmentAsBase64Response" type="types:EchoAttachmentResponse"/>
+
+ <element name="EchoBase64AsAttachment" type="types:EchoAttachment"/>
+ <element name="EchoBase64AsAttachmentResponse" type="types:EchoAttachmentResponse"/>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="EchoAttachmentIn">
+ <wsdl:part name="In" element="types:EchoAttachment"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentOut">
+ <wsdl:part name="Out" element="types:EchoAttachmentResponse"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsIn">
+ <wsdl:part name="In" element="types:EchoAttachments"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsOut">
+ <wsdl:part name="Out" element="types:EchoAttachmentsResponse"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64In">
+ <wsdl:part name="In" element="types:EchoAttachmentAsBase64"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64Out">
+ <wsdl:part name="Out" element="types:EchoAttachmentAsBase64Response"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentIn">
+ <wsdl:part name="In" element="types:EchoBase64AsAttachment"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentOut">
+ <wsdl:part name="Out" element="types:EchoBase64AsAttachmentResponse"/>
+ </wsdl:message>
+
+ <wsdl:portType name="AttachmentsPortType">
+ <wsdl:operation name="EchoAttachment">
+ <wsdl:input name="EchoAttachmentInput" message="EchoAttachmentIn"/>
+ <wsdl:output name="EchoAttachmentOutput" message="EchoAttachmentOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <wsdl:input name="EchoAttachmentsInput" message="EchoAttachmentsIn"/>
+ <wsdl:output name="EchoAttachmentsOutput" message="EchoAttachmentsOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <wsdl:input name="EchoAttachmentAsBase64Input" message="EchoAttachmentAsBase64In"/>
+ <wsdl:output name="EchoAttachmentAsBase64Output" message="EchoAttachmentAsBase64Out"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <wsdl:input name="EchoBase64AsAttachmentInput" message="EchoBase64AsAttachmentIn"/>
+ <wsdl:output name="EchoBase64AsAttachmentOutput" message="EchoBase64AsAttachmentOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="AttachmentsBinding" type="AttachmentsPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="EchoAttachment">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentInput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="In" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentOutput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal" />
+ </mime:part>
+ <mime:part>
+ <mime:content part="Out" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentsInput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="In" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentsOutput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="Out" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentAsBase64Input">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="In" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentAsBase64Output">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoBase64AsAttachmentInput">
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="EchoBase64AsAttachmentOutput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="Out" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Round4MIMEDOC">
+ <wsdl:port name="Round4MIMEDOCTestSoap" binding="AttachmentsBinding">
+ <soap:address location="test://" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.inc b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.inc
new file mode 100644
index 0000000..ef9d9b8
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.inc
@@ -0,0 +1,25 @@
+<?php
+class SOAP_Interop_GroupG {
+
+ function EchoBase64AsAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachmentAsBase64($in) {
+ return $in;
+ }
+
+ function EchoAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachments($in) {
+ return $in;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupG_dimedoc.wsdl");
+$server->setClass("SOAP_Interop_GroupG");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl
new file mode 100644
index 0000000..30a56d1
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions name="SOAPBuilders"
+ xmlns="http://soapinterop.org/attachments/wsdl"
+ xmlns:types="http://soapinterop.org/attachments/xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+ xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
+ targetNamespace="http://soapinterop.org/attachments/wsdl">
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/attachments/xsd">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="ArrayOfBinary">
+ <complexContent>
+ <restriction base="soap-enc:Array">
+ <attribute ref="soap-enc:arrayType" wsdl:arrayType="soap-enc:base64Binary[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="EchoAttachmentIn">
+ <wsdl:part name="In" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentOut">
+ <wsdl:part name="Out" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsIn">
+ <wsdl:part name="In" type="types:ArrayOfBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsOut">
+ <wsdl:part name="Out" type="types:ArrayOfBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64In">
+ <wsdl:part name="In" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64Out">
+ <wsdl:part name="Out" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentIn">
+ <wsdl:part name="In" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentOut">
+ <wsdl:part name="Out" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:portType name="AttachmentsPortType">
+ <wsdl:operation name="EchoAttachment">
+ <wsdl:input name="EchoAttachmentInput" message="EchoAttachmentIn"/>
+ <wsdl:output name="EchoAttachmentOutput" message="EchoAttachmentOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <wsdl:input name="EchoAttachmentsInput" message="EchoAttachmentsIn"/>
+ <wsdl:output name="EchoAttachmentsOutput" message="EchoAttachmentsOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <wsdl:input name="EchoAttachmentAsBase64Input" message="EchoAttachmentAsBase64In"/>
+ <wsdl:output name="EchoAttachmentAsBase64Output" message="EchoAttachmentAsBase64Out"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <wsdl:input name="EchoBase64AsAttachmentInput" message="EchoBase64AsAttachmentIn"/>
+ <wsdl:output name="EchoBase64AsAttachmentOutput" message="EchoBase64AsAttachmentOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="AttachmentsBinding" type="AttachmentsPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="EchoAttachment">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentInput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="In" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentOutput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="Out" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentsInput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="In" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentsOutput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="Out" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentAsBase64Input">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="In" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentAsBase64Output">
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoBase64AsAttachmentInput">
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoBase64AsAttachmentOutput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="Out" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Round4MIMERPC">
+ <wsdl:port name="Round4MIMERPCTestSoap" binding="AttachmentsBinding">
+ <soap:address location="test://" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/interop/Round4/GroupG/skipif.inc b/ext/soap/tests/interop/Round4/GroupG/skipif.inc
new file mode 100644
index 0000000..fa8574e
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt
new file mode 100644
index 0000000..27a0c93
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 001 (php/wsdl): echoSOAPStructFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoSOAPStructFault($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/requestresponse"><SOAP-ENV:Body><ns2:echoSOAPStructFaultRequest><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns2:echoSOAPStructFaultRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoSOAPStructFault'.</faultstring><detail><ns2:SOAPStructFaultPart><ns1:soapStruct><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns1:soapStruct></ns2:SOAPStructFaultPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt
new file mode 100644
index 0000000..1ed1fe7
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 002 (php/wsdl): echoBaseStructFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$struct = new BaseStruct(new SOAPStruct("a1",11,12.345),11);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBaseStructFault($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/requestresponse"><SOAP-ENV:Body><ns2:echoBaseStructFaultRequest><ns1:structMessage><ns1:varString>a1</ns1:varString><ns1:varInt>11</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns1:structMessage><ns1:shortMessage>11</ns1:shortMessage></ns2:echoBaseStructFaultRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoBaseStructFault'.</faultstring><detail><ns2:BaseStructPart><ns1:structMessage><ns1:varString>a1</ns1:varString><ns1:varInt>11</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns1:structMessage><ns1:shortMessage>11</ns1:shortMessage></ns2:BaseStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt
new file mode 100644
index 0000000..fde7d75
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt
@@ -0,0 +1,44 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 003 (php/wsdl): echoExtendedStructFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+$struct = new ExtendedStruct(new SOAPStruct("a1",11,12.345),12,"arg",-3,5);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoExtendedStructFault($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/requestresponse"><SOAP-ENV:Body><ns2:echoExtendedStructFaultRequest><ns1:structMessage><ns1:varString>a1</ns1:varString><ns1:varInt>11</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns1:structMessage><ns1:shortMessage>12</ns1:shortMessage><ns1:stringMessage>arg</ns1:stringMessage><ns1:intMessage>-3</ns1:intMessage><ns1:anotherIntMessage>5</ns1:anotherIntMessage></ns2:echoExtendedStructFaultRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoExtendedStructFault'.</faultstring><detail><ns2:ExtendedStructPart><ns1:structMessage><ns1:varString>a1</ns1:varString><ns1:varInt>11</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns1:structMessage><ns1:shortMessage>12</ns1:shortMessage><ns1:stringMessage>arg</ns1:stringMessage><ns1:intMessage>-3</ns1:intMessage><ns1:anotherIntMessage>5</ns1:anotherIntMessage></ns2:ExtendedStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt
new file mode 100644
index 0000000..d448974
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt
@@ -0,0 +1,39 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 004 (php/wsdl): echoMultipleFaults1(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$s1 = new SOAPStruct('arg1',34,325.325);
+$s2 = new BaseStruct(new SOAPStruct('arg2',34,325.325),12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 1,
+ "param1" => $s1,
+ "param2" => $s2));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>1</ns1:whichFault><ns1:param1><ns2:varString>arg1</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>325.325</ns2:varFloat></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>arg2</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>325.325</ns2:varFloat></ns2:structMessage><ns2:shortMessage>12</ns2:shortMessage></ns1:param2></ns1:echoMultipleFaults1Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:SOAPStructFaultPart><ns1:soapStruct><ns1:varString>arg1</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns1:soapStruct></ns2:SOAPStructFaultPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt
new file mode 100644
index 0000000..52451ac
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt
@@ -0,0 +1,39 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 005 (php/wsdl): echoMultipleFaults1(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$s1 = new SOAPStruct('arg1',34,325.325);
+$s2 = new BaseStruct(new SOAPStruct('arg2',34,325.325),12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 2,
+ "param1" => $s1,
+ "param2" => $s2));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>2</ns1:whichFault><ns1:param1><ns2:varString>arg1</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>325.325</ns2:varFloat></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>arg2</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>325.325</ns2:varFloat></ns2:structMessage><ns2:shortMessage>12</ns2:shortMessage></ns1:param2></ns1:echoMultipleFaults1Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:BaseStructPart><ns1:structMessage><ns1:varString>arg2</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns1:structMessage><ns1:shortMessage>12</ns1:shortMessage></ns2:BaseStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt
new file mode 100644
index 0000000..c9ad1c5
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt
@@ -0,0 +1,39 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 006 (php/wsdl): echoMultipleFaults1(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$s1 = new SOAPStruct('arg1',34,325.325);
+$s2 = new BaseStruct(new SOAPStruct('arg2',34,325.325),12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 3,
+ "param1" => $s1,
+ "param2" => $s2));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>3</ns1:whichFault><ns1:param1><ns2:varString>arg1</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>325.325</ns2:varFloat></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>arg2</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>325.325</ns2:varFloat></ns2:structMessage><ns2:shortMessage>12</ns2:shortMessage></ns1:param2></ns1:echoMultipleFaults1Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:SOAPStructFaultPart><ns1:soapStruct><ns1:varString>arg1</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns1:soapStruct></ns2:SOAPStructFaultPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt
new file mode 100644
index 0000000..fac6c3b
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt
@@ -0,0 +1,54 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 007 (php/wsdl): echoMultipleFaults2(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(new SOAPStruct("s1",1,1.1),1);
+$s2 = new ExtendedStruct(new SOAPStruct("s2",2,2.2),2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(new SOAPStruct("s3",3,3.3),3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 1,
+ "param1" => $s1,
+ "param2" => $s2,
+ "param3" => $s3));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>1</ns1:whichFault><ns1:param1><ns2:structMessage><ns2:varString>s1</ns2:varString><ns2:varInt>1</ns2:varInt><ns2:varFloat>1.1</ns2:varFloat></ns2:structMessage><ns2:shortMessage>1</ns2:shortMessage></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>s2</ns2:varString><ns2:varInt>2</ns2:varInt><ns2:varFloat>2.2</ns2:varFloat></ns2:structMessage><ns2:shortMessage>2</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage></ns1:param2><ns1:param3><ns2:structMessage><ns2:varString>s3</ns2:varString><ns2:varInt>3</ns2:varInt><ns2:varFloat>3.3</ns2:varFloat></ns2:structMessage><ns2:shortMessage>3</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage><ns2:booleanMessage>true</ns2:booleanMessage></ns1:param3></ns1:echoMultipleFaults2Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:BaseStructPart><ns1:structMessage><ns1:varString>s1</ns1:varString><ns1:varInt>1</ns1:varInt><ns1:varFloat>1.1</ns1:varFloat></ns1:structMessage><ns1:shortMessage>1</ns1:shortMessage></ns2:BaseStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt
new file mode 100644
index 0000000..c020790
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt
@@ -0,0 +1,54 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 008 (php/wsdl): echoMultipleFaults2(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(new SOAPStruct("s1",1,1.1),1);
+$s2 = new ExtendedStruct(new SOAPStruct("s2",2,2.2),2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(new SOAPStruct("s3",3,3.3),3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 2,
+ "param1" => $s1,
+ "param2" => $s2,
+ "param3" => $s3));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>2</ns1:whichFault><ns1:param1><ns2:structMessage><ns2:varString>s1</ns2:varString><ns2:varInt>1</ns2:varInt><ns2:varFloat>1.1</ns2:varFloat></ns2:structMessage><ns2:shortMessage>1</ns2:shortMessage></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>s2</ns2:varString><ns2:varInt>2</ns2:varInt><ns2:varFloat>2.2</ns2:varFloat></ns2:structMessage><ns2:shortMessage>2</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage></ns1:param2><ns1:param3><ns2:structMessage><ns2:varString>s3</ns2:varString><ns2:varInt>3</ns2:varInt><ns2:varFloat>3.3</ns2:varFloat></ns2:structMessage><ns2:shortMessage>3</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage><ns2:booleanMessage>true</ns2:booleanMessage></ns1:param3></ns1:echoMultipleFaults2Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:ExtendedStructPart><ns1:structMessage><ns1:varString>s2</ns1:varString><ns1:varInt>2</ns1:varInt><ns1:varFloat>2.2</ns1:varFloat></ns1:structMessage><ns1:shortMessage>2</ns1:shortMessage><ns1:stringMessage>arg</ns1:stringMessage><ns1:intMessage>-3</ns1:intMessage><ns1:anotherIntMessage>5</ns1:anotherIntMessage></ns2:ExtendedStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt
new file mode 100644
index 0000000..f3a07d7
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt
@@ -0,0 +1,54 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 009 (php/wsdl): echoMultipleFaults2(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(new SOAPStruct("s1",1,1.1),1);
+$s2 = new ExtendedStruct(new SOAPStruct("s2",2,2.2),2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(new SOAPStruct("s3",3,3.3),3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 3,
+ "param1" => $s1,
+ "param2" => $s2,
+ "param3" => $s3));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>3</ns1:whichFault><ns1:param1><ns2:structMessage><ns2:varString>s1</ns2:varString><ns2:varInt>1</ns2:varInt><ns2:varFloat>1.1</ns2:varFloat></ns2:structMessage><ns2:shortMessage>1</ns2:shortMessage></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>s2</ns2:varString><ns2:varInt>2</ns2:varInt><ns2:varFloat>2.2</ns2:varFloat></ns2:structMessage><ns2:shortMessage>2</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage></ns1:param2><ns1:param3><ns2:structMessage><ns2:varString>s3</ns2:varString><ns2:varInt>3</ns2:varInt><ns2:varFloat>3.3</ns2:varFloat></ns2:structMessage><ns2:shortMessage>3</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage><ns2:booleanMessage>true</ns2:booleanMessage></ns1:param3></ns1:echoMultipleFaults2Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:MoreExtendedStructPart><ns1:structMessage><ns1:varString>s3</ns1:varString><ns1:varInt>3</ns1:varInt><ns1:varFloat>3.3</ns1:varFloat></ns1:structMessage><ns1:shortMessage>3</ns1:shortMessage><ns1:stringMessage>arg</ns1:stringMessage><ns1:intMessage>-3</ns1:intMessage><ns1:anotherIntMessage>5</ns1:anotherIntMessage><ns1:booleanMessage>true</ns1:booleanMessage></ns2:MoreExtendedStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt
new file mode 100644
index 0000000..55d62c1
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt
@@ -0,0 +1,54 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 010 (php/wsdl): echoMultipleFaults2(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(new SOAPStruct("s1",1,1.1),1);
+$s2 = new ExtendedStruct(new SOAPStruct("s2",2,2.2),2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(new SOAPStruct("s3",3,3.3),3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 4,
+ "param1" => $s1,
+ "param2" => $s2,
+ "param3" => $s3));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>4</ns1:whichFault><ns1:param1><ns2:structMessage><ns2:varString>s1</ns2:varString><ns2:varInt>1</ns2:varInt><ns2:varFloat>1.1</ns2:varFloat></ns2:structMessage><ns2:shortMessage>1</ns2:shortMessage></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>s2</ns2:varString><ns2:varInt>2</ns2:varInt><ns2:varFloat>2.2</ns2:varFloat></ns2:structMessage><ns2:shortMessage>2</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage></ns1:param2><ns1:param3><ns2:structMessage><ns2:varString>s3</ns2:varString><ns2:varInt>3</ns2:varInt><ns2:varFloat>3.3</ns2:varFloat></ns2:structMessage><ns2:shortMessage>3</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage><ns2:booleanMessage>true</ns2:booleanMessage></ns1:param3></ns1:echoMultipleFaults2Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:BaseStructPart><ns1:structMessage><ns1:varString>s1</ns1:varString><ns1:varInt>1</ns1:varInt><ns1:varFloat>1.1</ns1:varFloat></ns1:structMessage><ns1:shortMessage>1</ns1:shortMessage></ns2:BaseStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt
new file mode 100644
index 0000000..bf867d9
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 001 (php/wsdl): echoSOAPStructFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoSOAPStructFault(array("soapStruct"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSOAPStructFault><param xsi:type="ns2:SOAPStructFault"><soapStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></soapStruct></param></ns1:echoSOAPStructFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoSOAPStructFault'.</faultstring><detail><ns2:part1 xsi:type="ns1:SOAPStructFault"><soapStruct xsi:type="ns1:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></soapStruct></ns2:part1></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt
new file mode 100644
index 0000000..6ac7641
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 002 (php/wsdl): echoBaseStructFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$struct = new BaseStruct(12.345,12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBaseStructFault($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBaseStructFault><param xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></param></ns1:echoBaseStructFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoBaseStructFault'.</faultstring><detail><ns2:part2 xsi:type="ns1:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></ns2:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt
new file mode 100644
index 0000000..dda5b69
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 003 (php/wsdl): echoExtendedStructFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+$struct = new ExtendedStruct(12.345,12,"arg",-3,5);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoExtendedStructFault($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoExtendedStructFault><param xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param></ns1:echoExtendedStructFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoExtendedStructFault'.</faultstring><detail><ns2:part3 xsi:type="ns1:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></ns2:part3></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt
new file mode 100644
index 0000000..e4b2917
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 004 (php/wsdl): echoMultipleFaults1(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$s1 = new SOAPStruct('arg',34,325.325);
+$s2 = new BaseStruct(12.345,12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(1,$s1,$s2);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></param1><param2 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part1 xsi:type="ns1:SOAPStructFault"><soapStruct xsi:type="ns1:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></soapStruct></ns2:part1></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt
new file mode 100644
index 0000000..074b258
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 005 (php/wsdl): echoMultipleFaults1(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$s1 = new SOAPStruct('arg',34,325.325);
+$s2 = new BaseStruct(12.345,12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(2,$s1,$s2);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></param1><param2 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part2 xsi:type="ns1:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></ns2:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt
new file mode 100644
index 0000000..8fd9b39
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 006 (php/wsdl): echoMultipleFaults1(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$s1 = new SOAPStruct('arg',34,325.325);
+$s2 = new BaseStruct(12.345,12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(3,$s1,$s2);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></param1><param2 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part1 xsi:type="ns1:SOAPStructFault"><soapStruct xsi:type="ns1:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></soapStruct></ns2:part1></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt
new file mode 100644
index 0000000..f54c188
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt
@@ -0,0 +1,45 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 007 (php/wsdl): echoMultipleFaults2(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(12.345,1);
+$s2 = new ExtendedStruct(12.345,2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(12.345,3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(1,$s1,$s2,$s3);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></param1><param2 xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param2><param3 xsi:type="ns2:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part2 xsi:type="ns1:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></ns2:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt
new file mode 100644
index 0000000..d6f16a7
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt
@@ -0,0 +1,45 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 008 (php/wsdl): echoMultipleFaults2(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(12.345,1);
+$s2 = new ExtendedStruct(12.345,2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(12.345,3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(2,$s1,$s2,$s3);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></param1><param2 xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param2><param3 xsi:type="ns2:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part3 xsi:type="ns1:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></ns2:part3></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt
new file mode 100644
index 0000000..2bf7341
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt
@@ -0,0 +1,45 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 009 (php/wsdl): echoMultipleFaults2(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(12.345,1);
+$s2 = new ExtendedStruct(12.345,2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(12.345,3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(3,$s1,$s2,$s3);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></param1><param2 xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param2><param3 xsi:type="ns2:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part4 xsi:type="ns1:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></ns2:part4></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt
new file mode 100644
index 0000000..f1eeac2
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt
@@ -0,0 +1,45 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 010 (php/wsdl): echoMultipleFaults2(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(12.345,1);
+$s2 = new ExtendedStruct(12.345,2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(12.345,3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(4,$s1,$s2,$s3);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">4</whichFault><param1 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></param1><param2 xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param2><param3 xsi:type="ns2:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part2 xsi:type="ns1:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></ns2:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_001w.phpt
new file mode 100644
index 0000000..104f7f5
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_001w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 001 (php/wsdl): echoEmptyFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoEmptyFault();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse"><SOAP-ENV:Body><ns1:echoEmptyFaultRequest/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoEmptyFault'.</faultstring><detail><ns1:EmptyPart/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_002w.phpt
new file mode 100644
index 0000000..b713aed
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_002w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 002 (php/wsdl): echoStringFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringFault("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse"><SOAP-ENV:Body><ns1:echoStringFaultRequest>Hello World</ns1:echoStringFaultRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoStringFault'.</faultstring><detail><ns1:StringPart>Hello World</ns1:StringPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_003w.phpt
new file mode 100644
index 0000000..e203ea0
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_003w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 003 (php/wsdl): echoIntArrayFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoIntArrayFault(array(34,12.345));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/requestresponse"><SOAP-ENV:Body><ns2:echoIntArrayFaultRequest><ns1:value>34</ns1:value><ns1:value>12</ns1:value></ns2:echoIntArrayFaultRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoIntArrayFault'.</faultstring><detail><ns2:ArrayOfIntPart><ns1:value>34</ns1:value><ns1:value>12</ns1:value></ns2:ArrayOfIntPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_004w.phpt
new file mode 100644
index 0000000..f673ec0
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_004w.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 004 (php/wsdl): echoMultipleFaults1(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 1,
+ "param1" => "Hello world",
+ "param2" => array(12.345,45,678)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>1</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2><ns2:value>12.345</ns2:value><ns2:value>45</ns2:value><ns2:value>678</ns2:value></ns1:param2></ns1:echoMultipleFaults1Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns1:EmptyPart/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_005w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_005w.phpt
new file mode 100644
index 0000000..67db504
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_005w.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 005 (php/wsdl): echoMultipleFaults1(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 2,
+ "param1" => "Hello world",
+ "param2" => array(12.345,45,678)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>2</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2><ns2:value>12.345</ns2:value><ns2:value>45</ns2:value><ns2:value>678</ns2:value></ns1:param2></ns1:echoMultipleFaults1Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns1:StringPart>Hello world</ns1:StringPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_006w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_006w.phpt
new file mode 100644
index 0000000..7c6c1b5
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_006w.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 006 (php/wsdl): echoMultipleFaults1(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 3,
+ "param1" => "Hello world",
+ "param2" => array(12.345,45,678)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>3</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2><ns2:value>12.345</ns2:value><ns2:value>45</ns2:value><ns2:value>678</ns2:value></ns1:param2></ns1:echoMultipleFaults1Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:ArrayOfFloatPart><ns1:value>12.345</ns1:value><ns1:value>45</ns1:value><ns1:value>678</ns1:value></ns2:ArrayOfFloatPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_007w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_007w.phpt
new file mode 100644
index 0000000..e8e9bba
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_007w.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 007 (php/wsdl): echoMultipleFaults1(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 4,
+ "param1" => "Hello world",
+ "param2" => array(12.345,45,678)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>4</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2><ns2:value>12.345</ns2:value><ns2:value>45</ns2:value><ns2:value>678</ns2:value></ns1:param2></ns1:echoMultipleFaults1Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns1:EmptyPart/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_008w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_008w.phpt
new file mode 100644
index 0000000..5bd6b4c
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_008w.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 008 (php/wsdl): echoMultipleFaults2(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 1,
+ "param1" => "Hello world",
+ "param2" => 12.345,
+ "param3" => array("one","two","three")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>1</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2>12.345</ns1:param2><ns1:param3><ns2:value>one</ns2:value><ns2:value>two</ns2:value><ns2:value>three</ns2:value></ns1:param3></ns1:echoMultipleFaults2Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:FloatPart>12.345</ns1:FloatPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_009w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_009w.phpt
new file mode 100644
index 0000000..461a477
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_009w.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 009 (php/wsdl): echoMultipleFaults2(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 2,
+ "param1" => "Hello world",
+ "param2" => 12.345,
+ "param3" => array("one","two","three")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>2</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2>12.345</ns1:param2><ns1:param3><ns2:value>one</ns2:value><ns2:value>two</ns2:value><ns2:value>three</ns2:value></ns1:param3></ns1:echoMultipleFaults2Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:StringPart>Hello world</ns1:StringPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_010w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_010w.phpt
new file mode 100644
index 0000000..f312c36
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_010w.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 010 (php/wsdl): echoMultipleFaults2(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 3,
+ "param1" => "Hello world",
+ "param2" => 12.345,
+ "param3" => array("one","two","three")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>3</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2>12.345</ns1:param2><ns1:param3><ns2:value>one</ns2:value><ns2:value>two</ns2:value><ns2:value>three</ns2:value></ns1:param3></ns1:echoMultipleFaults2Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:ArrayOfStringPart><ns1:value>one</ns1:value><ns1:value>two</ns1:value><ns1:value>three</ns1:value></ns2:ArrayOfStringPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_011w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_011w.phpt
new file mode 100644
index 0000000..403cfaa
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_011w.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 011 (php/wsdl): echoMultipleFaults2(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 4,
+ "param1" => "Hello world",
+ "param2" => 12.345,
+ "param3" => array("one","two","three")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>4</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2>12.345</ns1:param2><ns1:param3><ns2:value>one</ns2:value><ns2:value>two</ns2:value><ns2:value>three</ns2:value></ns1:param3></ns1:echoMultipleFaults2Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:FloatPart>12.345</ns1:FloatPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_012w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_012w.phpt
new file mode 100644
index 0000000..e979765
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_012w.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 012 (php/wsdl): echoMultipleFaults3(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults3(array("whichFault" => 1,
+ "param1" => "arg1",
+ "param2" => "arg2"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse"><SOAP-ENV:Body><ns1:echoMultipleFaults3Request><ns1:whichFault>1</ns1:whichFault><ns1:param1>arg1</ns1:param1><ns1:param2>arg2</ns1:param2></ns1:echoMultipleFaults3Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:StringPart>arg1</ns1:StringPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_013w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_013w.phpt
new file mode 100644
index 0000000..92e3e3d
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_013w.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 013 (php/wsdl): echoMultipleFaults3(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults3(array("whichFault" => 2,
+ "param1" => "arg1",
+ "param2" => "arg2"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse"><SOAP-ENV:Body><ns1:echoMultipleFaults3Request><ns1:whichFault>2</ns1:whichFault><ns1:param1>arg1</ns1:param1><ns1:param2>arg2</ns1:param2></ns1:echoMultipleFaults3Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:String2Part>arg2</ns1:String2Part></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_014w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_014w.phpt
new file mode 100644
index 0000000..84875bd
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_014w.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 014 (php/wsdl): echoMultipleFaults3(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults3(array("whichFault" => 3,
+ "param1" => "arg1",
+ "param2" => "arg2"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse"><SOAP-ENV:Body><ns1:echoMultipleFaults3Request><ns1:whichFault>3</ns1:whichFault><ns1:param1>arg1</ns1:param1><ns1:param2>arg2</ns1:param2></ns1:echoMultipleFaults3Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:StringPart>arg1</ns1:StringPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_015w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_015w.phpt
new file mode 100644
index 0000000..0f61447
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_015w.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 015 (php/wsdl): echoMultipleFaults4(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults4(array("whichFault" => 1,
+ "param1" => 162,
+ "param2" => 1));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse"><SOAP-ENV:Body><ns1:echoMultipleFaults4Request><ns1:whichFault>1</ns1:whichFault><ns1:param1>162</ns1:param1><ns1:param2>1</ns1:param2></ns1:echoMultipleFaults4Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns1:IntPart>162</ns1:IntPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_016w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_016w.phpt
new file mode 100644
index 0000000..1b2379a
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_016w.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 016 (php/wsdl): echoMultipleFaults4(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults4(array("whichFault" => 2,
+ "param1" => 162,
+ "param2" => 1));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse"><SOAP-ENV:Body><ns1:echoMultipleFaults4Request><ns1:whichFault>2</ns1:whichFault><ns1:param1>162</ns1:param1><ns1:param2>1</ns1:param2></ns1:echoMultipleFaults4Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns1:EnumPart>1</ns1:EnumPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_017w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_017w.phpt
new file mode 100644
index 0000000..003f3ac
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_017w.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 017 (php/wsdl): echoMultipleFaults4(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults4(array("whichFault" => 3,
+ "param1" => 162,
+ "param2" => 1));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/requestresponse"><SOAP-ENV:Body><ns1:echoMultipleFaults4Request><ns1:whichFault>3</ns1:whichFault><ns1:param1>162</ns1:param1><ns1:param2>1</ns1:param2></ns1:echoMultipleFaults4Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns1:IntPart>162</ns1:IntPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_001w.phpt
new file mode 100644
index 0000000..ba76cfe
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_001w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 001 (php/wsdl): echoEmptyFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoEmptyFault();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoEmptyFault/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoEmptyFault'.</faultstring><detail><ns2:part1 xsi:nil="true" xsi:type="ns1:EmptyFault"/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_002w.phpt
new file mode 100644
index 0000000..0d82b67
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_002w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 002 (php/wsdl): echoStringFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringFault("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringFault><param xsi:type="xsd:string">Hello World</param></ns1:echoStringFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoStringFault'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">Hello World</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_003w.phpt
new file mode 100644
index 0000000..2925197
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_003w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 003 (php/wsdl): echoIntArrayFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoIntArrayFault(array(34,12.345));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntArrayFault><param SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns2:ArrayOfInt"><item xsi:type="xsd:int">34</item><item xsi:type="xsd:int">12</item></param></ns1:echoIntArrayFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoIntArrayFault'.</faultstring><detail><ns2:part5 SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:ArrayOfInt"><item xsi:type="xsd:int">34</item><item xsi:type="xsd:int">12</item></ns2:part5></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_004w.phpt
new file mode 100644
index 0000000..7926e15
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_004w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 004 (php/wsdl): echoMultipleFaults1(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(1,"Hello world",array(12.345,45,678));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="xsd:string">Hello world</param1><param2 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part1 xsi:nil="true" xsi:type="ns1:EmptyFault"/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_005w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_005w.phpt
new file mode 100644
index 0000000..fb332a4
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_005w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 005 (php/wsdl): echoMultipleFaults1(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(2,"Hello world",array(12.345,45,678));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="xsd:string">Hello world</param1><param2 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">Hello world</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_006w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_006w.phpt
new file mode 100644
index 0000000..2ed546f
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_006w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 006 (php/wsdl): echoMultipleFaults1(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(3,"Hello world",array(12.345,45,678));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="xsd:string">Hello world</param1><param2 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part7 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns1:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></ns2:part7></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_007w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_007w.phpt
new file mode 100644
index 0000000..bd31aa3
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_007w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 007 (php/wsdl): echoMultipleFaults1(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(4,"Hello world",array(12.345,45,678));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">4</whichFault><param1 xsi:type="xsd:string">Hello world</param1><param2 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part1 xsi:nil="true" xsi:type="ns1:EmptyFault"/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_008w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_008w.phpt
new file mode 100644
index 0000000..e61e374
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_008w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 008 (php/wsdl): echoMultipleFaults2(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(1, "Hello World", 12.345, array("one","two","three"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="xsd:string">Hello World</param1><param2 xsi:type="xsd:float">12.345</param2><param3 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:part4 xsi:type="xsd:float">12.345</ns1:part4></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_009w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_009w.phpt
new file mode 100644
index 0000000..d186947
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_009w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 009 (php/wsdl): echoMultipleFaults2(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(2, "Hello World", 12.345, array("one","two","three"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="xsd:string">Hello World</param1><param2 xsi:type="xsd:float">12.345</param2><param3 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">Hello World</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_010w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_010w.phpt
new file mode 100644
index 0000000..3431180
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_010w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 010 (php/wsdl): echoMultipleFaults2(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(3, "Hello World", 12.345, array("one","two","three"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="xsd:string">Hello World</param1><param2 xsi:type="xsd:float">12.345</param2><param3 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part6 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns1:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></ns2:part6></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_011w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_011w.phpt
new file mode 100644
index 0000000..1d66e0c
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_011w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 011 (php/wsdl): echoMultipleFaults2(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(4, "Hello World", 12.345, array("one","two","three"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">4</whichFault><param1 xsi:type="xsd:string">Hello World</param1><param2 xsi:type="xsd:float">12.345</param2><param3 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:part4 xsi:type="xsd:float">12.345</ns1:part4></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_012w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_012w.phpt
new file mode 100644
index 0000000..e6bbcc7
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_012w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 012 (php/wsdl): echoMultipleFaults3(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults3(1,"arg1","arg2");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults3><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="xsd:string">arg1</param1><param2 xsi:type="xsd:string">arg2</param2></ns1:echoMultipleFaults3></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl/fault1" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">arg1</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_013w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_013w.phpt
new file mode 100644
index 0000000..ba93028
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_013w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 013 (php/wsdl): echoMultipleFaults3(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults3(2,"arg1","arg2");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults3><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="xsd:string">arg1</param1><param2 xsi:type="xsd:string">arg2</param2></ns1:echoMultipleFaults3></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl/fault2" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">arg2</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_014w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_014w.phpt
new file mode 100644
index 0000000..e7449d9
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_014w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 014 (php/wsdl): echoMultipleFaults3(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults3(3,"arg1","arg2");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults3><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="xsd:string">arg1</param1><param2 xsi:type="xsd:string">arg2</param2></ns1:echoMultipleFaults3></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl/fault1" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">arg1</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_015w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_015w.phpt
new file mode 100644
index 0000000..7da5cd5
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_015w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 015 (php/wsdl): echoMultipleFaults4(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults4(1, 162, 1);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults4><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="xsd:int">162</param1><param2 xsi:type="ns2:Enum">1</param2></ns1:echoMultipleFaults4></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns1:part3 xsi:type="xsd:int">162</ns1:part3></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_016w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_016w.phpt
new file mode 100644
index 0000000..e44b743
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_016w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 016 (php/wsdl): echoMultipleFaults4(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults4(2, 162, 1);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults4><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="xsd:int">162</param1><param2 xsi:type="ns2:Enum">1</param2></ns1:echoMultipleFaults4></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns2:part9 xsi:type="ns1:Enum">1</ns2:part9></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_017w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_017w.phpt
new file mode 100644
index 0000000..f7de4aa
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_017w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 017 (php/wsdl): echoMultipleFaults4(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults4(3, 162, 1);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults4><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="xsd:int">162</param1><param2 xsi:type="ns2:Enum">1</param2></ns1:echoMultipleFaults4></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns1:part3 xsi:type="xsd:int">162</ns1:part3></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_001w.phpt
new file mode 100644
index 0000000..d7c5172
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_001w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH SoapFault 001 (php/wsdl): echoVersionMismatchFault(SOAP 1.1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_soapfault.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoVersionMismatchFault();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_soapfault.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVersionMismatchFault/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVersionMismatchFaultResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_002w.phpt
new file mode 100644
index 0000000..64ebf70
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_002w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH SoapFault 002 (php/wsdl): echoVersionMismatchFault(SOAP 1.2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_soapfault.wsdl",array("trace"=>1,"exceptions"=>0,"soap_version"=>SOAP_1_2));
+$client->echoVersionMismatchFault();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_soapfault.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body><ns1:echoVersionMismatchFault env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></env:Body></env:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body><ns1:echoVersionMismatchFaultResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_003w.phpt
new file mode 100644
index 0000000..ffed23b
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_003w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH SoapFault 003 (php/wsdl): echoVersionMismatchFault(unknown version)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://unknown.org/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVersionMismatchFault/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+echo $HTTP_RAW_POST_DATA."\n";
+include("round4_groupH_soapfault.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://unknown.org/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVersionMismatchFault/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:VersionMismatch</faultcode><faultstring>Wrong Version</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_004w.phpt
new file mode 100644
index 0000000..ad791dd
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_004w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH SoapFault 004 (php/wsdl): echoMustUnderstandFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/wsdl", "UnknownHeaderRequest", "Hello World", 1);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_soapfault.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVersionMismatchFault",array(), null, $hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_soapfault.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:UnknownHeaderRequest SOAP-ENV:mustUnderstand="1">Hello World</ns1:UnknownHeaderRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVersionMismatchFault/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:MustUnderstand</faultcode><faultstring>Header not understood</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.inc
new file mode 100644
index 0000000..a27f96e
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.inc
@@ -0,0 +1,38 @@
+<?php
+class SOAP_Interop_GroupH {
+
+ function echoSOAPStructFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoSOAPStructFault'.", null, array("soapStruct"=>$input), "ComplexFault");
+ }
+
+ function echoBaseStructFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoBaseStructFault'.", null, $input, "ComplexFault");
+ }
+
+ function echoExtendedStructFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoExtendedStructFault'.", null, $input, "ComplexFault");
+ }
+
+ function echoMultipleFaults1($input) {
+ if ($input->whichFault == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $input->param2, "ComplexFault2");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, array("soapStruct"=>$input->param1), "ComplexFault1");
+ }
+ }
+
+ function echoMultipleFaults2($input) {
+ if ($input->whichFault == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param2, "ComplexFault2");
+ } else if ($input->whichFault == 3) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param3, "ComplexFault3");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param1, "ComplexFault1");
+ }
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl");
+$server->setClass("SOAP_Interop_GroupH");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl
new file mode 100644
index 0000000..f1c383d
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl
@@ -0,0 +1,329 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://soapinterop.org/wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns2="http://soapinterop.org/types"
+ xmlns:ns3="http://soapinterop.org/types/part"
+ xmlns:ns4="http://soapinterop.org/types/requestresponse"
+ targetNamespace="http://soapinterop.org/wsdl">
+
+ <types>
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types"
+ targetNamespace="http://soapinterop.org/types">
+
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+
+ <complexType name="SOAPStruct">
+ <sequence>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="SOAPStructFault">
+ <sequence>
+ <element name="soapStruct" type="tns:SOAPStruct"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="BaseStruct">
+ <sequence>
+ <element name="structMessage" type="tns:SOAPStruct"/>
+ <element name="shortMessage" type="xsd:short"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ExtendedStruct">
+ <complexContent>
+ <extension base="tns:BaseStruct">
+ <sequence>
+ <element name="stringMessage" type="xsd:string"/>
+ <element name="intMessage" type="xsd:int"/>
+ <element name="anotherIntMessage" type="xsd:int"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="MoreExtendedStruct">
+ <complexContent>
+ <extension base="tns:ExtendedStruct">
+ <sequence>
+ <element name="booleanMessage" type="xsd:boolean"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ </schema>
+
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types/part"
+ targetNamespace="http://soapinterop.org/types/part">
+
+ <element name="SOAPStructFaultPart" type="ns2:SOAPStructFault"/>
+ <element name="BaseStructPart" type="ns2:BaseStruct"/>
+ <element name="ExtendedStructPart" type="ns2:ExtendedStruct"/>
+ <element name="MoreExtendedStructPart" type="ns2:MoreExtendedStruct"/>
+
+ </schema>
+
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types/requestresponse"
+ targetNamespace="http://soapinterop.org/types/requestresponse">
+
+ <element name="echoSOAPStructFaultRequest" type="ns2:SOAPStruct"/>
+ <element name="echoSOAPStructFaultResponse">
+ <complexType/>
+ </element>
+
+ <element name="echoBaseStructFaultRequest" type="ns2:BaseStruct"/>
+ <element name="echoBaseStructFaultResponse">
+ <complexType/>
+ </element>
+
+ <element name="echoExtendedStructFaultRequest" type="ns2:ExtendedStruct"/>
+ <element name="echoExtendedStructFaultResponse">
+ <complexType/>
+ </element>
+
+ <element name="echoMultipleFaults1Request">
+ <complexType>
+ <sequence>
+ <element name="whichFault" type="xsd:int"/>
+ <element name="param1" type="ns2:SOAPStruct"/>
+ <element name="param2" type="ns2:BaseStruct"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoMultipleFaults1Response">
+ <complexType/>
+ </element>
+
+ <element name="echoMultipleFaults2Request">
+ <complexType>
+ <sequence>
+ <element name="whichFault" type="xsd:int"/>
+ <element name="param1" type="ns2:BaseStruct"/>
+ <element name="param2" type="ns2:ExtendedStruct"/>
+ <element name="param3" type="ns2:MoreExtendedStruct"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoMultipleFaults2Response">
+ <complexType/>
+ </element>
+
+ </schema>
+ </types>
+
+ <message name="echoSOAPStructFaultRequest">
+ <part name="param" element="ns4:echoSOAPStructFaultRequest"/>
+ </message>
+ <message name="echoSOAPStructFaultResponse">
+ <part name="param" element="ns4:echoSOAPStructFaultResponse"/>
+ </message>
+
+ <message name="echoBaseStructFaultRequest">
+ <part name="param" element="ns4:echoBaseStructFaultRequest"/>
+ </message>
+ <message name="echoBaseStructFaultResponse">
+ <part name="param" element="ns4:echoBaseStructFaultResponse"/>
+ </message>
+
+ <message name="echoExtendedStructFaultRequest">
+ <part name="param" element="ns4:echoExtendedStructFaultRequest"/>
+ </message>
+ <message name="echoExtendedStructFaultResponse">
+ <part name="param" element="ns4:echoExtendedStructFaultResponse"/>
+ </message>
+
+ <message name="echoMultipleFaults1Request">
+ <part name="param" element="ns4:echoMultipleFaults1Request"/>
+ </message>
+ <message name="echoMultipleFaults1Response">
+ <part name="param" element="ns4:echoMultipleFaults1Response"/>
+ </message>
+
+ <message name="echoMultipleFaults2Request">
+ <part name="param" element="ns4:echoMultipleFaults2Request"/>
+ </message>
+ <message name="echoMultipleFaults2Response">
+ <part name="param" element="ns4:echoMultipleFaults2Response"/>
+ </message>
+
+ <!-- Fault messages -->
+ <message name="SOAPStructFault">
+ <part name="part3" element="ns3:SOAPStructFaultPart"/>
+ </message>
+ <message name="BaseStructFault">
+ <part name="part1" element="ns3:BaseStructPart"/>
+ </message>
+ <message name="ExtendedStructFault">
+ <part name="part2" element="ns3:ExtendedStructPart"/>
+ </message>
+ <message name="MoreExtendedStructFault">
+ <part name="part5" element="ns3:MoreExtendedStructPart"/>
+ </message>
+
+ <portType name="ComplexDocLitPortType">
+ <!--
+ Throws a fault with an embedded SOAPStruct
+ -->
+ <operation name="echoSOAPStructFault" parameterOrder="">
+ <input message="tns:echoSOAPStructFaultRequest"/>
+ <output message="tns:echoSOAPStructFaultResponse"/>
+ <fault name="ComplexFault" message="tns:SOAPStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with a base complex struct
+ -->
+ <operation name="echoBaseStructFault" parameterOrder="">
+ <input message="tns:echoBaseStructFaultRequest"/>
+ <output message="tns:echoBaseStructFaultResponse"/>
+ <fault name="ComplexFault" message="tns:BaseStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with an en extended complex type
+ -->
+ <operation name="echoExtendedStructFault" parameterOrder="">
+ <input message="tns:echoExtendedStructFaultRequest"/>
+ <output message="tns:echoExtendedStructFaultResponse"/>
+ <fault name="ComplexFault" message="tns:ExtendedStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with embedded complex type, fault with an
+ extended complex type and fault with an array of a base
+ complex type
+ -->
+ <operation name="echoMultipleFaults1" parameterOrder="param">
+ <input message="tns:echoMultipleFaults1Request"/>
+ <output message="tns:echoMultipleFaults1Response"/>
+ <fault name="ComplexFault1" message="tns:SOAPStructFault"/>
+ <fault name="ComplexFault2" message="tns:BaseStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with an array of base complex type and
+ a fault with doubly extended complex type
+ -->
+ <operation name="echoMultipleFaults2" parameterOrder="param">
+ <input message="tns:echoMultipleFaults2Request"/>
+ <output message="tns:echoMultipleFaults2Response"/>
+ <fault name="ComplexFault1" message="tns:BaseStructFault"/>
+ <fault name="ComplexFault2" message="tns:ExtendedStructFault"/>
+ <fault name="ComplexFault3" message="tns:MoreExtendedStructFault"/>
+ </operation>
+ </portType>
+
+ <binding name="ComplexDocLitBinding" type="tns:ComplexDocLitPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="echoSOAPStructFault">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ComplexFault">
+ <soap:fault
+ name="ComplexFault"
+ use="literal"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoBaseStructFault">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ComplexFault">
+ <soap:fault
+ name="ComplexFault"
+ use="literal"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoExtendedStructFault">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ComplexFault">
+ <soap:fault
+ name="ComplexFault"
+ use="literal"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults1">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ComplexFault1">
+ <soap:fault
+ name="ComplexFault1"
+ use="literal"/>
+ </fault>
+ <fault name="ComplexFault2">
+ <soap:fault
+ name="ComplexFault2"
+ use="literal"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults2">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ComplexFault1">
+ <soap:fault
+ name="ComplexFault1"
+ use="literal"/>
+ </fault>
+ <fault name="ComplexFault2">
+ <soap:fault
+ name="ComplexFault2"
+ use="literal"/>
+ </fault>
+ <fault name="ComplexFault3">
+ <soap:fault
+ name="ComplexFault3"
+ use="literal"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+ </binding>
+
+ <service name="ComplexDocLitService">
+ <port name="ComplexDocLitPort" binding="tns:ComplexDocLitBinding">
+ <soap:address
+ location="test://"/>
+ </port>
+ </service>
+</definitions>
+
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.inc
new file mode 100644
index 0000000..52165ba
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.inc
@@ -0,0 +1,38 @@
+<?php
+class SOAP_Interop_GroupH {
+
+ function echoSOAPStructFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoSOAPStructFault'.", null, $input, "ComplexFault");
+ }
+
+ function echoBaseStructFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoBaseStructFault'.", null, $input, "ComplexFault");
+ }
+
+ function echoExtendedStructFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoExtendedStructFault'.", null, $input, "ComplexFault");
+ }
+
+ function echoMultipleFaults1($which, $s1, $s2) {
+ if ($which == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $s2, "ComplexFault2");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, array("soapStruct"=>$s1), "ComplexFault1");
+ }
+ }
+
+ function echoMultipleFaults2($which, $s1, $s2, $s3) {
+ if ($which == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $s2, "ComplexFault2");
+ } else if ($which == 3) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $s3, "ComplexFault3");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $s1, "ComplexFault1");
+ }
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl");
+$server->setClass("SOAP_Interop_GroupH");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl
new file mode 100644
index 0000000..e78ca38
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl
@@ -0,0 +1,301 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://soapinterop.org/wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns2="http://soapinterop.org/types"
+ targetNamespace="http://soapinterop.org/wsdl">
+
+ <types>
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://soapinterop.org/types">
+
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+
+ <complexType name="SOAPStruct">
+ <sequence>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="SOAPStructFault">
+ <sequence>
+ <element name="soapStruct" type="tns:SOAPStruct"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="BaseStruct">
+ <sequence>
+ <element name="floatMessage" type="xsd:float"/>
+ <element name="shortMessage" type="xsd:short"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ExtendedStruct">
+ <complexContent>
+ <extension base="tns:BaseStruct">
+ <sequence>
+ <element name="stringMessage" type="xsd:string"/>
+ <element name="intMessage" type="xsd:int"/>
+ <element name="anotherIntMessage" type="xsd:int"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="MoreExtendedStruct">
+ <complexContent>
+ <extension base="tns:ExtendedStruct">
+ <sequence>
+ <element name="booleanMessage" type="xsd:boolean"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ </schema>
+ </types>
+
+ <message name="echoFaultResponse"/>
+ <message name="echoSOAPStructFaultRequest">
+ <part name="param" type="ns2:SOAPStructFault"/>
+ </message>
+ <message name="echoBaseStructFaultRequest">
+ <part name="param" type="ns2:BaseStruct"/>
+ </message>
+ <message name="echoExtendedStructFaultRequest">
+ <part name="param" type="ns2:ExtendedStruct"/>
+ </message>
+ <message name="echoMultipleFaults1Request">
+ <part name="whichFault" type="xsd:int"/>
+ <part name="param1" type="ns2:SOAPStruct"/>
+ <part name="param2" type="ns2:BaseStruct"/>
+ </message>
+ <message name="echoMultipleFaults2Request">
+ <part name="whichFault" type="xsd:int"/>
+ <part name="param1" type="ns2:BaseStruct"/>
+ <part name="param2" type="ns2:ExtendedStruct"/>
+ <part name="param3" type="ns2:MoreExtendedStruct"/>
+ </message>
+
+ <!-- Fault messages -->
+ <message name="SOAPStructFault">
+ <part name="part1" type="ns2:SOAPStructFault"/>
+ </message>
+ <message name="BaseStructFault">
+ <part name="part2" type="ns2:BaseStruct"/>
+ </message>
+ <message name="ExtendedStructFault">
+ <part name="part3" type="ns2:ExtendedStruct"/>
+ </message>
+ <message name="MoreExtendedStructFault">
+ <part name="part4" type="ns2:MoreExtendedStruct"/>
+ </message>
+
+ <portType name="ComplexRpcEncPortType">
+ <!--
+ Throws a fault with an embedded SOAPStruct
+ -->
+ <operation name="echoSOAPStructFault" parameterOrder="param">
+ <input message="tns:echoSOAPStructFaultRequest"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="ComplexFault" message="tns:SOAPStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with a base complex struct
+ -->
+ <operation name="echoBaseStructFault" parameterOrder="param">
+ <input message="tns:echoBaseStructFaultRequest"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="ComplexFault" message="tns:BaseStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with an en extended complex type
+ -->
+ <operation name="echoExtendedStructFault" parameterOrder="param">
+ <input message="tns:echoExtendedStructFaultRequest"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="ComplexFault" message="tns:ExtendedStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with embedded complex type and fault with
+ another complex type
+ -->
+ <operation name="echoMultipleFaults1" parameterOrder="whichFault param1 param2">
+ <input message="tns:echoMultipleFaults1Request"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="ComplexFault1" message="tns:SOAPStructFault"/>
+ <fault name="ComplexFault2" message="tns:BaseStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with base complex type, fault with an extended
+ complex type and a fault with doubly extended complex type
+ -->
+ <operation name="echoMultipleFaults2" parameterOrder="whichFault param1 param2 param3">
+ <input message="tns:echoMultipleFaults2Request"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="ComplexFault1" message="tns:BaseStructFault"/>
+ <fault name="ComplexFault2" message="tns:ExtendedStructFault"/>
+ <fault name="ComplexFault3" message="tns:MoreExtendedStructFault"/>
+ </operation>
+ </portType>
+
+ <binding name="ComplexRpcEncBinding" type="tns:ComplexRpcEncPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+ <operation name="echoSOAPStructFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="ComplexFault">
+ <soap:fault
+ name="ComplexFault"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoBaseStructFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="ComplexFault">
+ <soap:fault
+ name="ComplexFault"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoExtendedStructFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="ComplexFault">
+ <soap:fault
+ name="ComplexFault"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults1">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="ComplexFault1">
+ <soap:fault
+ name="ComplexFault1"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="ComplexFault2">
+ <soap:fault
+ name="ComplexFault2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults2">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="ComplexFault1">
+ <soap:fault
+ name="ComplexFault1"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="ComplexFault2">
+ <soap:fault
+ name="ComplexFault2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="ComplexFault3">
+ <soap:fault
+ name="ComplexFault3"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+ </binding>
+
+ <service name="ComplexRpcEncService">
+ <port name="ComplexRpcEncPort" binding="tns:ComplexRpcEncBinding">
+ <soap:address
+ location="test://"/>
+ </port>
+ </service>
+</definitions>
+
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.inc
new file mode 100644
index 0000000..e0e35f1
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.inc
@@ -0,0 +1,56 @@
+<?php
+class SOAP_Interop_GroupH {
+
+ function echoEmptyFault() {
+ return new SoapFault("Server", "Fault in response to 'echoEmptyFault'.", null, null, "SimpleFault");
+ }
+
+ function echoStringFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoStringFault'.", null, $input, "SimpleFault");
+ }
+
+ function echoIntArrayFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoIntArrayFault'.", null, $input, "SimpleFault");
+ }
+
+ function echoMultipleFaults1($input) {
+ if ($input->whichFault == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $input->param1, "SimpleFault2");
+ } else if ($input->whichFault == 3) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $input->param2, "SimpleFault3");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, null, "SimpleFault1");
+ }
+ }
+
+ function echoMultipleFaults2($input) {
+ if ($input->whichFault == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param1, "SimpleFault1");
+ } else if ($input->whichFault == 3) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param3, "SimpleFault3");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param2, "SimpleFault2");
+ }
+ }
+
+ function echoMultipleFaults3($input) {
+ if ($input->whichFault == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults3'.", null, $input->param2, "SimpleFault2");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults3'.", null, $input->param1, "SimpleFault1");
+ }
+ }
+
+ function echoMultipleFaults4($input) {
+ if ($input->whichFault == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults4'.", null, $input->param2, "SimpleFault2");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults4'.", null, $input->param1, "SimpleFault1");
+ }
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl");
+$server->setClass("SOAP_Interop_GroupH");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl
new file mode 100644
index 0000000..8f0d322
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl
@@ -0,0 +1,418 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://soapinterop.org/wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns2="http://soapinterop.org/types"
+ xmlns:ns3="http://soapinterop.org/types/part"
+ xmlns:ns4="http://soapinterop.org/types/requestresponse"
+ targetNamespace="http://soapinterop.org/wsdl">
+ <types>
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types"
+ targetNamespace="http://soapinterop.org/types">
+
+ <complexType name="ArrayOfString">
+ <sequence>
+ <element name="value" minOccurs="0" maxOccurs="unbounded" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ArrayOfInt">
+ <sequence>
+ <element name="value" minOccurs="0" maxOccurs="unbounded" type="xsd:int"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ArrayOfFloat">
+ <sequence>
+ <element name="value" minOccurs="0" maxOccurs="unbounded" type="xsd:float"/>
+ </sequence>
+ </complexType>
+
+ <simpleType name="Enum">
+ <restriction base="xsd:int">
+ <enumeration value="1"/>
+ <enumeration value="2"/>
+ </restriction>
+ </simpleType>
+
+ </schema>
+
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types/part"
+ targetNamespace="http://soapinterop.org/types/part">
+
+ <element name="EmptyPart">
+ <complexType/>
+ </element>
+
+ <element name="StringPart" type="xsd:string"/>
+ <element name="IntPart" type="xsd:int"/>
+ <element name="FloatPart" type="xsd:float"/>
+ <element name="ArrayOfStringPart" type="ns2:ArrayOfString"/>
+ <element name="ArrayOfIntPart" type="ns2:ArrayOfInt"/>
+ <element name="ArrayOfFloatPart" type="ns2:ArrayOfFloat"/>
+ <element name="String2Part" type="xsd:string"/>
+ <element name="EnumPart" type="ns2:Enum"/>
+
+ </schema>
+
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types/requestresponse"
+ targetNamespace="http://soapinterop.org/types/requestresponse">
+
+ <element name="echoEmptyFaultRequest">
+ <complexType/>
+ </element>
+ <element name="echoEmptyFaultResponse">
+ <complexType/>
+ </element>
+
+ <element name="echoStringFaultRequest" type="xsd:string"/>
+ <element name="echoStringFaultResponse">
+ <complexType/>
+ </element>
+
+ <element name="echoIntArrayFaultRequest" type="ns2:ArrayOfInt"/>
+ <element name="echoIntArrayFaultResponse">
+ <complexType/>
+ </element>
+
+ <element name="echoMultipleFaults1Request">
+ <complexType>
+ <sequence>
+ <element name="whichFault" type="xsd:int"/>
+ <element name="param1" type="xsd:string"/>
+ <element name="param2" type="ns2:ArrayOfFloat"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoMultipleFaults1Response">
+ <complexType/>
+ </element>
+
+ <element name="echoMultipleFaults2Request">
+ <complexType>
+ <sequence>
+ <element name="whichFault" type="xsd:int"/>
+ <element name="param1" type="xsd:string"/>
+ <element name="param2" type="xsd:float"/>
+ <element name="param3" type="ns2:ArrayOfString"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoMultipleFaults2Response">
+ <complexType/>
+ </element>
+
+ <element name="echoMultipleFaults3Request">
+ <complexType>
+ <sequence>
+ <element name="whichFault" type="xsd:int"/>
+ <element name="param1" type="xsd:string"/>
+ <element name="param2" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoMultipleFaults3Response">
+ <complexType/>
+ </element>
+
+ <element name="echoMultipleFaults4Request">
+ <complexType>
+ <sequence>
+ <element name="whichFault" type="xsd:int"/>
+ <element name="param1" type="xsd:int"/>
+ <element name="param2" type="ns2:Enum"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoMultipleFaults4Response">
+ <complexType/>
+ </element>
+
+ </schema>
+ </types>
+
+ <message name="echoEmptyFaultRequest">
+ <part name="param" element="ns4:echoEmptyFaultRequest"/>
+ </message>
+ <message name="echoEmptyFaultResponse">
+ <part name="param" element="ns4:echoEmptyFaultResponse"/>
+ </message>
+
+ <message name="echoStringFaultRequest">
+ <part name="param" element="ns4:echoStringFaultRequest"/>
+ </message>
+ <message name="echoStringFaultResponse">
+ <part name="param" element="ns4:echoStringFaultResponse"/>
+ </message>
+
+ <message name="echoIntArrayFaultRequest">
+ <part name="param" element="ns4:echoIntArrayFaultRequest"/>
+ </message>
+ <message name="echoIntArrayFaultResponse">
+ <part name="param" element="ns4:echoIntArrayFaultResponse"/>
+ </message>
+
+ <message name="echoMultipleFaults1Request">
+ <part name="param" element="ns4:echoMultipleFaults1Request"/>
+ </message>
+ <message name="echoMultipleFaults1Response">
+ <part name="param" element="ns4:echoMultipleFaults1Response"/>
+ </message>
+
+ <message name="echoMultipleFaults2Request">
+ <part name="param" element="ns4:echoMultipleFaults2Request"/>
+ </message>
+ <message name="echoMultipleFaults2Response">
+ <part name="param" element="ns4:echoMultipleFaults2Response"/>
+ </message>
+
+ <message name="echoMultipleFaults3Request">
+ <part name="param" element="ns4:echoMultipleFaults3Request"/>
+ </message>
+ <message name="echoMultipleFaults3Response">
+ <part name="param" element="ns4:echoMultipleFaults3Response"/>
+ </message>
+
+ <message name="echoMultipleFaults4Request">
+ <part name="param" element="ns4:echoMultipleFaults4Request"/>
+ </message>
+ <message name="echoMultipleFaults4Response">
+ <part name="param" element="ns4:echoMultipleFaults4Response"/>
+ </message>
+
+ <!-- Fault messages -->
+ <message name="EmptyFault">
+ <part name="part1" element="ns3:EmptyPart"/>
+ </message>
+ <message name="StringFault">
+ <part name="part2" element="ns3:StringPart"/>
+ </message>
+ <message name="IntFault">
+ <part name="part3" element="ns3:IntPart"/>
+ </message>
+ <message name="FloatFault">
+ <part name="part4" element="ns3:FloatPart"/>
+ </message>
+ <message name="StringArrayFault">
+ <part name="part5" element="ns3:ArrayOfStringPart"/>
+ </message>
+ <message name="IntArrayFault">
+ <part name="part6" element="ns3:ArrayOfIntPart"/>
+ </message>
+ <message name="FloatArrayFault">
+ <part name="part7" element="ns3:ArrayOfFloatPart"/>
+ </message>
+ <!--
+ Part name same as in Fault2 message
+ -->
+ <message name="String2Fault">
+ <part name="part2" element="ns3:String2Part"/>
+ </message>
+ <message name="EnumFault">
+ <part name="part9" element="ns3:EnumPart"/>
+ </message>
+
+ <portType name="SimpleDocLitPortType">
+ <!--
+ Throws an empty fault
+ -->
+ <operation name="echoEmptyFault" parameterOrder="">
+ <input message="tns:echoEmptyFaultRequest"/>
+ <output message="tns:echoEmptyFaultResponse"/>
+ <fault name="SimpleFault" message="tns:EmptyFault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:string parameter
+ -->
+ <operation name="echoStringFault" parameterOrder="param">
+ <input message="tns:echoStringFaultRequest"/>
+ <output message="tns:echoStringFaultResponse"/>
+ <fault name="SimpleFault" message="tns:StringFault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:int[] parameter
+ -->
+ <operation name="echoIntArrayFault" parameterOrder="param">
+ <input message="tns:echoIntArrayFaultRequest"/>
+ <output message="tns:echoIntArrayFaultResponse"/>
+ <fault name="SimpleFault" message="tns:IntArrayFault"/>
+ </operation>
+
+ <!--
+ Throws empty fault, fault with a xsd:string
+ parameter and fault with xsd:float[] parameter
+ -->
+ <operation name="echoMultipleFaults1" parameterOrder="param">
+ <input message="tns:echoMultipleFaults1Request"/>
+ <output message="tns:echoMultipleFaults1Response"/>
+ <fault name="SimpleFault1" message="tns:EmptyFault"/>
+ <fault name="SimpleFault2" message="tns:StringFault"/>
+ <fault name="SimpleFault3" message="tns:FloatArrayFault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:string parameter, fault with
+ xsd:float parameter and fault with xsd:string[]
+ parameters
+ -->
+ <operation name="echoMultipleFaults2" parameterOrder="param">
+ <input message="tns:echoMultipleFaults2Request"/>
+ <output message="tns:echoMultipleFaults2Response"/>
+ <fault name="SimpleFault1" message="tns:StringFault"/>
+ <fault name="SimpleFault2" message="tns:FloatFault"/>
+ <fault name="SimpleFault3" message="tns:StringArrayFault"/>
+ </operation>
+
+ <!--
+ Throws two faults, each with xsd:string parameters
+ and same part names
+ -->
+ <operation name="echoMultipleFaults3" parameterOrder="param">
+ <input message="tns:echoMultipleFaults3Request"/>
+ <output message="tns:echoMultipleFaults3Response"/>
+ <fault name="SimpleFault1" message="tns:StringFault"/>
+ <fault name="SimpleFault2" message="tns:String2Fault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:int parameter and fault with an
+ int enumeration parameter
+ -->
+ <operation name="echoMultipleFaults4" parameterOrder="param">
+ <input message="tns:echoMultipleFaults4Request"/>
+ <output message="tns:echoMultipleFaults4Response"/>
+ <fault name="SimpleFault1" message="tns:IntFault"/>
+ <fault name="SimpleFault2" message="tns:EnumFault"/>
+ </operation>
+ </portType>
+
+ <binding name="SimpleDocLitBinding" type="tns:SimpleDocLitPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+
+ <operation name="echoEmptyFault">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <soap:fault use="literal"/>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ <operation name="echoStringFault">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="SimpleFault">
+ <soap:fault use="literal"/>
+ </fault>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ <operation name="echoIntArrayFault">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="SimpleFault">
+ <soap:fault use="literal"/>
+ </fault>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ <operation name="echoMultipleFaults1">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault use="literal"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault use="literal"/>
+ </fault>
+ <fault name="SimpleFault3">
+ <soap:fault use="literal"/>
+ </fault>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ <operation name="echoMultipleFaults2">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault use="literal"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault use="literal"/>
+ </fault>
+ <fault name="SimpleFault3">
+ <soap:fault use="literal"/>
+ </fault>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ <operation name="echoMultipleFaults3">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault use="literal"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault use="literal"/>
+ </fault>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ <operation name="echoMultipleFaults4">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault use="literal"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault use="literal"/>
+ </fault>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ </binding>
+
+ <service name="SimpleDocLitService">
+ <port name="SimpleDocLitPort" binding="tns:SimpleDocLitBinding">
+ <soap:address
+ location="http://"/>
+ </port>
+ </service>
+</definitions>
+
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.inc
new file mode 100644
index 0000000..d39f060
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.inc
@@ -0,0 +1,56 @@
+<?php
+class SOAP_Interop_GroupH {
+
+ function echoEmptyFault() {
+ return new SoapFault("Server", "Fault in response to 'echoEmptyFault'.", null, null, "SimpleFault");
+ }
+
+ function echoStringFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoStringFault'.", null, $input, "SimpleFault");
+ }
+
+ function echoIntArrayFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoIntArrayFault'.", null, $input, "SimpleFault");
+ }
+
+ function echoMultipleFaults1($param, $string, $floats) {
+ if ($param == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $string, "SimpleFault2");
+ } else if ($param == 3) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $floats, "SimpleFault3");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, null, "SimpleFault1");
+ }
+ }
+
+ function echoMultipleFaults2($param, $string, $float, $strings) {
+ if ($param == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $string, "SimpleFault1");
+ } else if ($param == 3) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $strings, "SimpleFault3");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $float, "SimpleFault2");
+ }
+ }
+
+ function echoMultipleFaults3($param, $param1, $param2) {
+ if ($param == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults3'.", null, $param2, "SimpleFault2");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults3'.", null, $param1, "SimpleFault1");
+ }
+ }
+
+ function echoMultipleFaults4($param, $int, $enum) {
+ if ($param == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults4'.", null, $enum, "SimpleFault2");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults4'.", null, $int, "SimpleFault1");
+ }
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl");
+$server->setClass("SOAP_Interop_GroupH");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl
new file mode 100644
index 0000000..24f73fc
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl
@@ -0,0 +1,408 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://soapinterop.org/wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns2="http://soapinterop.org/types"
+ targetNamespace="http://soapinterop.org/wsdl">
+ <types>
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://soapinterop.org/types">
+
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+
+ <complexType name="EmptyFault"/>
+
+ <complexType name="ArrayOfString">
+ <complexContent>
+ <restriction base="soap-enc:Array">
+ <attribute ref="soap-enc:arrayType" wsdl:arrayType="string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ArrayOfInt">
+ <complexContent>
+ <restriction base="soap-enc:Array">
+ <attribute ref="soap-enc:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ArrayOfFloat">
+ <complexContent>
+ <restriction base="soap-enc:Array">
+ <attribute ref="soap-enc:arrayType" wsdl:arrayType="float[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <simpleType name="Enum">
+ <restriction base="int">
+ <enumeration value="1"/>
+ <enumeration value="2"/>
+ </restriction>
+ </simpleType>
+ </schema>
+ </types>
+
+ <message name="echoFaultRequest"/>
+ <message name="echoFaultResponse"/>
+ <message name="echoStringFaultRequest">
+ <part name="param" type="xsd:string"/>
+ </message>
+ <message name="echoIntArrayFaultRequest">
+ <part name="param" type="ns2:ArrayOfInt"/>
+ </message>
+ <message name="echoMultipleFaults1Request">
+ <part name="whichFault" type="xsd:int"/>
+ <part name="param1" type="xsd:string"/>
+ <part name="param2" type="ns2:ArrayOfFloat"/>
+ </message>
+ <message name="echoMultipleFaults2Request">
+ <part name="whichFault" type="xsd:int"/>
+ <part name="param1" type="xsd:string"/>
+ <part name="param2" type="xsd:float"/>
+ <part name="param3" type="ns2:ArrayOfString"/>
+ </message>
+ <message name="echoMultipleFaults3Request">
+ <part name="whichFault" type="xsd:int"/>
+ <part name="param1" type="xsd:string"/>
+ <part name="param2" type="xsd:string"/>
+ </message>
+ <message name="echoMultipleFaults4Request">
+ <part name="whichFault" type="xsd:int"/>
+ <part name="param1" type="xsd:int"/>
+ <part name="param2" type="ns2:Enum"/>
+ </message>
+
+ <!-- Fault messages -->
+ <message name="EmptyFault">
+ <part name="part1" type="ns2:EmptyFault"/>
+ </message>
+ <message name="StringFault">
+ <part name="part2" type="xsd:string"/>
+ </message>
+ <message name="IntFault">
+ <part name="part3" type="xsd:int"/>
+ </message>
+ <message name="FloatFault">
+ <part name="part4" type="xsd:float"/>
+ </message>
+ <message name="IntArrayFault">
+ <part name="part5" type="ns2:ArrayOfInt"/>
+ </message>
+ <message name="StringArrayFault">
+ <part name="part6" type="ns2:ArrayOfString"/>
+ </message>
+ <message name="FloatArrayFault">
+ <part name="part7" type="ns2:ArrayOfFloat"/>
+ </message>
+ <!--
+ Part name same as in StringFault message
+ -->
+ <message name="String2Fault">
+ <part name="part2" type="xsd:string"/>
+ </message>
+ <message name="EnumFault">
+ <part name="part9" type="ns2:Enum"/>
+ </message>
+
+ <portType name="SimpleRpcEncPortType">
+ <!--
+ Throws an empty fault
+ -->
+ <operation name="echoEmptyFault" parameterOrder="">
+ <input message="tns:echoFaultRequest"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault" message="tns:EmptyFault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:string parameter
+ -->
+ <operation name="echoStringFault" parameterOrder="param">
+ <input message="tns:echoStringFaultRequest"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault" message="tns:StringFault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:int[] parameter
+ -->
+ <operation name="echoIntArrayFault" parameterOrder="param">
+ <input message="tns:echoIntArrayFaultRequest"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault" message="tns:IntArrayFault"/>
+ </operation>
+
+ <!--
+ Throws empty fault, fault with a xsd:string
+ parameter and fault with xsd:float[] parameter
+ -->
+ <operation name="echoMultipleFaults1" parameterOrder="whichFault param1 param2">
+ <input message="tns:echoMultipleFaults1Request"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault1" message="tns:EmptyFault"/>
+ <fault name="SimpleFault2" message="tns:StringFault"/>
+ <fault name="SimpleFault3" message="tns:FloatArrayFault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:string parameter, fault with
+ xsd:float parameter and fault with xsd:string[]
+ parameters
+ -->
+ <operation name="echoMultipleFaults2" parameterOrder="whichFault param1 param2 param3">
+ <input message="tns:echoMultipleFaults2Request"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault1" message="tns:StringFault"/>
+ <fault name="SimpleFault2" message="tns:FloatFault"/>
+ <fault name="SimpleFault3" message="tns:StringArrayFault"/>
+ </operation>
+
+ <!--
+ Throws two faults, each with xsd:string parameters
+ and same part names. Each part name is bound to a different
+ namespace.
+ -->
+ <operation name="echoMultipleFaults3" parameterOrder="whichFault param1 param2">
+ <input message="tns:echoMultipleFaults3Request"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault1" message="tns:StringFault"/>
+ <fault name="SimpleFault2" message="tns:String2Fault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:int parameter and fault with an
+ int enumeration parameter
+ -->
+ <operation name="echoMultipleFaults4" parameterOrder="whichFault param1 param2">
+ <input message="tns:echoMultipleFaults4Request"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault1" message="tns:IntFault"/>
+ <fault name="SimpleFault2" message="tns:EnumFault"/>
+ </operation>
+ </portType>
+
+ <binding name="SimpleRpcEncBinding" type="tns:SimpleRpcEncPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+
+ <operation name="echoEmptyFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault">
+ <soap:fault
+ name="SimpleFault"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoStringFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault">
+ <soap:fault
+ name="SimpleFault"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoIntArrayFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault">
+ <soap:fault
+ name="SimpleFault"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults1">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault
+ name="SimpleFault1"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault
+ name="SimpleFault2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="SimpleFault3">
+ <soap:fault
+ name="SimpleFault3"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults2">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault
+ name="SimpleFault1"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault
+ name="SimpleFault2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="SimpleFault3">
+ <soap:fault
+ name="SimpleFault3"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults3">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault
+ name="SimpleFault1"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl/fault1"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault
+ name="SimpleFault2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl/fault2"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults4">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault
+ name="SimpleFault1"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault
+ name="SimpleFault2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ </binding>
+
+ <service name="SimpleRpcEncService">
+ <port name="SimpleRpcEncPort" binding="tns:SimpleRpcEncBinding">
+ <soap:address location="test://"/>
+ </port>
+ </service>
+</definitions>
+
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.inc
new file mode 100644
index 0000000..a92484e
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.inc
@@ -0,0 +1,22 @@
+<?php
+class SOAP_Interop_GroupH {
+
+ function echoVersionMismatchFault()
+ {
+ }
+
+ function echoMustUnderstandFault()
+ {
+ }
+
+ function HeaderRequest($string)
+ {
+ }
+
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupH_soapfault.wsdl");
+$server->setClass("SOAP_Interop_GroupH");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.wsdl
new file mode 100644
index 0000000..4f49b8f
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.wsdl
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://soapinterop.org/wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns2="http://soapinterop.org/types"
+ targetNamespace="http://soapinterop.org/wsdl">
+
+ <message name="echoVoidRequest"/>
+ <message name="echoVoidResponse"/>
+ <message name="HeaderRequest">
+ <part name="param" type="xsd:string"/>
+ </message>
+
+ <portType name="SOAPFaultPortType">
+ <operation name="echoVersionMismatchFault" parameterOrder="">
+ <input message="tns:echoVoidRequest"/>
+ <output message="tns:echoVoidResponse"/>
+ </operation>
+
+ <operation name="echoMustUnderstandFault" parameterOrder="">
+ <input message="tns:echoVoidRequest"/>
+ <output message="tns:echoVoidResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="SOAPFaultBinding" type="tns:SOAPFaultPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+ <!--
+ If the server receives an envelope with an incorrect
+ namespace, then a fault with VersionMismatch fault code
+ is populated in the SOAP response
+ -->
+ <operation name="echoVersionMismatchFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMustUnderstandFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ <soap:header
+ message="tns:HeaderRequest"
+ part="param"
+ use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ </binding>
+
+ <service name="SOAPFaultService">
+ <port name="SOAPFaultPort" binding="tns:SOAPFaultBinding">
+ <soap:address location="test://"/>
+ </port>
+ </service>
+</definitions>
+
+
diff --git a/ext/soap/tests/interop/Round4/GroupH/skipif.inc b/ext/soap/tests/interop/Round4/GroupH/skipif.inc
new file mode 100644
index 0000000..fa8574e
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_001w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_001w.phpt
new file mode 100644
index 0000000..98ed58d
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_001w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 001 (php/wsdl): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoVoid();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_002w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_002w.phpt
new file mode 100644
index 0000000..67929f8
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_002w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 002 (php/wsdl): echoInteger
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoInteger(array("inputInteger"=>22));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoInteger><ns1:inputInteger>22</ns1:inputInteger></ns1:echoInteger></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoIntegerResponse><ns1:return>22</ns1:return></ns1:echoIntegerResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_003w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_003w.phpt
new file mode 100644
index 0000000..8ee9418
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_003w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 003 (php/wsdl): echoFloat
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoFloat(array("inputFloat"=>12.345));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoFloat><ns1:inputFloat>12.345</ns1:inputFloat></ns1:echoFloat></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoFloatResponse><ns1:return>12.345</ns1:return></ns1:echoFloatResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_004w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_004w.phpt
new file mode 100644
index 0000000..25b056d
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_004w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 004 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString(array("inputString"=>"Hello World"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoString><ns1:inputString>Hello World</ns1:inputString></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoStringResponse><ns1:return>Hello World</ns1:return></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_005w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_005w.phpt
new file mode 100644
index 0000000..8d552dc
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_005w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 005 (php/wsdl): echoString(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString(array());
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoString/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoStringResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_006w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_006w.phpt
new file mode 100644
index 0000000..2cc37b5
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_006w.phpt
Binary files differ
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_007w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_007w.phpt
new file mode 100644
index 0000000..6f1edbe
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_007w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 007 (php/wsdl): echoDate
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoDate(array("inputDate"=>"2002-12-22T21:41:17Z"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoDate><ns1:inputDate>2002-12-22T21:41:17Z</ns1:inputDate></ns1:echoDate></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoDateResponse><ns1:return>2002-12-22T21:41:17Z</ns1:return></ns1:echoDateResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt
new file mode 100644
index 0000000..d9dbed4
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 008 (php/wsdl): echoComplexType
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoComplexType(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexType><ns2:inputComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:inputComplexType></ns2:echoComplexType></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeResponse><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return></ns2:echoComplexTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt
new file mode 100644
index 0000000..41bf371
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 009 (php/wsdl): echoComplexType(minOccur=0)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+unset($struct->varString);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoComplexType(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexType><ns2:inputComplexType><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns2:inputComplexType></ns2:echoComplexType></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeResponse><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns2:return></ns2:echoComplexTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_010w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_010w.phpt
new file mode 100644
index 0000000..0621716
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_010w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 010 (php/wsdl): echoIntegerMultiOccurs
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoIntegerMultiOccurs(array("inputIntegerMultiOccurs"=>array(22,29,36)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoIntegerMultiOccurs><ns1:inputIntegerMultiOccurs><ns1:int>22</ns1:int><ns1:int>29</ns1:int><ns1:int>36</ns1:int></ns1:inputIntegerMultiOccurs></ns1:echoIntegerMultiOccurs></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoIntegerMultiOccursResponse><ns1:return>22</ns1:return><ns1:return>29</ns1:return><ns1:return>36</ns1:return></ns1:echoIntegerMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_011w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_011w.phpt
new file mode 100644
index 0000000..9e064e8
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_011w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 011 (php/wsdl): echoFloatMultiOccurs
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoFloatMultiOccurs(array("inputFloatMultiOccurs"=>array(22.5,12.345)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoFloatMultiOccurs><ns1:inputFloatMultiOccurs><ns1:float>22.5</ns1:float><ns1:float>12.345</ns1:float></ns1:inputFloatMultiOccurs></ns1:echoFloatMultiOccurs></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoFloatMultiOccursResponse><ns1:return>22.5</ns1:return><ns1:return>12.345</ns1:return></ns1:echoFloatMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_012w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_012w.phpt
new file mode 100644
index 0000000..ecf1d53
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_012w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 012 (php/wsdl): echoStringMultiOccurs
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringMultiOccurs(array("inputStringMultiOccurs"=>array("arg1","arg2","arg3")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoStringMultiOccurs><ns1:inputStringMultiOccurs><ns1:string>arg1</ns1:string><ns1:string>arg2</ns1:string><ns1:string>arg3</ns1:string></ns1:inputStringMultiOccurs></ns1:echoStringMultiOccurs></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoStringMultiOccursResponse><ns1:return>arg1</ns1:return><ns1:return>arg2</ns1:return><ns1:return>arg3</ns1:return></ns1:echoStringMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_013w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_013w.phpt
new file mode 100644
index 0000000..c237ae2
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_013w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 013 (php/wsdl): echoStringMultiOccurs(nil)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringMultiOccurs(array("inputStringMultiOccurs"=>array("arg1",NULL,"arg3")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns1:echoStringMultiOccurs><ns1:inputStringMultiOccurs><ns1:string>arg1</ns1:string><ns1:string xsi:nil="true"/><ns1:string>arg3</ns1:string></ns1:inputStringMultiOccurs></ns1:echoStringMultiOccurs></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoStringMultiOccursResponse><ns1:return>arg1</ns1:return><ns1:return/><ns1:return>arg3</ns1:return></ns1:echoStringMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt
new file mode 100644
index 0000000..f3150b5
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 014 (php/wsdl): echoComplexTypeMultiOccurs(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct1 = new SOAPComplexType('arg',34,325.325);
+$struct2 = new SOAPComplexType('arg',34,325.325);
+$struct3 = new SOAPComplexType('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoComplexTypeMultiOccurs(array("inputComplexTypeMultiOccurs"=>array($struct1,$struct2,$struct3)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeMultiOccurs><ns2:inputComplexTypeMultiOccurs><ns2:SOAPComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:SOAPComplexType><ns2:SOAPComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:SOAPComplexType><ns2:SOAPComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:SOAPComplexType></ns2:inputComplexTypeMultiOccurs></ns2:echoComplexTypeMultiOccurs></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeMultiOccursResponse><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return></ns2:echoComplexTypeMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt
new file mode 100644
index 0000000..6f07000
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 015 (php/wsdl): echoComplexTypeMultiOccurs(nil)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct1 = new SOAPComplexType('arg',34,325.325);
+$struct2 = new SOAPComplexType('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoComplexTypeMultiOccurs(array("inputComplexTypeMultiOccurs"=>array($struct1,null,$struct2)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns2:echoComplexTypeMultiOccurs><ns2:inputComplexTypeMultiOccurs><ns2:SOAPComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:SOAPComplexType><ns2:SOAPComplexType xsi:nil="true"/><ns2:SOAPComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:SOAPComplexType></ns2:inputComplexTypeMultiOccurs></ns2:echoComplexTypeMultiOccurs></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeMultiOccursResponse><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return><ns2:return/><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return></ns2:echoComplexTypeMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_016w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_016w.phpt
new file mode 100644
index 0000000..55366c7
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_016w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 016 (php/wsdl): echoDecimal
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoDecimal(array("inputDecimal"=>"123456789.123456789"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoDecimal><ns1:inputDecimal>123456789.123456789</ns1:inputDecimal></ns1:echoDecimal></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoDecimalResponse><ns1:return>123456789.123456789</ns1:return></ns1:echoDecimalResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_017w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_017w.phpt
new file mode 100644
index 0000000..20e3051
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_017w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 017 (php/wsdl): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBoolean(array("inputBoolean"=>true));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoBoolean><ns1:inputBoolean>true</ns1:inputBoolean></ns1:echoBoolean></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoBooleanResponse><ns1:return>true</ns1:return></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_018w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_018w.phpt
new file mode 100644
index 0000000..1b60add
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_018w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 018 (php/wsdl): echoHexBinary
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoHexBinary(array("inputHexBinary"=>"\x80\xFF\x00\x01\x7F"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoHexBinary><ns1:inputHexBinary>80FF00017F</ns1:inputHexBinary></ns1:echoHexBinary></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoHexBinaryResponse><ns1:return>80FF00017F</ns1:return></ns1:echoHexBinaryResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt
new file mode 100644
index 0000000..ea9bb0f
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 019 (php/wsdl): echoComplexTypeAsSimpleTypes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoComplexTypeAsSimpleTypes(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeAsSimpleTypes><ns2:inputComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:inputComplexType></ns2:echoComplexTypeAsSimpleTypes></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoComplexTypeAsSimpleTypesResponse><ns1:outputString>arg</ns1:outputString><ns1:outputInteger>34</ns1:outputInteger><ns1:outputFloat>325.325</ns1:outputFloat></ns1:echoComplexTypeAsSimpleTypesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt
new file mode 100644
index 0000000..1b6382c
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 020 (php/wsdl): echoComplexTypeAsSimpleTypes(minOccurs=0)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+unset($struct->varString);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoComplexTypeAsSimpleTypes(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeAsSimpleTypes><ns2:inputComplexType><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns2:inputComplexType></ns2:echoComplexTypeAsSimpleTypes></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoComplexTypeAsSimpleTypesResponse><ns1:outputInteger>34</ns1:outputInteger><ns1:outputFloat>325.325</ns1:outputFloat></ns1:echoComplexTypeAsSimpleTypesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_021w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_021w.phpt
new file mode 100644
index 0000000..ad1e60a
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_021w.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 021 (php/wsdl): echoSimpleTypesAsComplexType
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoSimpleTypesAsComplexType(array("inputInteger"=>34,
+ "inputFloat"=>12.345,
+ "inputString"=>"arg"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsComplexType><ns1:inputString>arg</ns1:inputString><ns1:inputInteger>34</ns1:inputInteger><ns1:inputFloat>12.345</ns1:inputFloat></ns1:echoSimpleTypesAsComplexType></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoSimpleTypesAsComplexTypeResponse><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>12.345</ns1:varFloat></ns2:return></ns2:echoSimpleTypesAsComplexTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_022w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_022w.phpt
new file mode 100644
index 0000000..e9ad5d7
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_022w.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 022 (php/wsdl): echoSimpleTypesAsComplexType(minOccurs=0)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoSimpleTypesAsComplexType(array("inputInteger"=>34,
+ "inputFloat"=>12.345));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsComplexType><ns1:inputInteger>34</ns1:inputInteger><ns1:inputFloat>12.345</ns1:inputFloat></ns1:echoSimpleTypesAsComplexType></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoSimpleTypesAsComplexTypeResponse><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns2:return></ns2:echoSimpleTypesAsComplexTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt
new file mode 100644
index 0000000..d312dbf
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt
@@ -0,0 +1,38 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 023 (php/wsdl): echoNestedComplexType
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class SOAPComplexTypeComplexType {
+ function SOAPComplexTypeComplexType($s, $i, $f, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ $this->varComplexType = $c;
+ }
+}
+$struct = new SOAPComplexTypeComplexType("arg",34,12.345,new SOAPComplexType("arg",43,54.321));
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoNestedComplexType(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoNestedComplexType><ns2:inputComplexType><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat><ns1:varComplexType><ns1:varInt>43</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>54.321</ns1:varFloat></ns1:varComplexType></ns2:inputComplexType></ns2:echoNestedComplexType></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoNestedComplexTypeResponse><ns2:return><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat><ns1:varComplexType><ns1:varInt>43</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>54.321</ns1:varFloat></ns1:varComplexType></ns2:return></ns2:echoNestedComplexTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt
new file mode 100644
index 0000000..dc4cdce
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 024 (php/wsdl): echoNestedComplexType(minOccurs=0)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPComplexTypeComplexType {
+ function SOAPComplexTypeComplexType($s, $i, $f, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ $this->varComplexType = $c;
+ }
+}
+$struct = new SOAPComplexTypeComplexType("arg",34,12.345,NULL);
+unset($struct->varComplexType);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoNestedComplexType(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoNestedComplexType><ns2:inputComplexType><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns2:inputComplexType></ns2:echoNestedComplexType></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoNestedComplexTypeResponse><ns2:return><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns2:return></ns2:echoNestedComplexTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt
new file mode 100644
index 0000000..9ff6831
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 025 (php/wsdl): echoNestedMultiOccurs
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPMultiOccursComplexType {
+ function SOAPMultiOccursComplexType($s, $i, $f, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ $this->varMultiOccurs = $c;
+ }
+}
+$struct = new SOAPMultiOccursComplexType("arg",34,12.345,array("red","green","blue"));
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoNestedMultiOccurs(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoNestedMultiOccurs><ns2:inputComplexType><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat><ns1:varMultiOccurs><ns1:string>red</ns1:string><ns1:string>green</ns1:string><ns1:string>blue</ns1:string></ns1:varMultiOccurs></ns2:inputComplexType></ns2:echoNestedMultiOccurs></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoNestedMultiOccursResponse><ns2:return><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat><ns1:varMultiOccurs><ns1:string>red</ns1:string><ns1:string>green</ns1:string><ns1:string>blue</ns1:string></ns1:varMultiOccurs></ns2:return></ns2:echoNestedMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_026w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_026w.phpt
new file mode 100644
index 0000000..3cec539
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_026w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 026 (php/wsdl): echoChoice
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoChoice(array("inputChoice"=>(object)array("name1"=>"Hello World")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoChoice><ns2:inputChoice><ns1:name1>Hello World</ns1:name1></ns2:inputChoice></ns2:echoChoice></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoChoiceResponse><ns2:return><ns1:name1>Hello World</ns1:name1></ns2:return></ns2:echoChoiceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_027w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_027w.phpt
new file mode 100644
index 0000000..c53b7aa
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_027w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 027 (php/wsdl): echoEnum
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoEnum(array("inputEnum"=>"bitTwo"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoEnum><ns1:inputEnum>bitTwo</ns1:inputEnum></ns1:echoEnum></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoEnumResponse><ns1:return>bitTwo</ns1:return></ns1:echoEnumResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt
new file mode 100644
index 0000000..5751a46
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 028 (php/wsdl): echoAnyType
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoAnyType(array('inputAnyType'=>new SoapVar($struct,SOAP_ENC_OBJECT,"SOAPComplexType","http://soapinterop.org/xsd")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoAnyType><ns2:inputAnyType xsi:type="ns1:SOAPComplexType"><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:inputAnyType></ns2:echoAnyType></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoAnyTypeResponse><ns2:return xsi:type="ns1:SOAPComplexType"><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return></ns2:echoAnyTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_029w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_029w.phpt
new file mode 100644
index 0000000..ddbe23a
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_029w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 029 (php/wsdl): echoAnyElement
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoAnyElement(array("inputAny"=>array("any"=>"<bold>Hello World</bold>")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoAnyElement><ns1:inputAny><bold>Hello World</bold></ns1:inputAny></ns1:echoAnyElement></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoAnyElementResponse><ns1:return><bold>Hello World</bold></ns1:return></ns1:echoAnyElementResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_030w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_030w.phpt
new file mode 100644
index 0000000..48c8c44
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_030w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 030 (php/wsdl): echoVoidSoapHeader(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/","echoMeStringRequest", array("varString"=>"Hello World"), 1);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org" xmlns:ns2="http://soapinterop.org/echoheader/" xmlns:ns3="http://soapinterop.org/"><SOAP-ENV:Header><ns3:echoMeStringRequest SOAP-ENV:mustUnderstand="1"><ns2:varString>Hello World</ns2:varString></ns3:echoMeStringRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeader/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/echoheader/" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Header><ns2:echoMeStringResponse><ns1:varString>Hello World</ns1:varString></ns2:echoMeStringResponse></SOAP-ENV:Header><SOAP-ENV:Body><ns2:echoVoidSoapHeaderResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_031w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_031w.phpt
new file mode 100644
index 0000000..c108fb6
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_031w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 031 (php/wsdl): echoVoidSoapHeader(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/","echoMeStringRequest", array(), 1);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Header><ns2:echoMeStringRequest SOAP-ENV:mustUnderstand="1"/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeader/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Header><ns1:echoMeStringResponse/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeaderResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_032w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_032w.phpt
new file mode 100644
index 0000000..03b0385
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_032w.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 032 (php/wsdl): echoVoidSoapHeader(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/","echoMeComplexTypeRequest", array("varInt"=>34,"varString"=>"arg","varFloat"=>12.345), 1);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org" xmlns:ns2="http://soapinterop.org/echoheader/" xmlns:ns3="http://soapinterop.org/"><SOAP-ENV:Header><ns3:echoMeComplexTypeRequest SOAP-ENV:mustUnderstand="1"><ns2:varString>arg</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>12.345</ns2:varFloat></ns3:echoMeComplexTypeRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeader/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/echoheader/" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Header><ns2:echoMeComplexTypeResponse><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns2:echoMeComplexTypeResponse></SOAP-ENV:Header><SOAP-ENV:Body><ns2:echoVoidSoapHeaderResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_033w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_033w.phpt
new file mode 100644
index 0000000..e28f180
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_033w.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 033 (php/wsdl): echoVoidSoapHeader(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/","echoMeComplexTypeRequest", array("varInt"=>34,"varFloat"=>12.345), 1);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org" xmlns:ns2="http://soapinterop.org/echoheader/" xmlns:ns3="http://soapinterop.org/"><SOAP-ENV:Header><ns3:echoMeComplexTypeRequest SOAP-ENV:mustUnderstand="1"><ns2:varInt>34</ns2:varInt><ns2:varFloat>12.345</ns2:varFloat></ns3:echoMeComplexTypeRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeader/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/echoheader/" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Header><ns2:echoMeComplexTypeResponse><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns2:echoMeComplexTypeResponse></SOAP-ENV:Header><SOAP-ENV:Body><ns2:echoVoidSoapHeaderResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_034w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_034w.phpt
new file mode 100644
index 0000000..3639400
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_034w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 034 (php/wsdl): echoVoidSoapHeader(5)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/","echoMeStringRequest", array("varString"=>"Hello World"), 1, SOAP_ACTOR_NEXT);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org" xmlns:ns2="http://soapinterop.org/echoheader/" xmlns:ns3="http://soapinterop.org/"><SOAP-ENV:Header><ns3:echoMeStringRequest SOAP-ENV:mustUnderstand="1" SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next"><ns2:varString>Hello World</ns2:varString></ns3:echoMeStringRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeader/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/echoheader/" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Header><ns2:echoMeStringResponse><ns1:varString>Hello World</ns1:varString></ns2:echoMeStringResponse></SOAP-ENV:Header><SOAP-ENV:Body><ns2:echoVoidSoapHeaderResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_035w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_035w.phpt
new file mode 100644
index 0000000..2b894a7
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_035w.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 035 (php/wsdl): echoVoidSoapHeader(6)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/","echoMeComplexTypeRequest", array("varInt"=>34,"varString"=>"arg","varFloat"=>12.345), 1, SOAP_ACTOR_NEXT);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org" xmlns:ns2="http://soapinterop.org/echoheader/" xmlns:ns3="http://soapinterop.org/"><SOAP-ENV:Header><ns3:echoMeComplexTypeRequest SOAP-ENV:mustUnderstand="1" SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next"><ns2:varString>arg</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>12.345</ns2:varFloat></ns3:echoMeComplexTypeRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeader/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/echoheader/" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Header><ns2:echoMeComplexTypeResponse><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns2:echoMeComplexTypeResponse></SOAP-ENV:Header><SOAP-ENV:Body><ns2:echoVoidSoapHeaderResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.inc b/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.inc
new file mode 100644
index 0000000..74ca577
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.inc
@@ -0,0 +1,198 @@
+<?php
+class SOAP_Interop_GroupI {
+
+ function echoString($inputString)
+ {
+ if (isset($inputString->inputString)) {
+ return array("return"=>$inputString->inputString);
+ } else {
+ return $inputString;
+ }
+ }
+
+ function echoInteger($inputInteger)
+ {
+ return array("return"=>$inputInteger->inputInteger);
+ }
+
+ function echoFloat($inputFloat)
+ {
+ return array("return"=>$inputFloat->inputFloat);
+ }
+
+ function echoVoid()
+ {
+ }
+
+ function echoBase64($inputBase64)
+ {
+ if (isset($inputBase64->inputBase64)) {
+ return array("return"=>$inputBase64->inputBase64);
+ } else {
+ return $inputBase64;
+ }
+ }
+
+ function echoDate($timeInstant)
+ {
+ return array("return"=>$timeInstant->inputDate);
+ }
+
+ function echoComplexType($inputComplexType)
+ {
+ if (isset($inputComplexType->inputComplexType)) {
+ return array("return"=>$inputComplexType->inputComplexType);
+ } else {
+ return $inputComplexType;
+ }
+ }
+
+ function echoIntegerMultiOccurs($input)
+ {
+ if (isset($input->inputIntegerMultiOccurs->int)) {
+ return array("return"=>$input->inputIntegerMultiOccurs->int);
+ } else {
+ return array();
+ }
+ }
+
+ function echoFloatMultiOccurs($input)
+ {
+ if (isset($input->inputFloatMultiOccurs->float)) {
+ return array("return"=>$input->inputFloatMultiOccurs->float);
+ } else {
+ return array();
+ }
+ }
+
+ function echoStringMultiOccurs($input)
+ {
+ if (isset($input->inputStringMultiOccurs->string)) {
+ return array("return"=>$input->inputStringMultiOccurs->string);
+ } else {
+ return array();
+ }
+ }
+
+ function echoComplexTypeMultiOccurs($input)
+ {
+ if (isset($input->inputComplexTypeMultiOccurs->SOAPComplexType)) {
+ return array("return"=>$input->inputComplexTypeMultiOccurs->SOAPComplexType);
+ } else {
+ return array();
+ }
+ }
+
+ function echoHexBinary($hb)
+ {
+ if (isset($hb->inputHexBinary)) {
+ return array("return"=>$hb->inputHexBinary);
+ } else {
+ return $hb;
+ }
+ }
+
+ function echoDecimal($dec)
+ {
+ return array("return"=>$dec->inputDecimal);
+ }
+
+ function echoBoolean($boolean)
+ {
+ return array("return"=>$boolean->inputBoolean);
+ }
+
+ function echoComplexTypeAsSimpleTypes($input)
+ {
+ if (isset($input->inputComplexType)) {
+ $ret = array("outputInteger" => $input->inputComplexType->varInt,
+ "outputFloat" => $input->inputComplexType->varFloat);
+ if (isset($input->inputComplexType->varString)) {
+ $ret["outputString"] = $input->inputComplexType->varString;
+ }
+ return $ret;
+ } else {
+ return array();
+ }
+ }
+
+ function echoSimpleTypesAsComplexType($input)
+ {
+ $ret = array("varInt" => $input->inputInteger,
+ "varFloat" => $input->inputFloat);
+ if (isset($input->inputString)) {
+ $ret["varString"] = $input->inputString;
+ }
+ return array("return"=>$ret);
+ }
+
+ function echoNestedComplexType($inputComplexType)
+ {
+ if (isset($inputComplexType->inputComplexType)) {
+ return array("return"=>$inputComplexType->inputComplexType);
+ } else {
+ return $inputComplexType;
+ }
+ }
+
+ function echoNestedMultiOccurs($inputComplexType)
+ {
+ if (isset($inputComplexType->inputComplexType)) {
+ return array("return"=>$inputComplexType->inputComplexType);
+ } else {
+ return $inputComplexType;
+ }
+ }
+
+ function echoChoice($input)
+ {
+ if (isset($input->inputChoice)) {
+ return array("return"=>$input->inputChoice);
+ } else {
+ return $input;
+ }
+ }
+
+ function echoEnum($input)
+ {
+ return array("return"=>$input->inputEnum);
+ }
+
+ function echoAnyType($input)
+ {
+ if (isset($input->inputAnyType)) {
+ return array("return"=>$input->inputAnyType);
+ } else {
+ return $input;
+ }
+ }
+
+ function echoAnyElement($input)
+ {
+ if (isset($input->inputAny)) {
+ return array("return"=>$input->inputAny);
+ } else {
+ return $input;
+ }
+ }
+
+ function echoVoidSoapHeader()
+ {
+ }
+
+ function echoMeStringRequest($input)
+ {
+ return new SoapHeader("http://soapinterop.org/","echoMeStringResponse",$input);
+ }
+
+ function echoMeComplexTypeRequest($input)
+ {
+ return new SoapHeader("http://soapinterop.org/","echoMeComplexTypeResponse",$input);
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupI_xsd.wsdl");
+$server->setClass("SOAP_Interop_GroupI");
+$server->handle($HTTP_RAW_POST_DATA);
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.wsdl b/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.wsdl
new file mode 100644
index 0000000..b620846
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.wsdl
@@ -0,0 +1,1113 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions xmlns:s1="http://soapinterop.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://soapinterop.org/" xmlns:s3="http://soapinterop.org/echoheader/" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://soapinterop.org" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/">
+ <s:import namespace="http://soapinterop.org/xsd" />
+ <s:import namespace="http://soapinterop.org/echoheader/" />
+ <s:element name="echoVoid">
+ <s:complexType />
+ </s:element>
+ <s:element name="echoVoidResponse">
+ <s:complexType />
+ </s:element>
+ <s:element name="echoInteger">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="inputInteger" type="s:int" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoIntegerResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="return" type="s:int" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoFloat">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="inputFloat" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoFloatResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="return" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoString">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputString" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoStringResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoBase64">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputBase64" type="s:base64Binary" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoBase64Response">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s:base64Binary" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoDate">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="inputDate" type="s:dateTime" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoDateResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="return" type="s:dateTime" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoComplexType">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputComplexType" type="s1:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoComplexTypeResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoIntegerMultiOccurs">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputIntegerMultiOccurs" type="s0:ArrayOfInt" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="ArrayOfInt">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="int" type="s:int" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="echoIntegerMultiOccursResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="return" type="s:int" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoFloatMultiOccurs">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputFloatMultiOccurs" type="s0:ArrayOfFloat" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="ArrayOfFloat">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="float" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="echoFloatMultiOccursResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="return" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoStringMultiOccurs">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputStringMultiOccurs" type="s0:ArrayOfString" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="ArrayOfString">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="echoStringMultiOccursResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="return" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoComplexTypeMultiOccurs">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputComplexTypeMultiOccurs" type="s1:ArrayOfSOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="SOAPComplexType" nillable="true" type="s1:SOAPComplexType" />
+ <s:element name="echoComplexTypeMultiOccursResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="return" type="s1:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoDecimal">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="inputDecimal" type="s:decimal" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoDecimalResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="return" type="s:decimal" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoBoolean">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="inputBoolean" type="s:boolean" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoBooleanResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="return" type="s:boolean" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoHexBinary">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputHexBinary" type="s:hexBinary" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoHexBinaryResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s:hexBinary" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoComplexTypeAsSimpleTypes">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputComplexType" type="s1:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoComplexTypeAsSimpleTypesResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="outputString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="outputInteger" type="s:int" />
+ <s:element minOccurs="1" maxOccurs="1" name="outputFloat" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoSimpleTypesAsComplexType">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="inputInteger" type="s:int" />
+ <s:element minOccurs="1" maxOccurs="1" name="inputFloat" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoSimpleTypesAsComplexTypeResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoNestedComplexType">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputComplexType" type="s1:SOAPComplexTypeComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoNestedComplexTypeResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:SOAPComplexTypeComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoNestedMultiOccurs">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputComplexType" type="s1:SOAPMultiOccursComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoNestedMultiOccursResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:SOAPMultiOccursComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoChoice">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputChoice" type="s1:ChoiceComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoChoiceResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:ChoiceComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoEnum">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="inputEnum" type="s1:Enum" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoEnumResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="return" type="s1:Enum" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoAnyType">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputAnyType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoAnyTypeResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoAnyElement">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputAny">
+ <s:complexType>
+ <s:sequence>
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoAnyElementResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return">
+ <s:complexType>
+ <s:sequence>
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoVoidSoapHeaderResponse">
+ <s:complexType />
+ </s:element>
+ <s:element name="echoMeComplexTypeRequest" type="s3:echoMeComplexTypeRequest" />
+ <s:element name="echoMeStringRequest" type="s3:echoMeStringRequest" />
+ <s:element name="echoMeComplexTypeResponse" type="s3:echoMeComplexTypeResponse" />
+ <s:element name="echoMeStringResponse" type="s3:echoMeStringResponse" />
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd">
+ <s:import namespace="http://soapinterop.org/" />
+ <s:complexType name="SOAPComplexType">
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="varInt" type="s:int" />
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="varFloat" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="ArrayOfSOAPComplexType">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" ref="s0:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="SOAPComplexTypeComplexType">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="varInt" type="s:int" />
+ <s:element minOccurs="1" maxOccurs="1" name="varFloat" type="s:float" />
+ <s:element minOccurs="0" maxOccurs="1" name="varComplexType" type="s1:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="SOAPMultiOccursComplexType">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="varInt" type="s:int" />
+ <s:element minOccurs="1" maxOccurs="1" name="varFloat" type="s:float" />
+ <s:element minOccurs="0" maxOccurs="1" name="varMultiOccurs" type="s1:ArrayOfString" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="ArrayOfString">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="ChoiceComplexType">
+ <s:sequence>
+ <s:choice minOccurs="1" maxOccurs="1">
+ <s:element minOccurs="0" maxOccurs="1" name="name0" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="name1" type="s:string" />
+ </s:choice>
+ </s:sequence>
+ </s:complexType>
+ <s:simpleType name="Enum">
+ <s:restriction base="s:string">
+ <s:enumeration value="BitOne" />
+ <s:enumeration value="BitTwo" />
+ <s:enumeration value="BitThree" />
+ <s:enumeration value="BitFour" />
+ <s:enumeration value="BitFive" />
+ </s:restriction>
+ </s:simpleType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org">
+ <s:element name="echoVoidSoapHeader">
+ <s:complexType />
+ </s:element>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/echoheader/">
+ <s:complexType name="echoMeComplexTypeRequest">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="varInt" type="s:int" />
+ <s:element minOccurs="1" maxOccurs="1" name="varFloat" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="echoMeStringRequest">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="echoMeComplexTypeResponse">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="varInt" type="s:int" />
+ <s:element minOccurs="1" maxOccurs="1" name="varFloat" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="echoMeStringResponse">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:schema>
+ </types>
+ <message name="echoVoidSoapIn">
+ <part name="parameters" element="s0:echoVoid" />
+ </message>
+ <message name="echoVoidSoapOut">
+ <part name="parameters" element="s0:echoVoidResponse" />
+ </message>
+ <message name="echoIntegerSoapIn">
+ <part name="parameters" element="s0:echoInteger" />
+ </message>
+ <message name="echoIntegerSoapOut">
+ <part name="parameters" element="s0:echoIntegerResponse" />
+ </message>
+ <message name="echoFloatSoapIn">
+ <part name="parameters" element="s0:echoFloat" />
+ </message>
+ <message name="echoFloatSoapOut">
+ <part name="parameters" element="s0:echoFloatResponse" />
+ </message>
+ <message name="echoStringSoapIn">
+ <part name="parameters" element="s0:echoString" />
+ </message>
+ <message name="echoStringSoapOut">
+ <part name="parameters" element="s0:echoStringResponse" />
+ </message>
+ <message name="echoBase64SoapIn">
+ <part name="parameters" element="s0:echoBase64" />
+ </message>
+ <message name="echoBase64SoapOut">
+ <part name="parameters" element="s0:echoBase64Response" />
+ </message>
+ <message name="echoDateSoapIn">
+ <part name="parameters" element="s0:echoDate" />
+ </message>
+ <message name="echoDateSoapOut">
+ <part name="parameters" element="s0:echoDateResponse" />
+ </message>
+ <message name="echoComplexTypeSoapIn">
+ <part name="parameters" element="s0:echoComplexType" />
+ </message>
+ <message name="echoComplexTypeSoapOut">
+ <part name="parameters" element="s0:echoComplexTypeResponse" />
+ </message>
+ <message name="echoIntegerMultiOccursSoapIn">
+ <part name="parameters" element="s0:echoIntegerMultiOccurs" />
+ </message>
+ <message name="echoIntegerMultiOccursSoapOut">
+ <part name="parameters" element="s0:echoIntegerMultiOccursResponse" />
+ </message>
+ <message name="echoFloatMultiOccursSoapIn">
+ <part name="parameters" element="s0:echoFloatMultiOccurs" />
+ </message>
+ <message name="echoFloatMultiOccursSoapOut">
+ <part name="parameters" element="s0:echoFloatMultiOccursResponse" />
+ </message>
+ <message name="echoStringMultiOccursSoapIn">
+ <part name="parameters" element="s0:echoStringMultiOccurs" />
+ </message>
+ <message name="echoStringMultiOccursSoapOut">
+ <part name="parameters" element="s0:echoStringMultiOccursResponse" />
+ </message>
+ <message name="echoComplexTypeMultiOccursSoapIn">
+ <part name="parameters" element="s0:echoComplexTypeMultiOccurs" />
+ </message>
+ <message name="echoComplexTypeMultiOccursSoapOut">
+ <part name="parameters" element="s0:echoComplexTypeMultiOccursResponse" />
+ </message>
+ <message name="echoDecimalSoapIn">
+ <part name="parameters" element="s0:echoDecimal" />
+ </message>
+ <message name="echoDecimalSoapOut">
+ <part name="parameters" element="s0:echoDecimalResponse" />
+ </message>
+ <message name="echoBooleanSoapIn">
+ <part name="parameters" element="s0:echoBoolean" />
+ </message>
+ <message name="echoBooleanSoapOut">
+ <part name="parameters" element="s0:echoBooleanResponse" />
+ </message>
+ <message name="echoHexBinarySoapIn">
+ <part name="parameters" element="s0:echoHexBinary" />
+ </message>
+ <message name="echoHexBinarySoapOut">
+ <part name="parameters" element="s0:echoHexBinaryResponse" />
+ </message>
+ <message name="echoComplexTypeAsSimpleTypesSoapIn">
+ <part name="parameters" element="s0:echoComplexTypeAsSimpleTypes" />
+ </message>
+ <message name="echoComplexTypeAsSimpleTypesSoapOut">
+ <part name="parameters" element="s0:echoComplexTypeAsSimpleTypesResponse" />
+ </message>
+ <message name="echoSimpleTypesAsComplexTypeSoapIn">
+ <part name="parameters" element="s0:echoSimpleTypesAsComplexType" />
+ </message>
+ <message name="echoSimpleTypesAsComplexTypeSoapOut">
+ <part name="parameters" element="s0:echoSimpleTypesAsComplexTypeResponse" />
+ </message>
+ <message name="echoNestedComplexTypeSoapIn">
+ <part name="parameters" element="s0:echoNestedComplexType" />
+ </message>
+ <message name="echoNestedComplexTypeSoapOut">
+ <part name="parameters" element="s0:echoNestedComplexTypeResponse" />
+ </message>
+ <message name="echoNestedMultiOccursSoapIn">
+ <part name="parameters" element="s0:echoNestedMultiOccurs" />
+ </message>
+ <message name="echoNestedMultiOccursSoapOut">
+ <part name="parameters" element="s0:echoNestedMultiOccursResponse" />
+ </message>
+ <message name="echoChoiceSoapIn">
+ <part name="parameters" element="s0:echoChoice" />
+ </message>
+ <message name="echoChoiceSoapOut">
+ <part name="parameters" element="s0:echoChoiceResponse" />
+ </message>
+ <message name="echoEnumSoapIn">
+ <part name="parameters" element="s0:echoEnum" />
+ </message>
+ <message name="echoEnumSoapOut">
+ <part name="parameters" element="s0:echoEnumResponse" />
+ </message>
+ <message name="echoAnyTypeSoapIn">
+ <part name="parameters" element="s0:echoAnyType" />
+ </message>
+ <message name="echoAnyTypeSoapOut">
+ <part name="parameters" element="s0:echoAnyTypeResponse" />
+ </message>
+ <message name="echoAnyElementSoapIn">
+ <part name="parameters" element="s0:echoAnyElement" />
+ </message>
+ <message name="echoAnyElementSoapOut">
+ <part name="parameters" element="s0:echoAnyElementResponse" />
+ </message>
+ <message name="echoVoidSoapHeaderSoapIn">
+ <part name="parameters" element="s2:echoVoidSoapHeader" />
+ </message>
+ <message name="echoVoidSoapHeaderSoapOut">
+ <part name="parameters" element="s0:echoVoidSoapHeaderResponse" />
+ </message>
+ <message name="echoVoidSoapHeaderechoMeComplexTypeRequest">
+ <part name="echoMeComplexTypeRequest" element="s0:echoMeComplexTypeRequest" />
+ </message>
+ <message name="echoVoidSoapHeaderechoMeComplexTypeResponse">
+ <part name="echoMeComplexTypeResponse" element="s0:echoMeComplexTypeResponse" />
+ </message>
+ <message name="echoVoidSoapHeaderechoMeStringRequest">
+ <part name="echoMeStringRequest" element="s0:echoMeStringRequest" />
+ </message>
+ <message name="echoVoidSoapHeaderechoMeStringResponse">
+ <part name="echoMeStringResponse" element="s0:echoMeStringResponse" />
+ </message>
+ <portType name="Round4XSDTestSoap">
+ <operation name="echoVoid">
+ <input message="s0:echoVoidSoapIn" />
+ <output message="s0:echoVoidSoapOut" />
+ </operation>
+ <operation name="echoInteger">
+ <input message="s0:echoIntegerSoapIn" />
+ <output message="s0:echoIntegerSoapOut" />
+ </operation>
+ <operation name="echoFloat">
+ <input message="s0:echoFloatSoapIn" />
+ <output message="s0:echoFloatSoapOut" />
+ </operation>
+ <operation name="echoString">
+ <input message="s0:echoStringSoapIn" />
+ <output message="s0:echoStringSoapOut" />
+ </operation>
+ <operation name="echoBase64">
+ <input message="s0:echoBase64SoapIn" />
+ <output message="s0:echoBase64SoapOut" />
+ </operation>
+ <operation name="echoDate">
+ <input message="s0:echoDateSoapIn" />
+ <output message="s0:echoDateSoapOut" />
+ </operation>
+ <operation name="echoComplexType">
+ <input message="s0:echoComplexTypeSoapIn" />
+ <output message="s0:echoComplexTypeSoapOut" />
+ </operation>
+ <operation name="echoIntegerMultiOccurs">
+ <input message="s0:echoIntegerMultiOccursSoapIn" />
+ <output message="s0:echoIntegerMultiOccursSoapOut" />
+ </operation>
+ <operation name="echoFloatMultiOccurs">
+ <input message="s0:echoFloatMultiOccursSoapIn" />
+ <output message="s0:echoFloatMultiOccursSoapOut" />
+ </operation>
+ <operation name="echoStringMultiOccurs">
+ <input message="s0:echoStringMultiOccursSoapIn" />
+ <output message="s0:echoStringMultiOccursSoapOut" />
+ </operation>
+ <operation name="echoComplexTypeMultiOccurs">
+ <input message="s0:echoComplexTypeMultiOccursSoapIn" />
+ <output message="s0:echoComplexTypeMultiOccursSoapOut" />
+ </operation>
+ <operation name="echoDecimal">
+ <input message="s0:echoDecimalSoapIn" />
+ <output message="s0:echoDecimalSoapOut" />
+ </operation>
+ <operation name="echoBoolean">
+ <input message="s0:echoBooleanSoapIn" />
+ <output message="s0:echoBooleanSoapOut" />
+ </operation>
+ <operation name="echoHexBinary">
+ <input message="s0:echoHexBinarySoapIn" />
+ <output message="s0:echoHexBinarySoapOut" />
+ </operation>
+ <operation name="echoComplexTypeAsSimpleTypes">
+ <input message="s0:echoComplexTypeAsSimpleTypesSoapIn" />
+ <output message="s0:echoComplexTypeAsSimpleTypesSoapOut" />
+ </operation>
+ <operation name="echoSimpleTypesAsComplexType">
+ <input message="s0:echoSimpleTypesAsComplexTypeSoapIn" />
+ <output message="s0:echoSimpleTypesAsComplexTypeSoapOut" />
+ </operation>
+ <operation name="echoNestedComplexType">
+ <input message="s0:echoNestedComplexTypeSoapIn" />
+ <output message="s0:echoNestedComplexTypeSoapOut" />
+ </operation>
+ <operation name="echoNestedMultiOccurs">
+ <input message="s0:echoNestedMultiOccursSoapIn" />
+ <output message="s0:echoNestedMultiOccursSoapOut" />
+ </operation>
+ <operation name="echoChoice">
+ <input message="s0:echoChoiceSoapIn" />
+ <output message="s0:echoChoiceSoapOut" />
+ </operation>
+ <operation name="echoEnum">
+ <input message="s0:echoEnumSoapIn" />
+ <output message="s0:echoEnumSoapOut" />
+ </operation>
+ <operation name="echoAnyType">
+ <input message="s0:echoAnyTypeSoapIn" />
+ <output message="s0:echoAnyTypeSoapOut" />
+ </operation>
+ <operation name="echoAnyElement">
+ <input message="s0:echoAnyElementSoapIn" />
+ <output message="s0:echoAnyElementSoapOut" />
+ </operation>
+ <operation name="echoVoidSoapHeader">
+ <input message="s0:echoVoidSoapHeaderSoapIn" />
+ <output message="s0:echoVoidSoapHeaderSoapOut" />
+ </operation>
+ </portType>
+ <binding name="Round4XSDTestSoap" type="s0:Round4XSDTestSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="echoVoid">
+ <soap:operation soapAction="http://soapinterop.org/echoVoid" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoInteger">
+ <soap:operation soapAction="http://soapinterop.org/echoInteger" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoFloat">
+ <soap:operation soapAction="http://soapinterop.org/echoFloat" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoString">
+ <soap:operation soapAction="http://soapinterop.org/echoString" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoBase64">
+ <soap:operation soapAction="http://soapinterop.org/echoBase64" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoDate">
+ <soap:operation soapAction="http://soapinterop.org/echoDate" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoComplexType">
+ <soap:operation soapAction="http://soapinterop.org/echoComplexType" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoIntegerMultiOccurs">
+ <soap:operation soapAction="http://soapinterop.org/echoIntegerMultiOccurs" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoFloatMultiOccurs">
+ <soap:operation soapAction="http://soapinterop.org/echoFloatMultiOccurs" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoStringMultiOccurs">
+ <soap:operation soapAction="http://soapinterop.org/echoStringMultiOccurs" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoComplexTypeMultiOccurs">
+ <soap:operation soapAction="http://soapinterop.org/echoComplexTypeMultiOccurs" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoDecimal">
+ <soap:operation soapAction="http://soapinterop.org/echoDecimal" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoBoolean">
+ <soap:operation soapAction="http://soapinterop.org/echoBoolean" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoHexBinary">
+ <soap:operation soapAction="http://soapinterop.org/echoHexBinary" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoComplexTypeAsSimpleTypes">
+ <soap:operation soapAction="http://soapinterop.org/echoComplexTypeAsSimpleTypes" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoSimpleTypesAsComplexType">
+ <soap:operation soapAction="http://soapinterop.org/echoSimpleTypesAsComplexType" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoNestedComplexType">
+ <soap:operation soapAction="http://soapinterop.org/echoNestedComplexType" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoNestedMultiOccurs">
+ <soap:operation soapAction="http://soapinterop.org/echoNestedMultiOccurs" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoChoice">
+ <soap:operation soapAction="http://soapinterop.org/echoChoice" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoEnum">
+ <soap:operation soapAction="http://soapinterop.org/echoEnum" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoAnyType">
+ <soap:operation soapAction="http://soapinterop.org/echoAnyType" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoAnyElement">
+ <soap:operation soapAction="http://soapinterop.org/echoAnyElement" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoVoidSoapHeader">
+ <soap:operation soapAction="http://soapinterop.org" style="document" />
+ <input>
+ <soap:body use="literal" />
+ <soap:header message="s0:echoVoidSoapHeaderechoMeComplexTypeRequest" part="echoMeComplexTypeRequest" use="literal" />
+ <soap:header message="s0:echoVoidSoapHeaderechoMeStringRequest" part="echoMeStringRequest" use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ <soap:header message="s0:echoVoidSoapHeaderechoMeComplexTypeResponse" part="echoMeComplexTypeResponse" use="literal" />
+ <soap:header message="s0:echoVoidSoapHeaderechoMeStringResponse" part="echoMeStringResponse" use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <binding name="Round4XSDTestSoap12" type="s0:Round4XSDTestSoap">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="echoVoid">
+ <soap12:operation soapAction="http://soapinterop.org/echoVoid" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoInteger">
+ <soap12:operation soapAction="http://soapinterop.org/echoInteger" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoFloat">
+ <soap12:operation soapAction="http://soapinterop.org/echoFloat" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoString">
+ <soap12:operation soapAction="http://soapinterop.org/echoString" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoBase64">
+ <soap12:operation soapAction="http://soapinterop.org/echoBase64" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoDate">
+ <soap12:operation soapAction="http://soapinterop.org/echoDate" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoComplexType">
+ <soap12:operation soapAction="http://soapinterop.org/echoComplexType" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoIntegerMultiOccurs">
+ <soap12:operation soapAction="http://soapinterop.org/echoIntegerMultiOccurs" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoFloatMultiOccurs">
+ <soap12:operation soapAction="http://soapinterop.org/echoFloatMultiOccurs" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoStringMultiOccurs">
+ <soap12:operation soapAction="http://soapinterop.org/echoStringMultiOccurs" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoComplexTypeMultiOccurs">
+ <soap12:operation soapAction="http://soapinterop.org/echoComplexTypeMultiOccurs" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoDecimal">
+ <soap12:operation soapAction="http://soapinterop.org/echoDecimal" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoBoolean">
+ <soap12:operation soapAction="http://soapinterop.org/echoBoolean" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoHexBinary">
+ <soap12:operation soapAction="http://soapinterop.org/echoHexBinary" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoComplexTypeAsSimpleTypes">
+ <soap12:operation soapAction="http://soapinterop.org/echoComplexTypeAsSimpleTypes" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoSimpleTypesAsComplexType">
+ <soap12:operation soapAction="http://soapinterop.org/echoSimpleTypesAsComplexType" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoNestedComplexType">
+ <soap12:operation soapAction="http://soapinterop.org/echoNestedComplexType" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoNestedMultiOccurs">
+ <soap12:operation soapAction="http://soapinterop.org/echoNestedMultiOccurs" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoChoice">
+ <soap12:operation soapAction="http://soapinterop.org/echoChoice" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoEnum">
+ <soap12:operation soapAction="http://soapinterop.org/echoEnum" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoAnyType">
+ <soap12:operation soapAction="http://soapinterop.org/echoAnyType" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoAnyElement">
+ <soap12:operation soapAction="http://soapinterop.org/echoAnyElement" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoVoidSoapHeader">
+ <soap12:operation soapAction="http://soapinterop.org" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ <soap12:header message="s0:echoVoidSoapHeaderechoMeComplexTypeRequest" part="echoMeComplexTypeRequest" use="literal" />
+ <soap12:header message="s0:echoVoidSoapHeaderechoMeStringRequest" part="echoMeStringRequest" use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ <soap12:header message="s0:echoVoidSoapHeaderechoMeComplexTypeResponse" part="echoMeComplexTypeResponse" use="literal" />
+ <soap12:header message="s0:echoVoidSoapHeaderechoMeStringResponse" part="echoMeStringResponse" use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <service name="Round4XSDTest">
+ <documentation>These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments.</documentation>
+ <port name="Round4XSDTestSoap" binding="s0:Round4XSDTestSoap">
+ <soap:address location="test://" />
+ </port>
+ <port name="Round4XSDTestSoap12" binding="s0:Round4XSDTestSoap12">
+ <soap12:address location="http://mssoapinterop.org/asmx/xsd/round4xsd.asmx" />
+ </port>
+ </service>
+</definitions> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round4/GroupI/skipif.inc b/ext/soap/tests/interop/Round4/GroupI/skipif.inc
new file mode 100644
index 0000000..fa8574e
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/schema/schema001.phpt b/ext/soap/tests/schema/schema001.phpt
new file mode 100644
index 0000000..9f2b7e5
--- /dev/null
+++ b/ext/soap/tests/schema/schema001.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP XML Schema 1: simpleType/restriction
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <restriction base="xsd:int"/>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',123.5);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+int(123)
+ok
diff --git a/ext/soap/tests/schema/schema002.phpt b/ext/soap/tests/schema/schema002.phpt
new file mode 100644
index 0000000..41f3bbe
--- /dev/null
+++ b/ext/soap/tests/schema/schema002.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP XML Schema 2: simpleType/restriction (reference to type)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType2">
+ <restriction base="xsd:int"/>
+ </simpleType>
+ <simpleType name="testType">
+ <restriction base="tns:testType2"/>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',123.5);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+int(123)
+ok
diff --git a/ext/soap/tests/schema/schema003.phpt b/ext/soap/tests/schema/schema003.phpt
new file mode 100644
index 0000000..7599100
--- /dev/null
+++ b/ext/soap/tests/schema/schema003.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP XML Schema 3: simpleType/restriction (reference to type, that is not defined yet)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <restriction base="tns:testType2"/>
+ </simpleType>
+ <simpleType name="testType2">
+ <restriction base="xsd:int"/>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',123.5);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+int(123)
+ok
diff --git a/ext/soap/tests/schema/schema004.phpt b/ext/soap/tests/schema/schema004.phpt
new file mode 100644
index 0000000..93ed1d1
--- /dev/null
+++ b/ext/soap/tests/schema/schema004.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP XML Schema 4: simpleType/restriction (reference to undefined type)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <restriction base="tns:testType2"/>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',123.5);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(5) "123.5"
+ok
diff --git a/ext/soap/tests/schema/schema005.phpt b/ext/soap/tests/schema/schema005.phpt
new file mode 100644
index 0000000..1db0c62
--- /dev/null
+++ b/ext/soap/tests/schema/schema005.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP XML Schema 5: simpleType/restriction (inline type)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <restriction>
+ <simpleType name="testType2">
+ <restriction base="xsd:int"/>
+ </simpleType>
+ </restriction>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',123.5);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+int(123)
+ok
diff --git a/ext/soap/tests/schema/schema006.phpt b/ext/soap/tests/schema/schema006.phpt
new file mode 100644
index 0000000..e41f275
--- /dev/null
+++ b/ext/soap/tests/schema/schema006.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP XML Schema 6: simpleType/restriction (referenced by ellement)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <restriction>
+ <simpleType name="testType2">
+ <restriction base="xsd:int"/>
+ </simpleType>
+ </restriction>
+ </simpleType>
+ <element name="testElement" type="tns:testType"/>
+EOF;
+test_schema($schema,'element="tns:testElement"',123.5);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+int(123)
+ok
diff --git a/ext/soap/tests/schema/schema007.phpt b/ext/soap/tests/schema/schema007.phpt
new file mode 100644
index 0000000..fd93c7a
--- /dev/null
+++ b/ext/soap/tests/schema/schema007.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP XML Schema 7: simpleType/restriction (referenced by ellement)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <element name="testElement" type="tns:testType"/>
+ <simpleType name="testType">
+ <restriction>
+ <simpleType name="testType2">
+ <restriction base="xsd:int"/>
+ </simpleType>
+ </restriction>
+ </simpleType>
+EOF;
+test_schema($schema,'element="tns:testElement"',123.5);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+int(123)
+ok
diff --git a/ext/soap/tests/schema/schema008.phpt b/ext/soap/tests/schema/schema008.phpt
new file mode 100644
index 0000000..1c4005f
--- /dev/null
+++ b/ext/soap/tests/schema/schema008.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP XML Schema 8: simpleType/restriction (anonymous, inside an ellement)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+<element name="testElement">
+ <simpleType>
+ <restriction>
+ <simpleType name="testType2">
+ <restriction base="xsd:int"/>
+ </simpleType>
+ </restriction>
+ </simpleType>
+</element>
+EOF;
+test_schema($schema,'element="tns:testElement"',123.5);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testElement">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+int(123)
+ok
+
diff --git a/ext/soap/tests/schema/schema009.phpt b/ext/soap/tests/schema/schema009.phpt
new file mode 100644
index 0000000..f7d1024
--- /dev/null
+++ b/ext/soap/tests/schema/schema009.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP XML Schema 9: simpleType/list (as string)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <list itemType="token"/>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',"one two");
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">one two</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(7) "one two"
+ok
diff --git a/ext/soap/tests/schema/schema010.phpt b/ext/soap/tests/schema/schema010.phpt
new file mode 100644
index 0000000..49136b9
--- /dev/null
+++ b/ext/soap/tests/schema/schema010.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP XML Schema 10: simpleType/list (as array)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <list itemType="token"/>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',array("one","two"));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">one two</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(7) "one two"
+ok
diff --git a/ext/soap/tests/schema/schema011.phpt b/ext/soap/tests/schema/schema011.phpt
new file mode 100644
index 0000000..8296311
--- /dev/null
+++ b/ext/soap/tests/schema/schema011.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP XML Schema 11: simpleType/list (inline type) (as string)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <list>
+ <simpleType>
+ <restriction base="int"/>
+ </simpleType>
+ </list>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',"123 456.7");
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123 456</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(7) "123 456"
+ok
diff --git a/ext/soap/tests/schema/schema012.phpt b/ext/soap/tests/schema/schema012.phpt
new file mode 100644
index 0000000..1d542d8
--- /dev/null
+++ b/ext/soap/tests/schema/schema012.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP XML Schema 12: simpleType/list (inline type) (as array)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <list>
+ <simpleType>
+ <restriction base="int"/>
+ </simpleType>
+ </list>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,456.7));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123 456</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(7) "123 456"
+ok
diff --git a/ext/soap/tests/schema/schema013.phpt b/ext/soap/tests/schema/schema013.phpt
new file mode 100644
index 0000000..4794d2d
--- /dev/null
+++ b/ext/soap/tests/schema/schema013.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP XML Schema 13: simpleType/union
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <union memberTypes="string int float"/>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',"str");
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">str</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(3) "str"
+ok
diff --git a/ext/soap/tests/schema/schema014.phpt b/ext/soap/tests/schema/schema014.phpt
new file mode 100644
index 0000000..3dab5f3
--- /dev/null
+++ b/ext/soap/tests/schema/schema014.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP XML Schema 14: simpleType/union
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <union memberTypes="string int float"/>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',123.5);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(5) "123.5"
+ok
diff --git a/ext/soap/tests/schema/schema015.phpt b/ext/soap/tests/schema/schema015.phpt
new file mode 100644
index 0000000..fe9b96b
--- /dev/null
+++ b/ext/soap/tests/schema/schema015.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP XML Schema 15: simpleType/union (inline type)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <union>
+ <simpleType>
+ <restriction base="string"/>
+ </simpleType>
+ <simpleType>
+ <restriction base="int"/>
+ </simpleType>
+ <simpleType>
+ <restriction base="float"/>
+ </simpleType>
+ </union>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',"str");
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">str</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(3) "str"
+ok
diff --git a/ext/soap/tests/schema/schema016.phpt b/ext/soap/tests/schema/schema016.phpt
new file mode 100644
index 0000000..11e9436
--- /dev/null
+++ b/ext/soap/tests/schema/schema016.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP XML Schema 16: simpleType/union (inline type)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <union>
+ <simpleType>
+ <restriction base="string"/>
+ </simpleType>
+ <simpleType>
+ <restriction base="int"/>
+ </simpleType>
+ <simpleType>
+ <restriction base="float"/>
+ </simpleType>
+ </union>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',123.5);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(5) "123.5"
+ok
diff --git a/ext/soap/tests/schema/schema017.phpt b/ext/soap/tests/schema/schema017.phpt
new file mode 100644
index 0000000..6689c36
--- /dev/null
+++ b/ext/soap/tests/schema/schema017.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 17: union with list
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <union>
+ <simpleType>
+ <restriction base="float"/>
+ </simpleType>
+ <simpleType>
+ <list itemType="int"/>
+ </simpleType>
+ </union>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',123.5);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(5) "123.5"
+ok
diff --git a/ext/soap/tests/schema/schema018.phpt b/ext/soap/tests/schema/schema018.phpt
new file mode 100644
index 0000000..0f3e8b8
--- /dev/null
+++ b/ext/soap/tests/schema/schema018.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP XML Schema 18: union with list
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <union>
+ <simpleType>
+ <restriction base="float"/>
+ </simpleType>
+ <simpleType>
+ <list itemType="int"/>
+ </simpleType>
+ </union>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',"123.5");
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(5) "123.5"
+ok
diff --git a/ext/soap/tests/schema/schema019.phpt b/ext/soap/tests/schema/schema019.phpt
new file mode 100644
index 0000000..0d2d753
--- /dev/null
+++ b/ext/soap/tests/schema/schema019.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP XML Schema 19: union with list
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <union>
+ <simpleType>
+ <restriction base="float"/>
+ </simpleType>
+ <simpleType>
+ <list itemType="int"/>
+ </simpleType>
+ </union>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',"123.5 456.7");
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5 456.7</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(11) "123.5 456.7"
+ok
diff --git a/ext/soap/tests/schema/schema020.phpt b/ext/soap/tests/schema/schema020.phpt
new file mode 100644
index 0000000..344757a
--- /dev/null
+++ b/ext/soap/tests/schema/schema020.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 20: union with list
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <union>
+ <simpleType>
+ <restriction base="float"/>
+ </simpleType>
+ <simpleType>
+ <list itemType="int"/>
+ </simpleType>
+ </union>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123.5,456.7));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5 456.7</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(11) "123.5 456.7"
+ok
diff --git a/ext/soap/tests/schema/schema021.phpt b/ext/soap/tests/schema/schema021.phpt
new file mode 100644
index 0000000..0628c6b
--- /dev/null
+++ b/ext/soap/tests/schema/schema021.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP XML Schema 21: list of unions
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <list>
+ <simpleType>
+ <union memberTypes="int float str"/>
+ </simpleType>
+ </list>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',"123 123.5 456.7 str");
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123 123.5 456.7 str</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(19) "123 123.5 456.7 str"
+ok
diff --git a/ext/soap/tests/schema/schema022.phpt b/ext/soap/tests/schema/schema022.phpt
new file mode 100644
index 0000000..a8f5bb9
--- /dev/null
+++ b/ext/soap/tests/schema/schema022.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP XML Schema 22: list of unions
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <simpleType name="testType">
+ <list>
+ <simpleType>
+ <union memberTypes="int float str"/>
+ </simpleType>
+ </list>
+ </simpleType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5,'str'));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123 123.5 str</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+string(13) "123 123.5 str"
+ok
diff --git a/ext/soap/tests/schema/schema023.phpt b/ext/soap/tests/schema/schema023.phpt
new file mode 100644
index 0000000..550bacf
--- /dev/null
+++ b/ext/soap/tests/schema/schema023.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 23: SOAP 1.1 Array
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:testType"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema024.phpt b/ext/soap/tests/schema/schema024.phpt
new file mode 100644
index 0000000..af836d1
--- /dev/null
+++ b/ext/soap/tests/schema/schema024.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP XML Schema 24: SOAP 1.1 Array (second way)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <all>
+ <element name="x_item" type="int" maxOccurs="unbounded"/>
+ </all>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:testType"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema025.phpt b/ext/soap/tests/schema/schema025.phpt
new file mode 100644
index 0000000..748e458
--- /dev/null
+++ b/ext/soap/tests/schema/schema025.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP XML Schema 25: SOAP 1.2 Array
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding">
+ <attribute ref="enc12:itemType" wsdl:itemType="int"/>
+ <attribute ref="enc12:arraySize" wsdl:arraySize="*"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:testType"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema026.phpt b/ext/soap/tests/schema/schema026.phpt
new file mode 100644
index 0000000..e17b5ac
--- /dev/null
+++ b/ext/soap/tests/schema/schema026.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP XML Schema 26: SOAP 1.2 Array (second way)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding">
+ <all>
+ <element name="x_item" type="int" maxOccurs="unbounded"/>
+ </all>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:testType"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema027.phpt b/ext/soap/tests/schema/schema027.phpt
new file mode 100644
index 0000000..e3b382e
--- /dev/null
+++ b/ext/soap/tests/schema/schema027.phpt
@@ -0,0 +1,35 @@
+--TEST--
+SOAP XML Schema 27: SOAP 1.1 Multidimensional array
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[,]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(array(123),array(123.5)));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2,1]" xsi:type="ns1:testType"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(123)
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ int(123)
+ }
+}
+ok
diff --git a/ext/soap/tests/schema/schema028.phpt b/ext/soap/tests/schema/schema028.phpt
new file mode 100644
index 0000000..7cc4ba5
--- /dev/null
+++ b/ext/soap/tests/schema/schema028.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SOAP XML Schema 28: SOAP 1.2 Multidimensional array
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding">
+ <attribute ref="enc12:itemType" wsdl:itemType="int"/>
+ <attribute ref="enc12:arraySize" wsdl:arraySize="* 1"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(array(123),array(123.5)));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2,1]" xsi:type="ns1:testType"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(123)
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ int(123)
+ }
+}
+ok
diff --git a/ext/soap/tests/schema/schema029.phpt b/ext/soap/tests/schema/schema029.phpt
new file mode 100644
index 0000000..2081aff
--- /dev/null
+++ b/ext/soap/tests/schema/schema029.phpt
@@ -0,0 +1,38 @@
+--TEST--
+SOAP XML Schema 29: SOAP 1.2 Multidimensional array (second way)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding">
+ <all>
+ <element name="x_item" type="int" maxOccurs="unbounded"/>
+ </all>
+ <attribute ref="enc12:arraySize" wsdl:arraySize="* 1"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(array(123),array(123.5)));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2,1]" xsi:type="ns1:testType"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(123)
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ int(123)
+ }
+}
+ok
diff --git a/ext/soap/tests/schema/schema030.phpt b/ext/soap/tests/schema/schema030.phpt
new file mode 100644
index 0000000..e468613
--- /dev/null
+++ b/ext/soap/tests/schema/schema030.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP XML Schema 30: Structure (sequence)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="int" type="int"/>
+ <element name="str" type="string"/>
+ </sequence>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">123</int><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["int"]=>
+ int(123)
+ ["str"]=>
+ string(3) "str"
+}
+ok
diff --git a/ext/soap/tests/schema/schema031.phpt b/ext/soap/tests/schema/schema031.phpt
new file mode 100644
index 0000000..479abfe
--- /dev/null
+++ b/ext/soap/tests/schema/schema031.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP XML Schema 31: Structure (all)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <all>
+ <element name="int" type="int"/>
+ <element name="str" type="string"/>
+ </all>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">123</int><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["int"]=>
+ int(123)
+ ["str"]=>
+ string(3) "str"
+}
+ok
diff --git a/ext/soap/tests/schema/schema032.phpt b/ext/soap/tests/schema/schema032.phpt
new file mode 100644
index 0000000..47b4af1
--- /dev/null
+++ b/ext/soap/tests/schema/schema032.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP XML Schema 32: Structure (choice)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <choice>
+ <element name="int" type="int"/>
+ <element name="str" type="string"/>
+ </choice>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">123</int></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (1) {
+ ["int"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema033.phpt b/ext/soap/tests/schema/schema033.phpt
new file mode 100644
index 0000000..b504bc0
--- /dev/null
+++ b/ext/soap/tests/schema/schema033.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SOAP XML Schema 33: Nested complex types
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType2">
+ <sequence>
+ <element name="int" type="int"/>
+ </sequence>
+ </complexType>
+ <complexType name="testType">
+ <sequence>
+ <element name="int" type="int"/>
+ <element name="nest" type="tns:testType2"/>
+ </sequence>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"nest"=>array("int"=>123.5)));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">123</int><nest xsi:type="ns1:testType2"><int xsi:type="xsd:int">123</int></nest></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["int"]=>
+ int(123)
+ ["nest"]=>
+ object(stdClass)#%d (1) {
+ ["int"]=>
+ int(123)
+ }
+}
+ok
diff --git a/ext/soap/tests/schema/schema034.phpt b/ext/soap/tests/schema/schema034.phpt
new file mode 100644
index 0000000..a83d6ea
--- /dev/null
+++ b/ext/soap/tests/schema/schema034.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP XML Schema 34: Nested complex types (element ref)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <element name="testType2" type="tns:testType2"/>
+ <complexType name="testType2">
+ <sequence>
+ <element name="int" type="int"/>
+ </sequence>
+ </complexType>
+ <complexType name="testType">
+ <sequence>
+ <element name="int" type="int"/>
+ <element ref="tns:testType2"/>
+ </sequence>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"testType2"=>array("int"=>123.5)));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">123</int><testType2 xsi:type="ns1:testType2"><int xsi:type="xsd:int">123</int></testType2></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["int"]=>
+ int(123)
+ ["testType2"]=>
+ object(stdClass)#%d (1) {
+ ["int"]=>
+ int(123)
+ }
+}
+ok
diff --git a/ext/soap/tests/schema/schema035.phpt b/ext/soap/tests/schema/schema035.phpt
new file mode 100644
index 0000000..8974ed0
--- /dev/null
+++ b/ext/soap/tests/schema/schema035.phpt
@@ -0,0 +1,38 @@
+--TEST--
+SOAP XML Schema 35: Nested complex types (element ref + anonymous type)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <element name="testType2">
+ <complexType>
+ <sequence>
+ <element name="int" type="int"/>
+ </sequence>
+ </complexType>
+ </element>
+ <complexType name="testType">
+ <sequence>
+ <element name="int" type="int"/>
+ <element ref="tns:testType2"/>
+ </sequence>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"testType2"=>array("int"=>123.5)));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">123</int><testType2 xsi:type="ns1:testType2"><int xsi:type="xsd:int">123</int></testType2></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["int"]=>
+ int(123)
+ ["testType2"]=>
+ object(stdClass)#%d (1) {
+ ["int"]=>
+ int(123)
+ }
+}
+ok
diff --git a/ext/soap/tests/schema/schema036.phpt b/ext/soap/tests/schema/schema036.phpt
new file mode 100644
index 0000000..9d6dac4
--- /dev/null
+++ b/ext/soap/tests/schema/schema036.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP XML Schema 36: Nested complex types (inline)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="int" type="int"/>
+ <element name="testType2">
+ <complexType>
+ <sequence>
+ <element name="int" type="int"/>
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"testType2"=>array("int"=>123.5)));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">123</int><testType2 xsi:type="ns1:testType2"><int xsi:type="xsd:int">123</int></testType2></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["int"]=>
+ int(123)
+ ["testType2"]=>
+ object(stdClass)#%d (1) {
+ ["int"]=>
+ int(123)
+ }
+}
+ok
diff --git a/ext/soap/tests/schema/schema037.phpt b/ext/soap/tests/schema/schema037.phpt
new file mode 100644
index 0000000..4e59981
--- /dev/null
+++ b/ext/soap/tests/schema/schema037.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP XML Schema 37: Structure with attributes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="str" type="string"/>
+ </sequence>
+ <attribute name="int" type="int"/>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["str"]=>
+ string(3) "str"
+ ["int"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema038.phpt b/ext/soap/tests/schema/schema038.phpt
new file mode 100644
index 0000000..2d37e89
--- /dev/null
+++ b/ext/soap/tests/schema/schema038.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 38: Structure with attributes (ref)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="str" type="string"/>
+ </sequence>
+ <attribute ref="tns:int"/>
+ </complexType>
+ <attribute name="int" type="int"/>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["str"]=>
+ string(3) "str"
+ ["int"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema039.phpt b/ext/soap/tests/schema/schema039.phpt
new file mode 100644
index 0000000..0b7ef5a
--- /dev/null
+++ b/ext/soap/tests/schema/schema039.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP XML Schema 39: Structure with attributes (attributeGroup)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="str" type="string"/>
+ </sequence>
+ <attributeGroup ref="tns:intGroup"/>
+ </complexType>
+ <attributeGroup name="intGroup">
+ <attribute name="int" type="int"/>
+ </attributeGroup>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["str"]=>
+ string(3) "str"
+ ["int"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema040.phpt b/ext/soap/tests/schema/schema040.phpt
new file mode 100644
index 0000000..f7ddc04
--- /dev/null
+++ b/ext/soap/tests/schema/schema040.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP XML Schema 40: Structure with attributes (inline types)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="str" type="string"/>
+ </sequence>
+ <attribute name="int">
+ <simpleType>
+ <restriction base="int"/>
+ </simpleType>
+ </attribute>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["str"]=>
+ string(3) "str"
+ ["int"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema041.phpt b/ext/soap/tests/schema/schema041.phpt
new file mode 100644
index 0000000..1264cf5
--- /dev/null
+++ b/ext/soap/tests/schema/schema041.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP XML Schema 41: Structure (group)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <group ref="tns:testGroup"/>
+ </complexType>
+ <group name="testGroup">
+ <sequence>
+ <element name="int" type="int"/>
+ <element name="str" type="string"/>
+ </sequence>
+ </group>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">123</int><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["int"]=>
+ int(123)
+ ["str"]=>
+ string(3) "str"
+}
+ok
diff --git a/ext/soap/tests/schema/schema042.phpt b/ext/soap/tests/schema/schema042.phpt
new file mode 100644
index 0000000..a8aa885
--- /dev/null
+++ b/ext/soap/tests/schema/schema042.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 42: Extension of simple type
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <simpleContent>
+ <extension base="int">
+ <attribute name="int" type="int"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType" int="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["_"]=>
+ int(123)
+ ["int"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema043.phpt b/ext/soap/tests/schema/schema043.phpt
new file mode 100644
index 0000000..08c2996
--- /dev/null
+++ b/ext/soap/tests/schema/schema043.phpt
@@ -0,0 +1,38 @@
+--TEST--
+SOAP XML Schema 43: Extension of simple type (2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType2">
+ <simpleContent>
+ <extension base="int">
+ <attribute name="int" type="int"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <complexType name="testType">
+ <simpleContent>
+ <extension base="tns:testType2">
+ <attribute name="int2" type="int"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType" int="123" int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (3) {
+ ["_"]=>
+ int(123)
+ ["int"]=>
+ int(123)
+ ["int2"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema044.phpt b/ext/soap/tests/schema/schema044.phpt
new file mode 100644
index 0000000..8fc0705
--- /dev/null
+++ b/ext/soap/tests/schema/schema044.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 44: Restriction of simple type
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <simpleContent>
+ <restriction base="int">
+ <attribute name="int" type="int"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType" int="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["_"]=>
+ int(123)
+ ["int"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema045.phpt b/ext/soap/tests/schema/schema045.phpt
new file mode 100644
index 0000000..346a929
--- /dev/null
+++ b/ext/soap/tests/schema/schema045.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SOAP XML Schema 45: Restriction of simple type (2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType2">
+ <simpleContent>
+ <extension base="int">
+ <attribute name="int" type="int"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <complexType name="testType">
+ <simpleContent>
+ <restriction base="tns:testType2">
+ <attribute name="int2" type="int"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType" int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["_"]=>
+ int(123)
+ ["int2"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema046.phpt b/ext/soap/tests/schema/schema046.phpt
new file mode 100644
index 0000000..3f9d03a
--- /dev/null
+++ b/ext/soap/tests/schema/schema046.phpt
@@ -0,0 +1,38 @@
+--TEST--
+SOAP XML Schema 46: Extension of complex type
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType2">
+ <simpleContent>
+ <extension base="int">
+ <attribute name="int" type="int"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <complexType name="testType">
+ <complexContent>
+ <extension base="tns:testType2">
+ <attribute name="int2" type="int"/>
+ </extension>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType" int="123" int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (3) {
+ ["_"]=>
+ int(123)
+ ["int"]=>
+ int(123)
+ ["int2"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema047.phpt b/ext/soap/tests/schema/schema047.phpt
new file mode 100644
index 0000000..1265cfd
--- /dev/null
+++ b/ext/soap/tests/schema/schema047.phpt
@@ -0,0 +1,34 @@
+--TEST--
+SOAP XML Schema 47: Extension of complex type (2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType2">
+ <sequence>
+ <element name="int" type="int"/>
+ </sequence>
+ </complexType>
+ <complexType name="testType">
+ <complexContent>
+ <extension base="tns:testType2">
+ <attribute name="int2" type="int"/>
+ </extension>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType" int2="123"><int xsi:type="xsd:int">123</int></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["int"]=>
+ int(123)
+ ["int2"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema048.phpt b/ext/soap/tests/schema/schema048.phpt
new file mode 100644
index 0000000..98d4d4b
--- /dev/null
+++ b/ext/soap/tests/schema/schema048.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SOAP XML Schema 48: Restriction of complex type
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType2">
+ <simpleContent>
+ <extension base="int">
+ <attribute name="int" type="int"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="tns:testType2">
+ <attribute name="int2" type="int"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType" int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["_"]=>
+ int(123)
+ ["int2"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema049.phpt b/ext/soap/tests/schema/schema049.phpt
new file mode 100644
index 0000000..7268a4b
--- /dev/null
+++ b/ext/soap/tests/schema/schema049.phpt
@@ -0,0 +1,35 @@
+--TEST--
+SOAP XML Schema 49: Restriction of complex type (2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType2">
+ <sequence>
+ <element name="int" type="int"/>
+ <element name="int2" type="int"/>
+ </sequence>
+ </complexType>
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="tns:testType2">
+ <sequence>
+ <element name="int2" type="int"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int2 xsi:type="xsd:int">123</int2></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (1) {
+ ["int2"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema050.phpt b/ext/soap/tests/schema/schema050.phpt
new file mode 100644
index 0000000..6c73512
--- /dev/null
+++ b/ext/soap/tests/schema/schema050.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP XML Schema 50: Array in complex type (maxOccurs > 1, one value)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="int" type="int"/>
+ <element name="int2" type="int" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"int2"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">123</int><int2 xsi:type="xsd:int">123</int2></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["int"]=>
+ int(123)
+ ["int2"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema051.phpt b/ext/soap/tests/schema/schema051.phpt
new file mode 100644
index 0000000..9636399
--- /dev/null
+++ b/ext/soap/tests/schema/schema051.phpt
@@ -0,0 +1,33 @@
+--TEST--
+SOAP XML Schema 51: Array in complex type (maxOccurs > 1, array)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="int" type="int"/>
+ <element name="int2" type="int" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"int2"=>array(123.5,456.7)));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">123</int><int2 xsi:type="xsd:int">123</int2><int2 xsi:type="xsd:int">456</int2></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["int"]=>
+ int(123)
+ ["int2"]=>
+ array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(456)
+ }
+}
+ok
diff --git a/ext/soap/tests/schema/schema052.phpt b/ext/soap/tests/schema/schema052.phpt
new file mode 100644
index 0000000..8e7121a
--- /dev/null
+++ b/ext/soap/tests/schema/schema052.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP XML Schema 52: Array in complex type (maxOccurs > 1, array with one value)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="int" type="int"/>
+ <element name="int2" type="int" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"int2"=>array(123.5)));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">123</int><int2 xsi:type="xsd:int">123</int2></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["int"]=>
+ int(123)
+ ["int2"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema053.phpt b/ext/soap/tests/schema/schema053.phpt
new file mode 100644
index 0000000..8893bf5
--- /dev/null
+++ b/ext/soap/tests/schema/schema053.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP XML Schema 52: Array in complex type (maxOccurs > 1, empty array)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="int" type="int"/>
+ <element name="int2" type="int" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("int"=>123.5,"int2"=>array()));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">123</int></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (1) {
+ ["int"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema054.phpt b/ext/soap/tests/schema/schema054.phpt
new file mode 100644
index 0000000..5adf2f5
--- /dev/null
+++ b/ext/soap/tests/schema/schema054.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP XML Schema 54: Apache Map
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = '';
+test_schema($schema,'type="apache:Map" xmlns:apache="http://xml.apache.org/xml-soap"',array('a'=>123,'b'=>123.5));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns2:Map"><item><key xsi:type="xsd:string">a</key><value xsi:type="xsd:int">123</value></item><item><key xsi:type="xsd:string">b</key><value xsi:type="xsd:float">123.5</value></item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ ["a"]=>
+ int(123)
+ ["b"]=>
+ float(123.5)
+}
+ok
diff --git a/ext/soap/tests/schema/schema055.phpt b/ext/soap/tests/schema/schema055.phpt
new file mode 100644
index 0000000..14dbdb7
--- /dev/null
+++ b/ext/soap/tests/schema/schema055.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP XML Schema 55: Apache Map (extension)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <extension base="apache:Map" xmlns:apache="http://xml.apache.org/xml-soap">
+ </extension>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="testType"',array('a'=>123,'b'=>123.5));
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns2:Map"><item><key xsi:type="xsd:string">a</key><value xsi:type="xsd:int">123</value></item><item><key xsi:type="xsd:string">b</key><value xsi:type="xsd:float">123.5</value></item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ ["a"]=>
+ int(123)
+ ["b"]=>
+ float(123.5)
+}
+ok
diff --git a/ext/soap/tests/schema/schema056.phpt b/ext/soap/tests/schema/schema056.phpt
new file mode 100644
index 0000000..1ada78e
--- /dev/null
+++ b/ext/soap/tests/schema/schema056.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 56: SOAP 1.1 Array (literal encoding)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),'rpc','literal');
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><ns1:test><testParam><xsd:int>123</xsd:int><xsd:int>123</xsd:int></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema057.phpt b/ext/soap/tests/schema/schema057.phpt
new file mode 100644
index 0000000..1848b9c
--- /dev/null
+++ b/ext/soap/tests/schema/schema057.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP XML Schema 57: SOAP 1.1 Array (second way, literal encoding)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <all>
+ <element name="x_item" type="int" maxOccurs="unbounded"/>
+ </all>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),'rpc','literal');
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><ns1:test><testParam><x_item>123</x_item><x_item>123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema058.phpt b/ext/soap/tests/schema/schema058.phpt
new file mode 100644
index 0000000..b96fc9f
--- /dev/null
+++ b/ext/soap/tests/schema/schema058.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP XML Schema 58: SOAP 1.2 Array (literal encoding)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding">
+ <attribute ref="enc12:itemType" wsdl:itemType="int"/>
+ <attribute ref="enc12:arraySize" wsdl:arraySize="*"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),'rpc','literal');
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><ns1:test><testParam><xsd:int>123</xsd:int><xsd:int>123</xsd:int></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema059.phpt b/ext/soap/tests/schema/schema059.phpt
new file mode 100644
index 0000000..875bae9
--- /dev/null
+++ b/ext/soap/tests/schema/schema059.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP XML Schema 59: SOAP 1.2 Array (second way, literal encoding)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding">
+ <all>
+ <element name="x_item" type="int" maxOccurs="unbounded"/>
+ </all>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),'rpc','literal');
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><ns1:test><testParam><x_item>123</x_item><x_item>123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema060.phpt b/ext/soap/tests/schema/schema060.phpt
new file mode 100644
index 0000000..4daa83c
--- /dev/null
+++ b/ext/soap/tests/schema/schema060.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SOAP XML Schema 60: SOAP 1.2 Multidimensional array (literal encoding)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding">
+ <attribute ref="enc12:itemType" wsdl:itemType="int"/>
+ <attribute ref="enc12:arraySize" wsdl:arraySize="* 1"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(array(123),array(123.5)),'rpc','literal');
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><ns1:test><testParam><xsd:int>123</xsd:int><xsd:int>123</xsd:int></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(123)
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ int(123)
+ }
+}
+ok
diff --git a/ext/soap/tests/schema/schema061.phpt b/ext/soap/tests/schema/schema061.phpt
new file mode 100644
index 0000000..bbd2aa6
--- /dev/null
+++ b/ext/soap/tests/schema/schema061.phpt
@@ -0,0 +1,38 @@
+--TEST--
+SOAP XML Schema 61: SOAP 1.2 Multidimensional array (second way, literal encoding)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding">
+ <all>
+ <element name="x_item" type="int" maxOccurs="unbounded"/>
+ </all>
+ <attribute ref="enc12:arraySize" wsdl:arraySize="* 1"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(array(123),array(123.5)),'rpc','literal');
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><ns1:test><testParam><x_item>123</x_item><x_item>123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(123)
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ int(123)
+ }
+}
+ok
diff --git a/ext/soap/tests/schema/schema062.phpt b/ext/soap/tests/schema/schema062.phpt
new file mode 100644
index 0000000..60b0656
--- /dev/null
+++ b/ext/soap/tests/schema/schema062.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 62: NULL with attributes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <simpleContent>
+ <restriction base="int">
+ <attribute name="int" type="int"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("_"=>NULL,"int"=>123.5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:nil="true" int="123" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["_"]=>
+ NULL
+ ["int"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema063.phpt b/ext/soap/tests/schema/schema063.phpt
new file mode 100644
index 0000000..7fda578
--- /dev/null
+++ b/ext/soap/tests/schema/schema063.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP XML Schema 63: standard unsignedLong type
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = '';
+test_schema($schema,'type="xsd:unsignedLong"',0xffffffff);
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="xsd:unsignedLong">4294967295</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+%s(4294967295)
+ok
diff --git a/ext/soap/tests/schema/schema064.phpt b/ext/soap/tests/schema/schema064.phpt
new file mode 100644
index 0000000..899a293
--- /dev/null
+++ b/ext/soap/tests/schema/schema064.phpt
@@ -0,0 +1,61 @@
+--TEST--
+SOAP XML Schema 64: standard date/time types
+--SKIPIF--
+<?php
+if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
+ die('skip, windows has different TZ format');
+}
+require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="dateTime" type="dateTime"/>
+ <element name="time" type="time"/>
+ <element name="date" type="date"/>
+ <element name="gYearMonth" type="gYearMonth"/>
+ <element name="gYear" type="gYear"/>
+ <element name="gMonthDay" type="gMonthDay"/>
+ <element name="gDay" type="gDay"/>
+ <element name="gMonth" type="gMonth"/>
+ </sequence>
+ </complexType>
+EOF;
+$date = gmmktime(1,2,3,4,5,1976);
+putenv('TZ=GMT');
+test_schema($schema,'type="tns:testType"',array(
+ 'dateTime' => $date,
+ 'time' => $date,
+ 'date' => $date,
+ 'gYearMonth' => $date,
+ 'gYear' => $date,
+ 'gMonthDay' => $date,
+ 'gDay' => $date,
+ 'gMonth' => $date
+));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><dateTime xsi:type="xsd:dateTime">1976-04-05T01:02:03Z</dateTime><time xsi:type="xsd:time">01:02:03Z</time><date xsi:type="xsd:date">1976-04-05Z</date><gYearMonth xsi:type="xsd:gYearMonth">1976-04Z</gYearMonth><gYear xsi:type="xsd:gYear">1976Z</gYear><gMonthDay xsi:type="xsd:gMonthDay">--04-05Z</gMonthDay><gDay xsi:type="xsd:gDay">---05Z</gDay><gMonth xsi:type="xsd:gMonth">--04--Z</gMonth></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (8) {
+ ["dateTime"]=>
+ string(20) "1976-04-05T01:02:03Z"
+ ["time"]=>
+ string(9) "01:02:03Z"
+ ["date"]=>
+ string(11) "1976-04-05Z"
+ ["gYearMonth"]=>
+ string(8) "1976-04Z"
+ ["gYear"]=>
+ string(5) "1976Z"
+ ["gMonthDay"]=>
+ string(8) "--04-05Z"
+ ["gDay"]=>
+ string(6) "---05Z"
+ ["gMonth"]=>
+ string(7) "--04--Z"
+}
+ok
diff --git a/ext/soap/tests/schema/schema065.phpt b/ext/soap/tests/schema/schema065.phpt
new file mode 100644
index 0000000..3199a6b
--- /dev/null
+++ b/ext/soap/tests/schema/schema065.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP XML Schema 65: Attribute with default value
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <attribute name="str" type="string"/>
+ <attribute name="int" type="int" default="5"/>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str"));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["str"]=>
+ string(3) "str"
+ ["int"]=>
+ int(5)
+}
+ok
diff --git a/ext/soap/tests/schema/schema066.phpt b/ext/soap/tests/schema/schema066.phpt
new file mode 100644
index 0000000..7fe47bb
--- /dev/null
+++ b/ext/soap/tests/schema/schema066.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP XML Schema 66: Attribute with fixed value (1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <attribute name="str" type="string"/>
+ <attribute name="int" type="int" fixed="5"/>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str"));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["str"]=>
+ string(3) "str"
+ ["int"]=>
+ int(5)
+}
+ok
diff --git a/ext/soap/tests/schema/schema067.phpt b/ext/soap/tests/schema/schema067.phpt
new file mode 100644
index 0000000..5ee0036
--- /dev/null
+++ b/ext/soap/tests/schema/schema067.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP XML Schema 67: Attribute with fixed value (2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <attribute name="str" type="string"/>
+ <attribute name="int" type="int" fixed="5"/>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>5));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" int="5" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["str"]=>
+ string(3) "str"
+ ["int"]=>
+ int(5)
+}
+ok
diff --git a/ext/soap/tests/schema/schema068.phpt b/ext/soap/tests/schema/schema068.phpt
new file mode 100644
index 0000000..88fdac3
--- /dev/null
+++ b/ext/soap/tests/schema/schema068.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP XML Schema 68: Attribute with fixed value (3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <attribute name="str" type="string"/>
+ <attribute name="int" type="int" fixed="5"/>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>4));
+echo "ok";
+?>
+--EXPECTF--
+Fatal error: SOAP-ERROR: Encoding: Attribute 'int' has fixed value '5' (value '4' is not allowed) in %stest_schema.inc on line %d \ No newline at end of file
diff --git a/ext/soap/tests/schema/schema069.phpt b/ext/soap/tests/schema/schema069.phpt
new file mode 100644
index 0000000..ccaa342
--- /dev/null
+++ b/ext/soap/tests/schema/schema069.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP XML Schema 69: Attribute with default value (reference)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <attribute name="str" type="string"/>
+ <attribute ref="tns:int"/>
+ </complexType>
+ <attribute name="int" type="int" default="5"/>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str"));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["str"]=>
+ string(3) "str"
+ ["int"]=>
+ int(5)
+}
+ok
diff --git a/ext/soap/tests/schema/schema070.phpt b/ext/soap/tests/schema/schema070.phpt
new file mode 100644
index 0000000..0c1e249
--- /dev/null
+++ b/ext/soap/tests/schema/schema070.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 70: Attribute with default value (attributeGroup)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <attribute name="str" type="string"/>
+ <attributeGroup ref="tns:int_group"/>
+ </complexType>
+ <attributeGroup name="int_group">
+ <attribute name="int" type="int" default="5"/>
+ </attributeGroup>
+EOF;
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str"));
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["str"]=>
+ string(3) "str"
+ ["int"]=>
+ int(5)
+}
+ok
diff --git a/ext/soap/tests/schema/schema071.phpt b/ext/soap/tests/schema/schema071.phpt
new file mode 100644
index 0000000..1991f7a
--- /dev/null
+++ b/ext/soap/tests/schema/schema071.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP XML Schema 71: SOAP 1.1 Array (document style)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),'document','literal');
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><testParam><xsd:int>123</xsd:int><xsd:int>123</xsd:int></testParam></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/schema/schema072.phpt b/ext/soap/tests/schema/schema072.phpt
new file mode 100644
index 0000000..89a0ed3
--- /dev/null
+++ b/ext/soap/tests/schema/schema072.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP XML Schema 72: SOAP 1.1 Array (document style, element with inline type)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <element name="testElement">
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </element>
+EOF;
+test_schema($schema,'element="tns:testElement"',array(123,123.5),'document','literal');
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://test-uri/"><SOAP-ENV:Body><ns1:testElement><xsd:int>123</xsd:int><xsd:int>123</xsd:int></ns1:testElement></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/schema/schema073.phpt b/ext/soap/tests/schema/schema073.phpt
new file mode 100644
index 0000000..22dd9e2
--- /dev/null
+++ b/ext/soap/tests/schema/schema073.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP XML Schema 73: SOAP 1.1 Array (document style, element with type ref)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <element name="testElement" type="tns:testType"/>
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'element="tns:testElement"',array(123,123.5),'document','literal');
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://test-uri/"><SOAP-ENV:Body><ns1:testElement><xsd:int>123</xsd:int><xsd:int>123</xsd:int></ns1:testElement></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/schema/schema074.phpt b/ext/soap/tests/schema/schema074.phpt
new file mode 100644
index 0000000..3dbba0c
--- /dev/null
+++ b/ext/soap/tests/schema/schema074.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 74: Structure with attributes and qualified elements
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="str" type="string"/>
+ </sequence>
+ <attribute name="int" type="int"/>
+ </complexType>
+EOF;
+
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5), "rpc", "encoded", 'attributeFormDefault="qualified"');
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam ns1:int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+ ["str"]=>
+ string(3) "str"
+ ["int"]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema075.phpt b/ext/soap/tests/schema/schema075.phpt
new file mode 100644
index 0000000..5867e55
--- /dev/null
+++ b/ext/soap/tests/schema/schema075.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP XML Schema 75: Attributes form qualified/unqualified (attributeFormDefault="qualified")
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <attribute name="int1" type="int"/>
+ <attribute name="int2" type="int" form="qualified"/>
+ <attribute name="int3" type="int" form="unqualified"/>
+ </complexType>
+EOF;
+
+test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded", 'attributeFormDefault="qualified"');
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam ns1:int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (3) {
+ ["int1"]=>
+ int(1)
+ ["int2"]=>
+ int(2)
+ ["int3"]=>
+ int(3)
+}
+ok
diff --git a/ext/soap/tests/schema/schema076.phpt b/ext/soap/tests/schema/schema076.phpt
new file mode 100644
index 0000000..3ad2eae
--- /dev/null
+++ b/ext/soap/tests/schema/schema076.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP XML Schema 76: Attributes form qualified/unqualified (attributeFormDefault="unqualified")
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <attribute name="int1" type="int"/>
+ <attribute name="int2" type="int" form="qualified"/>
+ <attribute name="int3" type="int" form="unqualified"/>
+ </complexType>
+EOF;
+
+test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded", 'attributeFormDefault="unqualified"');
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (3) {
+ ["int1"]=>
+ int(1)
+ ["int2"]=>
+ int(2)
+ ["int3"]=>
+ int(3)
+}
+ok
diff --git a/ext/soap/tests/schema/schema077.phpt b/ext/soap/tests/schema/schema077.phpt
new file mode 100644
index 0000000..16057cf
--- /dev/null
+++ b/ext/soap/tests/schema/schema077.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP XML Schema 77: Attributes form qualified/unqualified (attributeFormDefault - default)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <attribute name="int1" type="int"/>
+ <attribute name="int2" type="int" form="qualified"/>
+ <attribute name="int3" type="int" form="unqualified"/>
+ </complexType>
+EOF;
+
+test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded");
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (3) {
+ ["int1"]=>
+ int(1)
+ ["int2"]=>
+ int(2)
+ ["int3"]=>
+ int(3)
+}
+ok
diff --git a/ext/soap/tests/schema/schema078.phpt b/ext/soap/tests/schema/schema078.phpt
new file mode 100644
index 0000000..7636a78
--- /dev/null
+++ b/ext/soap/tests/schema/schema078.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP XML Schema 78: Element form qualified/unqualified (elementFormDefault="qualified")
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="int1" type="int"/>
+ <element name="int2" type="int" form="qualified"/>
+ <element name="int3" type="int" form="unqualified"/>
+ </sequence>
+ </complexType>
+EOF;
+
+test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "literal", 'elementFormDefault="qualified"');
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/"><SOAP-ENV:Body><ns1:test><testParam><ns1:int1>1</ns1:int1><ns1:int2>2</ns1:int2><int3>3</int3></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (3) {
+ ["int1"]=>
+ int(1)
+ ["int2"]=>
+ int(2)
+ ["int3"]=>
+ int(3)
+}
+ok
diff --git a/ext/soap/tests/schema/schema079.phpt b/ext/soap/tests/schema/schema079.phpt
new file mode 100644
index 0000000..34dcd9b
--- /dev/null
+++ b/ext/soap/tests/schema/schema079.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP XML Schema 79: Element form qualified/unqualified (elementFormDefault="unqualified")
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="int1" type="int"/>
+ <element name="int2" type="int" form="qualified"/>
+ <element name="int3" type="int" form="unqualified"/>
+ </sequence>
+ </complexType>
+EOF;
+
+test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "literal", 'elementFormDefault="unqualified"');
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/"><SOAP-ENV:Body><ns1:test><testParam><int1>1</int1><ns1:int2>2</ns1:int2><int3>3</int3></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (3) {
+ ["int1"]=>
+ int(1)
+ ["int2"]=>
+ int(2)
+ ["int3"]=>
+ int(3)
+}
+ok
diff --git a/ext/soap/tests/schema/schema080.phpt b/ext/soap/tests/schema/schema080.phpt
new file mode 100644
index 0000000..7519d6a
--- /dev/null
+++ b/ext/soap/tests/schema/schema080.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP XML Schema 80: Element form qualified/unqualified (elementFormDefault - default)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <sequence>
+ <element name="int1" type="int"/>
+ <element name="int2" type="int" form="qualified"/>
+ <element name="int3" type="int" form="unqualified"/>
+ </sequence>
+ </complexType>
+EOF;
+
+test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "literal");
+echo "ok";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/"><SOAP-ENV:Body><ns1:test><testParam><int1>1</int1><ns1:int2>2</ns1:int2><int3>3</int3></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (3) {
+ ["int1"]=>
+ int(1)
+ ["int2"]=>
+ int(2)
+ ["int3"]=>
+ int(3)
+}
+ok
diff --git a/ext/soap/tests/schema/schema081.phpt b/ext/soap/tests/schema/schema081.phpt
new file mode 100644
index 0000000..337f081
--- /dev/null
+++ b/ext/soap/tests/schema/schema081.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 81: SOAP 1.1 Array with SOAP_USE_XSI_ARRAY_TYPE
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),"rpc","encoded",'',SOAP_USE_XSI_ARRAY_TYPE);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema082.phpt b/ext/soap/tests/schema/schema082.phpt
new file mode 100644
index 0000000..34c4c76
--- /dev/null
+++ b/ext/soap/tests/schema/schema082.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP XML Schema 82: SOAP 1.1 Array with SOAP_USE_XSI_ARRAY_TYPE (second way)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <all>
+ <element name="x_item" type="int" maxOccurs="unbounded"/>
+ </all>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),"rpc","encoded",'',SOAP_USE_XSI_ARRAY_TYPE);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="SOAP-ENC:Array"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema083.phpt b/ext/soap/tests/schema/schema083.phpt
new file mode 100644
index 0000000..854c4f9
--- /dev/null
+++ b/ext/soap/tests/schema/schema083.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP XML Schema 83: SOAP 1.2 Array with SOAP_USE_XSI_ARRAY_TYPE
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding">
+ <attribute ref="enc12:itemType" wsdl:itemType="int"/>
+ <attribute ref="enc12:arraySize" wsdl:arraySize="*"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),"rpc","encoded",'',SOAP_USE_XSI_ARRAY_TYPE);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema084.phpt b/ext/soap/tests/schema/schema084.phpt
new file mode 100644
index 0000000..94a9551
--- /dev/null
+++ b/ext/soap/tests/schema/schema084.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP XML Schema 84: SOAP 1.2 Array with SOAP_USE_XSI_ARRAY_TYPE (second way)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding">
+ <all>
+ <element name="x_item" type="int" maxOccurs="unbounded"/>
+ </all>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),"rpc","encoded",'',SOAP_USE_XSI_ARRAY_TYPE);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="SOAP-ENC:Array"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema085.phpt b/ext/soap/tests/schema/schema085.phpt
new file mode 100644
index 0000000..9a93ac7
--- /dev/null
+++ b/ext/soap/tests/schema/schema085.phpt
@@ -0,0 +1,45 @@
+--TEST--
+SOAP XML Schema 85: Extension of complex type (elements order)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType2">
+ <sequence>
+ <element name="int" type="int"/>
+ </sequence>
+ </complexType>
+ <complexType name="testType">
+ <complexContent>
+ <extension base="tns:testType2">
+ <sequence>
+ <element name="int2" type="int"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+EOF;
+class A {
+ public $int = 1;
+}
+
+class B extends A {
+ public $int2 = 2;
+}
+
+
+test_schema($schema,'type="tns:testType"',new B());
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">1</int><int2 xsi:type="xsd:int">2</int2></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#5 (2) {
+ ["int"]=>
+ int(1)
+ ["int2"]=>
+ int(2)
+}
+ok
diff --git a/ext/soap/tests/schema/skipif.inc b/ext/soap/tests/schema/skipif.inc
new file mode 100644
index 0000000..8780887
--- /dev/null
+++ b/ext/soap/tests/schema/skipif.inc
@@ -0,0 +1,5 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+ /* xml parser is required by test_schema.inc */
+ if (!extension_loaded('xml')) die('skip xml extension not available');
+?>
diff --git a/ext/soap/tests/schema/test_schema.inc b/ext/soap/tests/schema/test_schema.inc
new file mode 100644
index 0000000..bfc4ce0
--- /dev/null
+++ b/ext/soap/tests/schema/test_schema.inc
@@ -0,0 +1,77 @@
+<?php
+$val = null;
+
+function test($input) {
+ global $val;
+ $val = $input;
+}
+
+function test_schema($schema,$type,$param,$style="rpc",$use="encoded", $attributeFormDefault='',$features=0) {
+ global $HTTP_RAW_POST_DATA, $val;
+$wsdl = <<<EOF
+<definitions name="InteropTest"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="http://test-uri/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://test-uri/"
+ >
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test-uri/" $attributeFormDefault>
+ <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+ <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
+ $schema
+ </schema>
+ </types>
+ <message name="testMessage">
+ <part name="testParam" $type/>
+ </message>
+ <portType name="testPortType">
+ <operation name="test">
+ <input message="testMessage"/>
+ </operation>
+ </portType>
+ <binding name="testBinding" type="testPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="test">
+ <soap:operation soapAction="#test" style="$style"/>
+ <input>
+ <soap:body use="$use" namespace="http://test-uri/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ </operation>
+ </binding>
+ <service name="testService">
+ <port name="testPort" binding="tns:testBinding">
+ <soap:address location="test://" />
+ </port>
+ </service>
+</definitions>
+EOF;
+
+ $fname = tempnam ("./", "wsdl");
+ $f = fopen($fname,"w");
+ fwrite($f,$wsdl);
+ fclose($f);
+ ini_set("soap.wsdl_cache_enabled",0);
+ $x = new SoapClient($fname, array("trace"=>1,"exceptions"=>0,"features"=>$features));
+ $y = new SoapServer($fname, array("features"=>$features));
+ $y->addfunction("test");
+ unlink($fname);
+
+ $x->test($param);
+ $xml = xml_parser_create();
+ $req = $x->__getlastrequest();
+ if ($style == "rpc") {
+ $HTTP_RAW_POST_DATA = $req;
+ ob_start();
+ $y->handle($HTTP_RAW_POST_DATA);
+ ob_end_clean();
+ echo $req;
+ var_dump($val);
+ } else {
+ echo $req;
+ }
+}
+?>
diff --git a/ext/soap/tests/server001.phpt b/ext/soap/tests/server001.phpt
new file mode 100644
index 0000000..649e013
--- /dev/null
+++ b/ext/soap/tests/server001.phpt
@@ -0,0 +1,33 @@
+--TEST--
+SOAP Server 1: new/addfunction/handle
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test() {
+ return "Hello World";
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("test");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server002.phpt b/ext/soap/tests/server002.phpt
new file mode 100644
index 0000000..d0a53b8
--- /dev/null
+++ b/ext/soap/tests/server002.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP Server 2: function with parameters and result
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function Add($x,$y) {
+ return $x+$y;
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("Add");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:Add xmlns:ns1="http://testuri.org">
+ <x xsi:type="xsd:int">22</x>
+ <y xsi:type="xsd:int">33</y>
+ </ns1:Add>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:AddResponse><return xsi:type="xsd:int">55</return></ns1:AddResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server003.phpt b/ext/soap/tests/server003.phpt
new file mode 100644
index 0000000..a808c6f
--- /dev/null
+++ b/ext/soap/tests/server003.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP Server 3: all functions
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction(SOAP_FUNCTIONS_ALL);
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:strlen xmlns:ns1="http://testuri.org">
+ <x xsi:type="xsd:string">Hello World</x>
+ </ns1:strlen>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:strlenResponse><return xsi:type="xsd:int">11</return></ns1:strlenResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server004.phpt b/ext/soap/tests/server004.phpt
new file mode 100644
index 0000000..5d98d3f
--- /dev/null
+++ b/ext/soap/tests/server004.phpt
@@ -0,0 +1,40 @@
+--TEST--
+SOAP Server 4: addfunctions
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function Add($x,$y) {
+ return $x+$y;
+}
+function Sub($x,$y) {
+ return $x-$y;
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction(array("Sub","Add"));
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:Add xmlns:ns1="http://testuri.org">
+ <x xsi:type="xsd:int">22</x>
+ <y xsi:type="xsd:int">33</y>
+ </ns1:Add>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:AddResponse><return xsi:type="xsd:int">55</return></ns1:AddResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server005.phpt b/ext/soap/tests/server005.phpt
new file mode 100644
index 0000000..9536771
--- /dev/null
+++ b/ext/soap/tests/server005.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SOAP Server 5: setclass
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class Foo {
+ function test() {
+ return "Hello World";
+ }
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->setclass("Foo");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server006.phpt b/ext/soap/tests/server006.phpt
new file mode 100644
index 0000000..da328eb
--- /dev/null
+++ b/ext/soap/tests/server006.phpt
@@ -0,0 +1,42 @@
+--TEST--
+SOAP Server 6: setclass with constructor
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class Foo {
+ private $str = "";
+
+ function Foo($str) {
+ $this->str = $str . " World";
+ }
+
+ function test() {
+ return $this->str;
+ }
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->setclass("Foo","Hello");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server007.phpt b/ext/soap/tests/server007.phpt
new file mode 100644
index 0000000..676aa56
--- /dev/null
+++ b/ext/soap/tests/server007.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP Server 7: addfunction and getfunctions
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function Add($x,$y) {
+ return $x+$y;
+}
+function Sub($x,$y) {
+ return $x-$y;
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction(array("Sub","Add"));
+var_dump($server->getfunctions());
+echo "ok\n";
+?>
+--EXPECT--
+array(2) {
+ [0]=>
+ string(3) "Sub"
+ [1]=>
+ string(3) "Add"
+}
+ok
diff --git a/ext/soap/tests/server008.phpt b/ext/soap/tests/server008.phpt
new file mode 100644
index 0000000..87fb69d
--- /dev/null
+++ b/ext/soap/tests/server008.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP Server 8: setclass and getfunctions
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class Foo {
+
+ function Foo() {
+ }
+
+ function test() {
+ return $this->str;
+ }
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->setclass("Foo");
+var_dump($server->getfunctions());
+echo "ok\n";
+?>
+--EXPECT--
+array(2) {
+ [0]=>
+ string(3) "Foo"
+ [1]=>
+ string(4) "test"
+}
+ok
diff --git a/ext/soap/tests/server009.phpt b/ext/soap/tests/server009.phpt
new file mode 100644
index 0000000..28d195a
--- /dev/null
+++ b/ext/soap/tests/server009.phpt
@@ -0,0 +1,69 @@
+--TEST--
+SOAP Server 9: setclass and setpersistence(SOAP_PERSISTENCE_SESSION)
+--SKIPIF--
+<?php
+ require_once('skipif.inc');
+ if (!extension_loaded('session')) {
+ die('skip this test needs session extension');
+ }
+?>
+--INI--
+session.auto_start=1
+session.save_handler=files
+--FILE--
+<?php
+class foo {
+ private $sum = 0;
+
+ function Sum($num) {
+ return $this->sum += $num;
+ }
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->setclass("foo");
+$server->setpersistence(SOAP_PERSISTENCE_SESSION);
+
+ob_start();
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:Sum xmlns:ns1="http://testuri.org">
+ <num xsi:type="xsd:int">5</num>
+ </ns1:Sum>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+$server->handle($HTTP_RAW_POST_DATA);
+ob_clean();
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:Sum xmlns:ns1="http://testuri.org">
+ <num xsi:type="xsd:int">3</num>
+ </ns1:Sum>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+$server->handle($HTTP_RAW_POST_DATA);
+ob_end_flush();
+
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:SumResponse><return xsi:type="xsd:int">8</return></ns1:SumResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server010.phpt b/ext/soap/tests/server010.phpt
new file mode 100644
index 0000000..bac16d2
--- /dev/null
+++ b/ext/soap/tests/server010.phpt
@@ -0,0 +1,61 @@
+--TEST--
+SOAP Server 10: setclass and setpersistence(SOAP_PERSISTENCE_REQUEST)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class foo {
+ private $sum = 0;
+
+ function Sum($num) {
+ return $this->sum += $num;
+ }
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->setclass("foo");
+$server->setpersistence(SOAP_PERSISTENCE_REQUEST);
+
+
+ob_start();
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:Sum xmlns:ns1="http://testuri.org">
+ <num xsi:type="xsd:int">5</num>
+ </ns1:Sum>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+$server->handle($HTTP_RAW_POST_DATA);
+ob_clean();
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:Sum xmlns:ns1="http://testuri.org">
+ <num xsi:type="xsd:int">3</num>
+ </ns1:Sum>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+$server->handle($HTTP_RAW_POST_DATA);
+ob_end_flush();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:SumResponse><return xsi:type="xsd:int">3</return></ns1:SumResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server011.phpt b/ext/soap/tests/server011.phpt
new file mode 100644
index 0000000..5b76a81
--- /dev/null
+++ b/ext/soap/tests/server011.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Server 11: bind
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--GET--
+wsdl
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+function Add($x,$y) {
+ return $x+$y;
+}
+
+$server = new soapserver(dirname(__FILE__)."/test.wsdl");
+ob_start();
+$server->handle();
+$wsdl = ob_get_contents();
+ob_end_clean();
+if ($wsdl == file_get_contents(dirname(__FILE__)."/test.wsdl")) {
+ echo "ok\n";
+} else {
+ echo "fail\n";
+}
+?>
+--EXPECT--
+ok
diff --git a/ext/soap/tests/server012.phpt b/ext/soap/tests/server012.phpt
new file mode 100644
index 0000000..9a41de9
--- /dev/null
+++ b/ext/soap/tests/server012.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Server 12: WSDL generation
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--GET--
+WSDL
+--FILE--
+<?php
+function Add($x,$y) {
+ return $x+$y;
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("Add");
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>WSDL generation is not supported yet</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/server013.phpt b/ext/soap/tests/server013.phpt
new file mode 100644
index 0000000..68c4801
--- /dev/null
+++ b/ext/soap/tests/server013.phpt
@@ -0,0 +1,44 @@
+--TEST--
+SOAP Server 13: array handling
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function Sum($a) {
+ $sum = 0;
+ if (is_array($a)) {
+ foreach($a as $val) {
+ $sum += $val;
+ }
+ }
+ return $sum;
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("Sum");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <SOAP-ENV:Body xmlns:ns1="http://linuxsrv.home/~dmitry/soap/">
+ <ns1:sum>
+ <param0 SOAP-ENC:arrayType="xsd:int[2]" xsi:type="SOAP-ENC:Array">
+ <val xsi:type="xsd:int">3</val>
+ <val xsi:type="xsd:int">5</val>
+ </param0>
+ </ns1:sum>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:sumResponse><return xsi:type="xsd:int">8</return></ns1:sumResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server014.phpt b/ext/soap/tests/server014.phpt
new file mode 100644
index 0000000..fcb62a5
--- /dev/null
+++ b/ext/soap/tests/server014.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP Server 14: fault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function Add($x,$y) {
+ undefined_function_x();
+ return $x+$y;
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("Add");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:Add xmlns:ns1="http://testuri.org">
+ <x xsi:type="xsd:int">22</x>
+ <y xsi:type="xsd:int">33</y>
+ </ns1:Add>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Call to undefined function undefined_function_x()</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/server015.phpt b/ext/soap/tests/server015.phpt
new file mode 100644
index 0000000..ea538e8
--- /dev/null
+++ b/ext/soap/tests/server015.phpt
@@ -0,0 +1,33 @@
+--TEST--
+SOAP Server 15: passing request to handle()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test() {
+ return "Hello World";
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("test");
+
+$envelope = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+$server->handle($envelope);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server016.phpt b/ext/soap/tests/server016.phpt
new file mode 100644
index 0000000..8934f46
--- /dev/null
+++ b/ext/soap/tests/server016.phpt
@@ -0,0 +1,34 @@
+--TEST--
+SOAP Server 16: user fault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test() {
+ global $server;
+ $server->fault("MyFault","My fault string");
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("test");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org"/>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>MyFault</faultcode><faultstring>My fault string</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/server017.phpt b/ext/soap/tests/server017.phpt
new file mode 100644
index 0000000..3ff0acb
--- /dev/null
+++ b/ext/soap/tests/server017.phpt
@@ -0,0 +1,34 @@
+--TEST--
+SOAP Server 17: user fault (through return)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test() {
+ return new SoapFault("MyFault","My fault string");
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("test");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org"/>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>MyFault</faultcode><faultstring>My fault string</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server018.phpt b/ext/soap/tests/server018.phpt
new file mode 100644
index 0000000..b033ed9
--- /dev/null
+++ b/ext/soap/tests/server018.phpt
@@ -0,0 +1,34 @@
+--TEST--
+SOAP Server 18: user fault (through throw)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test() {
+ throw new SoapFault("MyFault","My fault string");
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("test");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org"/>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>MyFault</faultcode><faultstring>My fault string</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server019.phpt b/ext/soap/tests/server019.phpt
new file mode 100644
index 0000000..d36cff0
--- /dev/null
+++ b/ext/soap/tests/server019.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SOAP Server 19: compressed request (gzip)
+--SKIPIF--
+<?php
+ if (php_sapi_name()=='cli') echo 'skip';
+ require_once('skipif.inc');
+ if (!extension_loaded('zlib')) die('skip zlib extension not available');
+?>
+--INI--
+precision=14
+--GZIP_POST--
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+--FILE--
+<?php
+function test() {
+ return "Hello World";
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("test");
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server020.phpt b/ext/soap/tests/server020.phpt
new file mode 100644
index 0000000..b14978f
--- /dev/null
+++ b/ext/soap/tests/server020.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP Server 20: compressed request (deflate)
+--SKIPIF--
+<?php
+ if (php_sapi_name()=='cli') echo 'skip';
+ require_once('skipif.inc');
+ if (!extension_loaded('zlib')) die('skip zlib extension not available');
+?>
+--INI--
+precision=14
+--DEFLATE_POST--
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+--FILE--
+<?php
+function test() {
+ return "Hello World";
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("test");
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server021.phpt b/ext/soap/tests/server021.phpt
new file mode 100644
index 0000000..245c464
--- /dev/null
+++ b/ext/soap/tests/server021.phpt
@@ -0,0 +1,40 @@
+--TEST--
+SOAP Server 21: SoapServer::setClass and __call()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class Foo {
+ function __call($name, $args) {
+ if ($name == "test") {
+ return "Hello World";
+ } else {
+ return new SoapFault("Server","Function $name doesn't exist");
+ }
+ }
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->setclass("Foo");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server022.phpt b/ext/soap/tests/server022.phpt
new file mode 100644
index 0000000..ff79a15
--- /dev/null
+++ b/ext/soap/tests/server022.phpt
@@ -0,0 +1,41 @@
+--TEST--
+SOAP Server 22: user fault (through throw of subclass)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class MyFault extends SoapFault {
+ function __construct() {
+ parent::__construct("MyFault","My fault string");
+ }
+}
+
+
+function test() {
+ throw new MyFault;
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("test");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org"/>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>MyFault</faultcode><faultstring>My fault string</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server023.phpt b/ext/soap/tests/server023.phpt
new file mode 100644
index 0000000..5614599
--- /dev/null
+++ b/ext/soap/tests/server023.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP Server 23: Send SOAP headers those were not received
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test() {
+ global $server;
+ $server->addSoapHeader(new SoapHeader("http://testuri.org", "Test1", "Hello Header!"));
+ $server->addSoapHeader(new SoapHeader("http://testuri.org", "Test2", "Hello Header!"));
+ return "Hello Body!";
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("test");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org"/>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:Test1>Hello Header!</ns1:Test1><ns1:Test2>Hello Header!</ns1:Test2></SOAP-ENV:Header><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello Body!</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server024.phpt b/ext/soap/tests/server024.phpt
new file mode 100644
index 0000000..7db3062
--- /dev/null
+++ b/ext/soap/tests/server024.phpt
@@ -0,0 +1,49 @@
+--TEST--
+SOAP Server 24: Send SOAP headers those were not received
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class TestHeader1 extends SoapHeader {
+ function __construct($data) {
+ parent::__construct("http://testuri.org", "Test1", $data);
+ }
+}
+
+class TestHeader2 extends SoapHeader {
+ function __construct($data) {
+ parent::__construct("http://testuri.org", "Test2", $data);
+ }
+}
+
+function test() {
+ global $server;
+ $server->addSoapHeader(new TestHeader1("Hello Header!"));
+ $server->addSoapHeader(new TestHeader2("Hello Header!"));
+ return "Hello Body!";
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("test");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org"/>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:Test1>Hello Header!</ns1:Test1><ns1:Test2>Hello Header!</ns1:Test2></SOAP-ENV:Header><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello Body!</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server025.phpt b/ext/soap/tests/server025.phpt
new file mode 100644
index 0000000..ed56750
--- /dev/null
+++ b/ext/soap/tests/server025.phpt
@@ -0,0 +1,48 @@
+--TEST--
+SOAP Server 25: One-way SOAP headers encoding using WSDL
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class TestHeader1 extends SoapHeader {
+ function __construct($data) {
+ parent::__construct("http://testuri.org", "Test1", $data);
+ }
+}
+
+class TestHeader2 extends SoapHeader {
+ function __construct($data) {
+ parent::__construct("http://testuri.org", "Test2", $data);
+ }
+}
+
+function test() {
+ global $server;
+ $server->addSoapHeader(new TestHeader1("Hello Header!"));
+ $server->addSoapHeader(new TestHeader2("Hello Header!"));
+ return "Hello Body!";
+}
+
+$server = new soapserver(dirname(__FILE__)."/server025.wsdl");
+$server->addfunction("test");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org"/>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://testuri.org"><SOAP-ENV:Header><ns1:Test1 xsi:type="xsd:string">Hello Header!</ns1:Test1><ns1:Test2 xsi:type="xsd:string">Hello Header!</ns1:Test2></SOAP-ENV:Header><SOAP-ENV:Body><ns1:testResponse><result>Hello Body!</result></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server025.wsdl b/ext/soap/tests/server025.wsdl
new file mode 100755
index 0000000..2870f4e
--- /dev/null
+++ b/ext/soap/tests/server025.wsdl
@@ -0,0 +1,55 @@
+<?xml version="1.0" ?>
+<definitions
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:si="http://soapinterop.org/xsd"
+ xmlns:tns="http://linuxsrv.home/~dmitry/soap/test.wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://testuri.org">
+
+ <message name="TestHeader1">
+ <part name="Test1" type="xsd:string" />
+ </message>
+ <message name="TestHeader2">
+ <part name="Test2" type="xsd:string" />
+ </message>
+
+ <message name="TestRequest">
+ </message>
+ <message name="TestResponse">
+ <part name="result" type="xsd:string" />
+ </message>
+
+ <portType name="TestServicePortType">
+ <operation name="test">
+ <input message="tns:TestRequest" />
+ <output message="tns:TestResponse" />
+ </operation>
+ </portType>
+
+ <binding name="TestServiceBinding" type="tns:TestServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="test">
+ <soap:operation soapAction="Test" style="rpc" />
+ <input>
+ <soap:body namespace="http://testuri.org" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </input>
+ <output>
+ <soap:body namespace="http://testuri.org" use="literal" />
+ <soap:header namespace="http://testuri.org" message="tns:TestHeader1" part="Test1" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ <soap:header namespace="http://testuri.org" message="tns:TestHeader2" part="Test2" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="TestService">
+ <port name="TestServicePort" binding="tns:TestServiceBinding">
+ <soap:address location="http://linuxsrv.home/~dmitry/soap/soap_server.php" />
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/server026.phpt b/ext/soap/tests/server026.phpt
new file mode 100644
index 0000000..720ade8
--- /dev/null
+++ b/ext/soap/tests/server026.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP Server 26: setObject
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class Foo {
+ function test() {
+ return "Hello World";
+ }
+}
+
+$foo = new Foo();
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->setObject($foo);
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server027.phpt b/ext/soap/tests/server027.phpt
new file mode 100644
index 0000000..9fee4a6
--- /dev/null
+++ b/ext/soap/tests/server027.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Server 27: setObject and getFunctions
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class Foo {
+
+ function Foo() {
+ }
+
+ function test() {
+ return $this->str;
+ }
+}
+
+$foo = new Foo();
+$server = new SoapServer(null,array('uri'=>"http://testuri.org"));
+$server->setObject($foo);
+var_dump($server->getfunctions());
+echo "ok\n";
+?>
+--EXPECT--
+array(2) {
+ [0]=>
+ string(3) "Foo"
+ [1]=>
+ string(4) "test"
+}
+ok
diff --git a/ext/soap/tests/server028.phpt b/ext/soap/tests/server028.phpt
new file mode 100644
index 0000000..4bea8eb
--- /dev/null
+++ b/ext/soap/tests/server028.phpt
@@ -0,0 +1,41 @@
+--TEST--
+SOAP Server 28: SoapServer::setObject and __call()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class Foo {
+ function __call($name, $args) {
+ if ($name == "test") {
+ return "Hello World";
+ } else {
+ return SoapFault("Server","Function $name doesn't exist");
+ }
+ }
+}
+
+$foo = new Foo();
+$server = new SoapServer(null,array('uri'=>"http://testuri.org"));
+$server->setObject($foo);
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server029.phpt b/ext/soap/tests/server029.phpt
new file mode 100644
index 0000000..26db9fd
--- /dev/null
+++ b/ext/soap/tests/server029.phpt
@@ -0,0 +1,55 @@
+--TEST--
+SOAP Server 29-CGI: new/addfunction/handle
+--POST--
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+--SKIPIF--
+<?php
+ if (php_sapi_name()=='cli') echo 'skip';
+ require_once('skipif.inc');
+?>
+--FILE--
+<?php
+
+echo "INPUT: \n";
+echo file_get_contents("php://input") . "\n";
+echo "\n\n-----------\n\n";
+
+function test() {
+ return "Hello World";
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("test");
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+INPUT:
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
+
+-----------
+
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok \ No newline at end of file
diff --git a/ext/soap/tests/server030.phpt b/ext/soap/tests/server030.phpt
new file mode 100644
index 0000000..ed5aad8
--- /dev/null
+++ b/ext/soap/tests/server030.phpt
@@ -0,0 +1,53 @@
+--TEST--
+SOAP Server 30: Handling classes which extend the SPL ArrayObject or ArrayIterator as arrays in wsdl mode
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class ItemArray extends ArrayObject {
+
+}
+
+class Item {
+ public $text;
+}
+
+class handlerClass {
+ public function getItems()
+ {
+ $items = new ItemArray(array());
+
+ for ($i = 0; $i < 10; $i++) {
+ $item = new Item();
+ $item->text = 'text'.$i;
+
+ $items[] = $item;
+ }
+
+ return $items;
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/server030.wsdl");
+$server->setClass('handlerClass');
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
+ <SOAP-ENV:Body>
+ <getItems/>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getItemsResponse><getItemsReturn SOAP-ENC:arrayType="ns1:Item[10]" xsi:type="ns1:ItemArray"><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text0</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text1</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text2</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text3</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text4</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text5</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text6</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text7</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text8</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text9</text></item></getItemsReturn></ns1:getItemsResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server030.wsdl b/ext/soap/tests/server030.wsdl
new file mode 100644
index 0000000..2139c78
--- /dev/null
+++ b/ext/soap/tests/server030.wsdl
@@ -0,0 +1,59 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<definitions
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:si="http://soapinterop.org/xsd"
+ xmlns:tns="http://testuri.org"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://testuri.org">
+
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://testuri.org">
+ <xsd:complexType name="ItemArray">
+ <xsd:complexContent>
+ <xsd:extension base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:Item[]"/>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="Item">
+ <xsd:sequence>
+ <xsd:element name="text" type="string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </types>
+
+ <message name="getItems"/>
+ <message name="getItemsResponse">
+ <part name="getItemsReturn" type="tns:ItemArray"/>
+ </message>
+
+ <portType name="TestServicePortType">
+ <operation name="getItems">
+ <input message="tns:getItems"/>
+ <output message="tns:getItemsResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="TestServiceBinding" type="tns:TestServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="getItems">
+ <soap:operation soapAction="http://testuri.orgTestServiceAction"/>
+ <input/>
+ <output>
+ <soap:body namespace="http://testuri.org" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="TestServiceService">
+ <port name="TestServicePort" binding="tns:TestServiceBinding">
+ <soap:address location="http://linuxsrv.home/~dmitry/soap/soap_server.php"/>
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/server031.phpt b/ext/soap/tests/server031.phpt
new file mode 100644
index 0000000..2327579
--- /dev/null
+++ b/ext/soap/tests/server031.phpt
@@ -0,0 +1,69 @@
+--TEST--
+SOAP Server 31: Handling classes which implements Iterator
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class ItemArray implements Iterator {
+ private $a = array();
+
+ public function __construct(array $a) {
+ $this->a = $a;
+ }
+
+ public function rewind() { return reset($this->a); }
+ public function current() { return current($this->a); }
+ public function key() { return key($this->a); }
+ public function next() { return next($this->a); }
+ public function valid() { return (current($this->a) !== false); }
+}
+
+class Item {
+ public $text;
+
+ public function __construct($n) {
+ $this->text = 'text'.$n;
+ }
+}
+
+class handlerClass {
+ public function getItems()
+ {
+ return new ItemArray(array(
+ new Item(0),
+ new Item(1),
+ new Item(2),
+ new Item(3),
+ new Item(4),
+ new Item(5),
+ new Item(6),
+ new Item(7),
+ new Item(8),
+ new Item(9)
+ ));
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/server030.wsdl");
+$server->setClass('handlerClass');
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
+ <SOAP-ENV:Body>
+ <getItems/>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getItemsResponse><getItemsReturn SOAP-ENC:arrayType="ns1:Item[10]" xsi:type="ns1:ItemArray"><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text0</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text1</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text2</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text3</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text4</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text5</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text6</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text7</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text8</text></item><item xsi:type="ns1:Item"><text xsi:type="xsd:string">text9</text></item></getItemsReturn></ns1:getItemsResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/setheaders.phpt b/ext/soap/tests/setheaders.phpt
new file mode 100644
index 0000000..cb90d37
--- /dev/null
+++ b/ext/soap/tests/setheaders.phpt
@@ -0,0 +1,38 @@
+--TEST--
+SOAP: SoapClient::__setHeaders
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL, array("location"=>"test://","uri"=>"test://",
+ "exceptions"=>0,"trace"=>1));
+$client->test();
+echo $client->__getLastRequest();
+$client->__setSoapHeaders(new SoapHeader("test://","HDR1"));
+$client->test();
+echo $client->__getLastRequest();
+$client->test();
+echo $client->__getLastRequest();
+$client->__setSoapHeaders();
+$client->test();
+echo $client->__getLastRequest();
+$client->__setSoapHeaders(array(new SoapHeader("test://","HDR1"),new SoapHeader("test://","HDR2")));
+$client->test();
+echo $client->__getLastRequest();
+$h = array(new SoapHeader("test://","HDR0"));
+$client->__soapCall("test", array(), null, $h);
+echo $client->__getLastRequest();
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:HDR1/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:HDR1/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:HDR1/><ns1:HDR2/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:HDR0/><ns1:HDR1/><ns1:HDR2/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/skipif.inc b/ext/soap/tests/skipif.inc
new file mode 100644
index 0000000..fa8574e
--- /dev/null
+++ b/ext/soap/tests/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/soap12/T01.phpt b/ext/soap/tests/soap12/T01.phpt
new file mode 100644
index 0000000..d584812
--- /dev/null
+++ b/ext/soap/tests/soap12/T01.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T01 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/next">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseOk>foo</ns1:responseOk></env:Header><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T02.phpt b/ext/soap/tests/soap12/T02.phpt
new file mode 100644
index 0000000..db2c260
--- /dev/null
+++ b/ext/soap/tests/soap12/T02.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T02 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://example.org/ts-tests/C">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseOk>foo</ns1:responseOk></env:Header><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T03.phpt b/ext/soap/tests/soap12/T03.phpt
new file mode 100644
index 0000000..19c29dd
--- /dev/null
+++ b/ext/soap/tests/soap12/T03.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP 1.2: T03 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseOk>foo</ns1:responseOk></env:Header><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T04.phpt b/ext/soap/tests/soap12/T04.phpt
new file mode 100644
index 0000000..7445cae
--- /dev/null
+++ b/ext/soap/tests/soap12/T04.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T04 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseOk>foo</ns1:responseOk></env:Header><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T05.phpt b/ext/soap/tests/soap12/T05.phpt
new file mode 100644
index 0000000..187eb2e
--- /dev/null
+++ b/ext/soap/tests/soap12/T05.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T05 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://example.org/ts-tests/B">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T10.phpt b/ext/soap/tests/soap12/T10.phpt
new file mode 100644
index 0000000..54186f6
--- /dev/null
+++ b/ext/soap/tests/soap12/T10.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T10 unknownHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver">foo</test:Unknown>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T11.phpt b/ext/soap/tests/soap12/T11.phpt
new file mode 100644
index 0000000..3423d54
--- /dev/null
+++ b/ext/soap/tests/soap12/T11.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP 1.2: T11 unknownHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
+ env:mustUnderstand="false">foo</test:Unknown>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T12.phpt b/ext/soap/tests/soap12/T12.phpt
new file mode 100644
index 0000000..c67917f
--- /dev/null
+++ b/ext/soap/tests/soap12/T12.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T12 unknownHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
+ env:mustUnderstand="1">foo</test:Unknown>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:MustUnderstand</env:Value></env:Code><env:Reason><env:Text>Header not understood</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T13.phpt b/ext/soap/tests/soap12/T13.phpt
new file mode 100644
index 0000000..95e1c8a
--- /dev/null
+++ b/ext/soap/tests/soap12/T13.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T13 unknownHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
+ env:mustUnderstand="true">foo</test:Unknown>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:MustUnderstand</env:Value></env:Code><env:Reason><env:Text>Header not understood</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T14.phpt b/ext/soap/tests/soap12/T14.phpt
new file mode 100644
index 0000000..dbf4e1b
--- /dev/null
+++ b/ext/soap/tests/soap12/T14.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T14 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
+ env:mustUnderstand="wrong">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>mustUnderstand value is not boolean</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T15.phpt b/ext/soap/tests/soap12/T15.phpt
new file mode 100644
index 0000000..546f942
--- /dev/null
+++ b/ext/soap/tests/soap12/T15.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP 1.2: T15 unknownHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://example.org/ts-tests"
+ env:role="http://example.org/ts-tests/B"
+ env:mustUnderstand="1">foo</test:Unknown>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T19.phpt b/ext/soap/tests/soap12/T19.phpt
new file mode 100644
index 0000000..8ddb5b4
--- /dev/null
+++ b/ext/soap/tests/soap12/T19.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP 1.2: T19 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/none"
+ env:mustUnderstand="true">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T22.phpt b/ext/soap/tests/soap12/T22.phpt
new file mode 100644
index 0000000..5844550
--- /dev/null
+++ b/ext/soap/tests/soap12/T22.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP 1.2: T22 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:mustUnderstand = "1">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ <test:echoOk xmlns:test="http://example.org/ts-tests">foo</test:echoOk>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseOk>foo</ns1:responseOk></env:Header><env:Body><ns1:responseOk>foo</ns1:responseOk></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T23.phpt b/ext/soap/tests/soap12/T23.phpt
new file mode 100644
index 0000000..c676fb1
--- /dev/null
+++ b/ext/soap/tests/soap12/T23.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP 1.2: T23 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://example.org/ts-tests"
+ env:mustUnderstand="1">foo</test:Unknown>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:mustUnderstand="wrong">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>mustUnderstand value is not boolean</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T24.phpt b/ext/soap/tests/soap12/T24.phpt
new file mode 100644
index 0000000..ebee3b7
--- /dev/null
+++ b/ext/soap/tests/soap12/T24.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP 1.2: T24 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://wrong-version/">
+ <env:Body>
+ <test:echoOk xmlns:test="http://example.org/ts-tests">
+ foo
+ </test:echoOk>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:VersionMismatch</env:Value></env:Code><env:Reason><env:Text>Wrong Version</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T25.phpt b/ext/soap/tests/soap12/T25.phpt
new file mode 100644
index 0000000..ac45e9c
--- /dev/null
+++ b/ext/soap/tests/soap12/T25.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP 1.2: T25 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<!DOCTYPE env:Envelope SYSTEM "env.dtd"[]>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Body>
+ <test:echoOk xmlns:test="http://example.org/ts-tests">
+ foo
+ </test:echoOk>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>DTD are not supported by SOAP</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T26.phpt b/ext/soap/tests/soap12/T26.phpt
new file mode 100644
index 0000000..53c8cec
--- /dev/null
+++ b/ext/soap/tests/soap12/T26.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP 1.2: T26 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+<?xml-stylesheet href="http://example.org/ts-tests/sub.xsl" type = "text/xsl"?>
+ <env:Body>
+ <test:echoOk xmlns:test="http://example.org/ts-tests">foo</test:echoOk>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Body><ns1:responseOk>foo</ns1:responseOk></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T27.phpt b/ext/soap/tests/soap12/T27.phpt
new file mode 100644
index 0000000..6371113
--- /dev/null
+++ b/ext/soap/tests/soap12/T27.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP 1.2: T27 echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <env:Body>
+ <test:echoStringArray xmlns:test="http://example.org/ts-tests"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <test:array enc:itemType="xs:string" enc:arraySize="1">
+ <a>
+ <b>1</b>
+ </a>
+ </test:array>
+ </test:echoStringArray>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>SOAP-ERROR: Encoding: Violation of encoding rules</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
+
diff --git a/ext/soap/tests/soap12/T28.phpt b/ext/soap/tests/soap12/T28.phpt
new file mode 100644
index 0000000..6118b47
--- /dev/null
+++ b/ext/soap/tests/soap12/T28.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP 1.2: T28 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Body env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <test:echoOk xmlns:test="http://example.org/ts-tests" >
+ foo
+ </test:echoOk>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>encodingStyle cannot be specified on the Body</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
+
diff --git a/ext/soap/tests/soap12/T29.phpt b/ext/soap/tests/soap12/T29.phpt
new file mode 100644
index 0000000..3784da4
--- /dev/null
+++ b/ext/soap/tests/soap12/T29.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T29 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://example.org/ts-tests/Czzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T30.phpt b/ext/soap/tests/soap12/T30.phpt
new file mode 100644
index 0000000..c2e008e
--- /dev/null
+++ b/ext/soap/tests/soap12/T30.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP 1.2: T30 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
+ <env:Body>
+ <test:echoOk xmlns:test="http://example.org/ts-tests">foo</test:echoOk>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://example.org/ts-tests"><SOAP-ENV:Body><ns1:responseOk>foo</ns1:responseOk></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T31.phpt b/ext/soap/tests/soap12/T31.phpt
new file mode 100644
index 0000000..04f0353
--- /dev/null
+++ b/ext/soap/tests/soap12/T31.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP 1.2: T31 returnVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Body>
+ <test:returnVoid xmlns:test="http://example.org/ts-tests">
+ </test:returnVoid>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body><ns1:returnVoidResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></env:Body></env:Envelope>
+ok
+
diff --git a/ext/soap/tests/soap12/T32.phpt b/ext/soap/tests/soap12/T32.phpt
new file mode 100644
index 0000000..8f77873
--- /dev/null
+++ b/ext/soap/tests/soap12/T32.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP 1.2: T32 echoHeader
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:requiredHeader xmlns:test="http://example.org/ts-tests"
+ env:mustUnderstand="true">foo</test:requiredHeader>
+ </env:Header>
+ <env:Body>
+ <test:echoHeader xmlns:test="http://example.org/ts-tests">
+ </test:echoHeader>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Body><ns1:echoHeaderResponse>foo</ns1:echoHeaderResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T33.phpt b/ext/soap/tests/soap12/T33.phpt
new file mode 100644
index 0000000..00ded87
--- /dev/null
+++ b/ext/soap/tests/soap12/T33.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP 1.2: T33 nonexistentMethod
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Body>
+ <test:DoesNotExist xmlns:test="http://example.org/ts-tests">
+ </test:DoesNotExist>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>rpc:ProcedureNotPresent</env:Value></env:Code><env:Reason><env:Text>Procedure not present</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T34.phpt b/ext/soap/tests/soap12/T34.phpt
new file mode 100644
index 0000000..39e0095
--- /dev/null
+++ b/ext/soap/tests/soap12/T34.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP 1.2: T34 unknownHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://example.org/ts-tests"
+ xmlns:env1="http://schemas.xmlsoap.org/soap/envelope/"
+ env1:mustUnderstand="true">foo</test:Unknown>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T35.phpt b/ext/soap/tests/soap12/T35.phpt
new file mode 100644
index 0000000..a736010
--- /dev/null
+++ b/ext/soap/tests/soap12/T35.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP 1.2: T35 unknownHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://example.org/ts-tests"
+ env:mustUnderstand="1">
+ foo
+ </test:Unknown>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:MustUnderstand</env:Value></env:Code><env:Reason><env:Text>Header not understood</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T36.phpt b/ext/soap/tests/soap12/T36.phpt
new file mode 100644
index 0000000..d625813
--- /dev/null
+++ b/ext/soap/tests/soap12/T36.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T36 unknownHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://example.org/ts-tests"
+ env:mustUnderstand="1"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver">foo</test:Unknown>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:MustUnderstand</env:Value></env:Code><env:Reason><env:Text>Header not understood</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T37.phpt b/ext/soap/tests/soap12/T37.phpt
new file mode 100644
index 0000000..cdce8a4
--- /dev/null
+++ b/ext/soap/tests/soap12/T37.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T37 unknownHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver">foo</test:Unknown>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T38_1.phpt b/ext/soap/tests/soap12/T38_1.phpt
new file mode 100644
index 0000000..30007e5
--- /dev/null
+++ b/ext/soap/tests/soap12/T38_1.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP 1.2: T38.1 doubleHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://example.org/ts-tests"
+ env:mustUnderstand="false"
+ env:role="http://example.org/ts-tests/C">foo</test:Unknown>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:mustUnderstand="0"
+ env:role="http://example.org/ts-tests/C">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseOk>foo</ns1:responseOk></env:Header><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T38_2.phpt b/ext/soap/tests/soap12/T38_2.phpt
new file mode 100644
index 0000000..efff2f4
--- /dev/null
+++ b/ext/soap/tests/soap12/T38_2.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP 1.2: T38.2 doubleHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:mustUnderstand="true"
+ env:role="http://example.org/ts-tests/C">foo</test:echoOk>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:mustUnderstand="1"
+ env:role="http://example.org/ts-tests/C">bar</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseOk>foo</ns1:responseOk><ns1:responseOk>bar</ns1:responseOk></env:Header><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T39.phpt b/ext/soap/tests/soap12/T39.phpt
new file mode 100644
index 0000000..2b29562
--- /dev/null
+++ b/ext/soap/tests/soap12/T39.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP 1.2: T39 unknownHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://example.org/ts-tests"
+ env:mustUnderstand="9">foo</test:Unknown>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>mustUnderstand value is not boolean</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T40.phpt b/ext/soap/tests/soap12/T40.phpt
new file mode 100644
index 0000000..27b4a21
--- /dev/null
+++ b/ext/soap/tests/soap12/T40.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP 1.2: T40 echoOK
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:Unknown xmlns:test="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
+ env:mustUnderstand="false">
+ foo
+ </test:Unknown>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body/></env:Envelope>
+ok \ No newline at end of file
diff --git a/ext/soap/tests/soap12/T41.phpt b/ext/soap/tests/soap12/T41.phpt
new file mode 100644
index 0000000..f874adc
--- /dev/null
+++ b/ext/soap/tests/soap12/T41.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP 1.2: T41 echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoStruct xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputStruct xsi:type="ns1:SOAPStruct"
+ xmlns:ns1="http://example.org/ts-tests/xsd">
+ <varInt xsi:type="xsd:int">42</varInt>
+ <varFloat xsi:type="xsd:float">0.005</varFloat>
+ <varString xsi:type="xsd:string">hello world</varString>
+ </inputStruct>
+ </test:echoStruct>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStructResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat></return></ns1:echoStructResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T42.phpt b/ext/soap/tests/soap12/T42.phpt
new file mode 100644
index 0000000..e45d42b
--- /dev/null
+++ b/ext/soap/tests/soap12/T42.phpt
@@ -0,0 +1,41 @@
+--TEST--
+SOAP 1.2: T42 echoStructArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoStructArray xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputStructArray enc:itemType="ns1:SOAPStruct"
+ enc:arraySize="2"
+ xmlns:ns1="http://example.org/ts-tests/xsd"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <item xsi:type="ns1:SOAPStruct">
+ <varInt xsi:type="xsd:int">42</varInt>
+ <varFloat xsi:type="xsd:float">0.005</varFloat>
+ <varString xsi:type="xsd:string">hello world</varString>
+ </item>
+ <item xsi:type="ns1:SOAPStruct">
+ <varInt xsi:type="xsd:int">43</varInt>
+ <varFloat xsi:type="xsd:float">0.123</varFloat>
+ <varString xsi:type="xsd:string">bye world</varString>
+ </item>
+ </inputStructArray>
+ </test:echoStructArray>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStructArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="ns2:SOAPStruct" enc:arraySize="2" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">bye world</varString><varInt xsi:type="xsd:int">43</varInt><varFloat xsi:type="xsd:float">0.123</varFloat></item></return></ns1:echoStructArrayResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T43.phpt b/ext/soap/tests/soap12/T43.phpt
new file mode 100644
index 0000000..7dd6316
--- /dev/null
+++ b/ext/soap/tests/soap12/T43.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP 1.2: T43 echoStructAsSimpleTypes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoStructAsSimpleTypes xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputStruct xsi:type="ns1:SOAPStruct"
+ xmlns:ns1="http://example.org/ts-tests/xsd">
+ <varInt xsi:type="xsd:int">42</varInt>
+ <varFloat xsi:type="xsd:float">0.005</varFloat>
+ <varString xsi:type="xsd:string">hello world</varString>
+ </inputStruct>
+ </test:echoStructAsSimpleTypes>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body><ns1:echoStructAsSimpleTypesResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><outputString xsi:type="xsd:string">hello world</outputString><outputInteger xsi:type="xsd:int">42</outputInteger><outputFloat xsi:type="xsd:float">0.005</outputFloat></ns1:echoStructAsSimpleTypesResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T44.phpt b/ext/soap/tests/soap12/T44.phpt
new file mode 100644
index 0000000..3e307c1
--- /dev/null
+++ b/ext/soap/tests/soap12/T44.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP 1.2: T44 echoSimpleTypesAsStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoSimpleTypesAsStruct xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputInt xsi:type="xsd:int">42</inputInt>
+ <inputFloat xsi:type="xsd:float">0.005</inputFloat>
+ <inputString xsi:type="xsd:string">hello world</inputString>
+ </test:echoSimpleTypesAsStruct>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoSimpleTypesAsStructResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat></return></ns1:echoSimpleTypesAsStructResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T45.phpt b/ext/soap/tests/soap12/T45.phpt
new file mode 100644
index 0000000..24db941
--- /dev/null
+++ b/ext/soap/tests/soap12/T45.phpt
@@ -0,0 +1,35 @@
+--TEST--
+SOAP 1.2: T45 echoNestedStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoNestedStruct xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputStruct xsi:type="ns1:SOAPStructStruct"
+ xmlns:ns1="http://example.org/ts-tests/xsd">
+ <varInt xsi:type="xsd:int">42</varInt>
+ <varFloat xsi:type="xsd:float">0.005</varFloat>
+ <varString xsi:type="xsd:string">hello world</varString>
+ <varStruct xsi:type="ns1:SOAPStruct">
+ <varInt xsi:type="xsd:int">99</varInt>
+ <varFloat xsi:type="xsd:float">5.5</varFloat>
+ <varString xsi:type="xsd:string">nested struct</varString>
+ </varStruct>
+ </inputStruct>
+ </test:echoNestedStruct>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoNestedStructResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">nested struct</varString><varInt xsi:type="xsd:int">99</varInt><varFloat xsi:type="xsd:float">5.5</varFloat></varStruct></return></ns1:echoNestedStructResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T46.phpt b/ext/soap/tests/soap12/T46.phpt
new file mode 100644
index 0000000..8098ef7
--- /dev/null
+++ b/ext/soap/tests/soap12/T46.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SOAP 1.2: T46 echoNestedArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoNestedArray xmlns:test="http://exaple.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputStruct xsi:type="ns1:SOAPArrayStruct"
+ xmlns:ns1="http://example.org/ts-tests/xsd">
+ <varInt xsi:type="xsd:int">42</varInt>
+ <varFloat xsi:type="xsd:float">0.005</varFloat>
+ <varString xsi:type="xsd:string">hello world</varString>
+ <varArray enc:itemType="xsd:string" enc:arraySize="3"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <item xsi:type="xsd:string">red</item>
+ <item xsi:type="xsd:string">blue</item>
+ <item xsi:type="xsd:string">green</item>
+ </varArray>
+ </inputStruct>
+ </test:echoNestedArray>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:ns2="http://example.org/ts-tests/xsd"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoNestedArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat><varArray enc:itemType="xsd:string" enc:arraySize="3" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></return></ns1:echoNestedArrayResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T47.phpt b/ext/soap/tests/soap12/T47.phpt
new file mode 100644
index 0000000..a449d20
--- /dev/null
+++ b/ext/soap/tests/soap12/T47.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP 1.2: T47 echoFloatArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+precision=14
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoFloatArray xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputFloatArray enc:itemType="xsd:float" enc:arraySize="2"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <item xsi:type="xsd:float">5.5</item>
+ <item xsi:type="xsd:float">12999.9</item>
+ </inputFloatArray>
+ </test:echoFloatArray>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoFloatArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="xsd:float" enc:arraySize="2" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">5.5</item><item xsi:type="xsd:float">12999.9</item></return></ns1:echoFloatArrayResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T48.phpt b/ext/soap/tests/soap12/T48.phpt
new file mode 100644
index 0000000..f7cf0fe
--- /dev/null
+++ b/ext/soap/tests/soap12/T48.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP 1.2: T48 echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoStringArray xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputStringArray enc:itemType="xsd:string" enc:arraySize="2"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <item xsi:type="xsd:string">hello</item>
+ <item xsi:type="xsd:string">world</item>
+ </inputStringArray>
+ </test:echoStringArray>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStringArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="xsd:string" enc:arraySize="2" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">hello</item><item xsi:type="xsd:string">world</item></return></ns1:echoStringArrayResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T49.phpt b/ext/soap/tests/soap12/T49.phpt
new file mode 100644
index 0000000..9687d03
--- /dev/null
+++ b/ext/soap/tests/soap12/T49.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP 1.2: T49 echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoStringArray xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputStringArray enc:arraySize="2"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <item xsi:type="xsd:string">hello</item>
+ <item xsi:type="xsd:string">world</item>
+ </inputStringArray>
+ </test:echoStringArray>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStringArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="xsd:string" enc:arraySize="2" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">hello</item><item xsi:type="xsd:string">world</item></return></ns1:echoStringArrayResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T50.phpt b/ext/soap/tests/soap12/T50.phpt
new file mode 100644
index 0000000..e3fcc0c
--- /dev/null
+++ b/ext/soap/tests/soap12/T50.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP 1.2: T50 echoIntegerArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoIntegerArray xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputIntegerArray enc:itemType="xsd:int" enc:arraySize="2"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <item xsi:type="xsd:int">100</item>
+ <item xsi:type="xsd:int">200</item>
+ </inputIntegerArray>
+ </test:echoIntegerArray>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoIntegerArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="xsd:int" enc:arraySize="2" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">100</item><item xsi:type="xsd:int">200</item></return></ns1:echoIntegerArrayResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T51.phpt b/ext/soap/tests/soap12/T51.phpt
new file mode 100644
index 0000000..9776576
--- /dev/null
+++ b/ext/soap/tests/soap12/T51.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP 1.2: T51 echoBase64
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <env:Body>
+ <test:echoBase64 xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputBase64 xsi:type="xsd:base64Binary">
+ YUdWc2JHOGdkMjl5YkdRPQ==
+ </inputBase64>
+ </test:echoBase64>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoBase64Response env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:base64Binary">YUdWc2JHOGdkMjl5YkdRPQ==</return></ns1:echoBase64Response></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T52.phpt b/ext/soap/tests/soap12/T52.phpt
new file mode 100644
index 0000000..9d75fb9
--- /dev/null
+++ b/ext/soap/tests/soap12/T52.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP 1.2: T52 echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoBoolean xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputBoolean xsi:type="xsd:boolean">1</inputBoolean>
+ </test:echoBoolean>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoBooleanResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:boolean">true</return></ns1:echoBooleanResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T53.phpt b/ext/soap/tests/soap12/T53.phpt
new file mode 100644
index 0000000..c1c8fe6
--- /dev/null
+++ b/ext/soap/tests/soap12/T53.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP 1.2: T53 echoDate
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoDate xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputDate xsi:type="xsd:date">1956-10-18T22:20:00-07:00</inputDate>
+ </test:echoDate>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoDateResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:dateTime">1956-10-18T22:20:00-07:00</return></ns1:echoDateResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T54.phpt b/ext/soap/tests/soap12/T54.phpt
new file mode 100644
index 0000000..ba3ed35
--- /dev/null
+++ b/ext/soap/tests/soap12/T54.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP 1.2: T54 echoDecimal
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoDecimal xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputDecimal xsi:type="xsd:decimal">123.45678901234567890</inputDecimal>
+ </test:echoDecimal>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoDecimalResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:decimal">123.45678901234567890</return></ns1:echoDecimalResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T55.phpt b/ext/soap/tests/soap12/T55.phpt
new file mode 100644
index 0000000..1c12e50
--- /dev/null
+++ b/ext/soap/tests/soap12/T55.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP 1.2: T55 echoFloat
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoFloat xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputFloat xsi:type="xsd:float">0.005</inputFloat>
+ </test:echoFloat>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoFloatResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:float">0.005</return></ns1:echoFloatResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T56.phpt b/ext/soap/tests/soap12/T56.phpt
new file mode 100644
index 0000000..ca13427
--- /dev/null
+++ b/ext/soap/tests/soap12/T56.phpt
@@ -0,0 +1,34 @@
+--TEST--
+SOAP 1.2: T56 echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <env:Header>
+ <test:DataHolder xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <test:Data enc:id="data-1" xsi:type="xsd:string">
+ hello world
+ </test:Data>
+ </test:DataHolder>
+ </env:Header>
+ <env:Body>
+ <test:echoString xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputString enc:ref="#data-2" xsi:type="xsd:string" />
+ </test:echoString>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>SOAP-ERROR: Encoding: Unresolved reference '#data-2'</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
+
diff --git a/ext/soap/tests/soap12/T57.phpt b/ext/soap/tests/soap12/T57.phpt
new file mode 100644
index 0000000..ad3e9ef
--- /dev/null
+++ b/ext/soap/tests/soap12/T57.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP 1.2: T57 echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <env:Header>
+ <test:DataHolder xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <test:Data enc:id="data" xsi:type="xsd:string">hello world</test:Data>
+ </test:DataHolder>
+ </env:Header>
+ <env:Body>
+ <test:echoString xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <test:inputString enc:ref="#data" xsi:type="xsd:string" />
+ </test:echoString>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStringResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:string">hello world</return></ns1:echoStringResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T58.phpt b/ext/soap/tests/soap12/T58.phpt
new file mode 100644
index 0000000..1c3e8ba
--- /dev/null
+++ b/ext/soap/tests/soap12/T58.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP 1.2: T58 echoIntegerArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoIntegerArray xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputIntegerArray enc:itemType="xsd:int" enc:arraySize="1"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <a><b>1</b></a>
+ </inputIntegerArray>
+ </test:echoIntegerArray>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>SOAP-ERROR: Encoding: Violation of encoding rules</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
+
diff --git a/ext/soap/tests/soap12/T59.phpt b/ext/soap/tests/soap12/T59.phpt
new file mode 100644
index 0000000..2ceef32
--- /dev/null
+++ b/ext/soap/tests/soap12/T59.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP 1.2: T59 echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoStringArray xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputStringArray enc:itemType="xsd:string"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <item enc:id="data" xsi:type="xsd:string" enc:ref="#data">hello</item>
+ <item>world</item>
+ </inputStringArray>
+ </test:echoStringArray>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>SOAP-ERROR: Encoding: Violation of id and ref information items '#data'</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T60.phpt b/ext/soap/tests/soap12/T60.phpt
new file mode 100644
index 0000000..234ef4c
--- /dev/null
+++ b/ext/soap/tests/soap12/T60.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP 1.2: T60 countItems
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:countItems xmlns:test="http://example.org/ts-tests"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputStringArray enc:itemType="xsd:string" enc:arraySize="*">
+ <item xsi:type="xsd:string">hello</item>
+ <item xsi:type="xsd:string">world</item>
+ </inputStringArray>
+ </test:countItems>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:countItemsResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:int">2</return></ns1:countItemsResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T61.phpt b/ext/soap/tests/soap12/T61.phpt
new file mode 100644
index 0000000..b688a79
--- /dev/null
+++ b/ext/soap/tests/soap12/T61.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP 1.2: T61 countItems
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:countItems xmlns:test="http://example.org/ts-tests"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputStringArray enc:itemType="xsd:string" enc:arraySize="2 *">
+ <item xsi:type="xsd:string">hello</item>
+ <item xsi:type="xsd:string">world</item>
+ </inputStringArray>
+ </test:countItems>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>SOAP-ERROR: Encoding: '*' may only be first arraySize value in list</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T63.phpt b/ext/soap/tests/soap12/T63.phpt
new file mode 100644
index 0000000..5a41ef0
--- /dev/null
+++ b/ext/soap/tests/soap12/T63.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP 1.2: T63 validateCountryCode
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:validateCountryCode xmlns:test="http://example.org/ts-tests"
+ env:role="http://example.org/ts-tests/C"
+ env:mustUnderstand="1">ABCD</test:validateCountryCode>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:validateCountryCodeFault>Country code must be 2 letters.</ns1:validateCountryCodeFault></env:Header><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>Not a valid country code</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T64.phpt b/ext/soap/tests/soap12/T64.phpt
new file mode 100644
index 0000000..24e62ec
--- /dev/null
+++ b/ext/soap/tests/soap12/T64.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP 1.2: T64 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<!DOCTYPE DOC [
+<!NOTATION application_xml SYSTEM 'http://www.isi.edu/in-notes/iana/assignments/media-types/application/xml'>
+]>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Body>
+ <test:echoOk xmlns:test="http://example.org/ts-tests">
+ foo
+ </test:echoOk>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>DTD are not supported by SOAP</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T65.phpt b/ext/soap/tests/soap12/T65.phpt
new file mode 100644
index 0000000..cd96d4a
--- /dev/null
+++ b/ext/soap/tests/soap12/T65.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP 1.2: T65 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<!DOCTYPE DOC [
+<!ELEMENT Envelope (Body) >
+<!ELEMENT Body (echoOk) >
+<!ELEMENT echoOk (#PCDATA) >
+]>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Body>
+ <test:echoOk xmlns:test="http://example.org/ts-tests">
+ foo
+ </test:echoOk>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>DTD are not supported by SOAP</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T66.phpt b/ext/soap/tests/soap12/T66.phpt
new file mode 100644
index 0000000..cc7cc2e
--- /dev/null
+++ b/ext/soap/tests/soap12/T66.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T66 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' encoding='UTF8'?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/next">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseOk>foo</ns1:responseOk></env:Header><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T67.phpt b/ext/soap/tests/soap12/T67.phpt
new file mode 100644
index 0000000..ddc527a
--- /dev/null
+++ b/ext/soap/tests/soap12/T67.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T67 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' standalone='yes'?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/next">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseOk>foo</ns1:responseOk></env:Header><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T68.phpt b/ext/soap/tests/soap12/T68.phpt
new file mode 100644
index 0000000..a791519
--- /dev/null
+++ b/ext/soap/tests/soap12/T68.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP 1.2: T68 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+
+
+ <env:Header >
+
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/next" >foo</test:echoOk>
+
+
+ </env:Header>
+ <env:Body>
+
+
+ </env:Body>
+
+
+
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseOk>foo</ns1:responseOk></env:Header><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T69.phpt b/ext/soap/tests/soap12/T69.phpt
new file mode 100644
index 0000000..0fb02de
--- /dev/null
+++ b/ext/soap/tests/soap12/T69.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP 1.2: T69 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests">foo</test:echoOk>
+ </env:Header>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>Body must be present in a SOAP envelope</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T70.phpt b/ext/soap/tests/soap12/T70.phpt
new file mode 100644
index 0000000..3622c32
--- /dev/null
+++ b/ext/soap/tests/soap12/T70.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T70 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+ <Trailer>
+ </Trailer>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>A SOAP 1.2 envelope can contain only Header and Body</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T71.phpt b/ext/soap/tests/soap12/T71.phpt
new file mode 100644
index 0000000..fdb5b8d
--- /dev/null
+++ b/ext/soap/tests/soap12/T71.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP 1.2: T71 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ attr1="a-value">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests">
+ foo
+ </test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>A SOAP Envelope element cannot have non Namespace qualified attributes</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T72.phpt b/ext/soap/tests/soap12/T72.phpt
new file mode 100644
index 0000000..b8f5060
--- /dev/null
+++ b/ext/soap/tests/soap12/T72.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP 1.2: T72 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <env:Body>
+ <test:echoOk xmlns:test="http://example.org/ts-tests">
+ foo
+ </test:echoOk>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>encodingStyle cannot be specified on the Envelope</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/T73.phpt b/ext/soap/tests/soap12/T73.phpt
new file mode 100644
index 0000000..9143e58
--- /dev/null
+++ b/ext/soap/tests/soap12/T73.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP 1.2: T73 echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoString xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <test:inputString xsi:type="xsd:string"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">hello world</test:inputString>
+ </test:echoString>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStringResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:string">hello world</return></ns1:echoStringResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T74.phpt b/ext/soap/tests/soap12/T74.phpt
new file mode 100644
index 0000000..703e187
--- /dev/null
+++ b/ext/soap/tests/soap12/T74.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP 1.2: T74 doubleHdr
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/next">foo</test:echoOk>
+ <test:Unknown xmlns:test="http://example.org/ts-tests">
+ <test:raiseFault env:mustUnderstand="1"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/next">
+ </test:raiseFault>
+ </test:Unknown>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseOk>foo</ns1:responseOk></env:Header><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T75.phpt b/ext/soap/tests/soap12/T75.phpt
new file mode 100644
index 0000000..3e2166d
--- /dev/null
+++ b/ext/soap/tests/soap12/T75.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP 1.2: T75 echoResolvedRef
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoResolvedRef xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
+ env:mustUnderstand="1">
+ <test:RelativeReference xml:base="http://example.org/today/"
+ xlink:href="new.xml"
+ xmlns:xlink="http://www.w3.org/1999/xlink" />
+ </test:echoResolvedRef>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseResolvedRef>http://example.org/today/new.xml</ns1:responseResolvedRef></env:Header><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T76_1.phpt b/ext/soap/tests/soap12/T76_1.phpt
new file mode 100644
index 0000000..e97c179
--- /dev/null
+++ b/ext/soap/tests/soap12/T76_1.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP 1.2: T76.1 echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:echoString xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputString xsi:type="xsd:string">hello world</inputString>
+ </test:echoString>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStringResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:string">hello world</return></ns1:echoStringResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T76_2.phpt b/ext/soap/tests/soap12/T76_2.phpt
new file mode 100644
index 0000000..cc6ea0d
--- /dev/null
+++ b/ext/soap/tests/soap12/T76_2.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP 1.2: T76.2 echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
+ <env:Header>
+ <test:DataHolder xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <test:Data enc:id="data" xsi:type="xsd:string">hello world</test:Data>
+ </test:DataHolder>
+ </env:Header>
+ <env:Body>
+ <test:echoString xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputString enc:ref="data" xsi:type="xsd:string" />
+ </test:echoString>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStringResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:string">hello world</return></ns1:echoStringResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T77_1.phpt b/ext/soap/tests/soap12/T77_1.phpt
new file mode 100644
index 0000000..d847b6c
--- /dev/null
+++ b/ext/soap/tests/soap12/T77_1.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP 1.2: T77.1 isNil
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:isNil xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputString xsi:nil="1" />
+ </test:isNil>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:isNilResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:boolean">true</return></ns1:isNilResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T77_2.phpt b/ext/soap/tests/soap12/T77_2.phpt
new file mode 100644
index 0000000..c829b57
--- /dev/null
+++ b/ext/soap/tests/soap12/T77_2.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP 1.2: T77.2 isNil
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:isNil xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ </test:isNil>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:isNilResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:boolean">true</return></ns1:isNilResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T77_3.phpt b/ext/soap/tests/soap12/T77_3.phpt
new file mode 100644
index 0000000..0e1355a
--- /dev/null
+++ b/ext/soap/tests/soap12/T77_3.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP 1.2: T77.3 isNul
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <test:isNil xmlns:test="http://example.org/ts-tests"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputString xsi:type="xsd:string">
+ This is a string
+ </inputString>
+ </test:isNil>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:isNilResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:boolean">false</return></ns1:isNilResponse></env:Body></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T78.phpt b/ext/soap/tests/soap12/T78.phpt
new file mode 100644
index 0000000..63d13c7
--- /dev/null
+++ b/ext/soap/tests/soap12/T78.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP 1.2: T78 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver">foo</test:echoOk>
+ </env:Header>
+ <env:Body>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:responseOk>foo</ns1:responseOk></env:Header><env:Body/></env:Envelope>
+ok
diff --git a/ext/soap/tests/soap12/T80.phpt b/ext/soap/tests/soap12/T80.phpt
new file mode 100644
index 0000000..1ac114b
--- /dev/null
+++ b/ext/soap/tests/soap12/T80.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP 1.2: T80 echoOk
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Body>
+ <test:echoOk xmlns:test="http://example.org/ts-tests" env:encodingStyle="http://example.org/PoisonEncoding">foo</test:echoOk>
+ </env:Body>
+</env:Envelope>
+EOF;
+include "soap12-test.inc";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:DataEncodingUnknown</env:Value></env:Code><env:Reason><env:Text>Unknown Data Encoding Style</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/soap12/skipif.inc b/ext/soap/tests/soap12/skipif.inc
new file mode 100644
index 0000000..fa8574e
--- /dev/null
+++ b/ext/soap/tests/soap12/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/soap12/soap12-test.inc b/ext/soap/tests/soap12/soap12-test.inc
new file mode 100644
index 0000000..fbdc855
--- /dev/null
+++ b/ext/soap/tests/soap12/soap12-test.inc
@@ -0,0 +1,131 @@
+<?php
+class Soap12test {
+ public $header;
+
+ function echoOk($x) {
+ return $x;
+ }
+
+ function echoString($inputString) {
+ return $inputString;
+ }
+
+ function echoStringArray($inputStringArray) {
+ return $inputStringArray;
+ }
+
+ function echoInteger($inputInteger) {
+ return $inputInteger;
+ }
+
+ function echoIntegerArray($inputIntegerArray) {
+ return $inputIntegerArray;
+ }
+
+ function echoFloat($inputFloat) {
+ return $inputFloat;
+ }
+
+ function echoFloatArray($inputFloatArray) {
+ return $inputFloatArray;
+ }
+
+ function echoStruct($x) {
+ return $x;
+ }
+
+ function echoStructArray($x) {
+ return $x;
+ }
+
+ function echoVoid() {
+ return NULL;
+ }
+
+ function echoBase64($b_encoded) {
+ return $b_encoded;
+ }
+
+ function echoDate($timeInstant) {
+ return $timeInstant;
+ }
+
+ function echoHexBinary($hb) {
+ return $hb;
+ }
+
+ function echoDecimal($dec) {
+ return $dec;
+ }
+
+ function echoBoolean($boolean) {
+ return $boolean;
+ }
+
+ function echoStructAsSimpleTypes ($struct) {
+ return array('outputString' => $struct->varString,
+ 'outputInteger' => $struct->varInt,
+ 'outputFloat' => $struct->varFloat);
+ }
+
+ function echoSimpleTypesAsStruct($string, $int, $float) {
+ return (object)array("varString" => $string,
+ "varInt" => $int,
+ "varFloat" => $float);
+ }
+
+ function echoNestedStruct($struct) {
+ return $struct;
+ }
+
+ function echo2DStringArray($ary) {
+ return $ary;
+ }
+
+ function echoNestedArray($ary) {
+ return $ary;
+ }
+
+ function countItems($input) {
+ return count($input);
+ }
+
+ function isNil($input) {
+ return is_null($input);
+ }
+
+ function returnVoid() {
+ }
+
+ function emptyBody() {
+ }
+
+ function requiredHeader($x) {
+ $this->header = $x;
+ }
+
+ function echoHeader() {
+ return $this->header;
+ }
+
+ function echoResolvedRef($ref) {
+ return $ref->RelativeReference->base.$ref->RelativeReference->href;
+ }
+
+ function validateCountryCode($code) {
+ if (strlen($code) != 2) {
+ return new SoapFault("Client", "Not a valid country code", NULL, NULL, NULL, new SoapHeader("http://example.org/ts-tests", "validateCountryCodeFault", "Country code must be 2 letters."));
+ } else {
+ return "OK";
+ }
+ }
+
+}
+
+ini_set("soap.wsdl_cache_enabled",0);
+$server = new soapserver(dirname(__FILE__)."/soap12-test.wsdl", array('soap_version'=>SOAP_1_2,'actor'=>"http://example.org/ts-tests/C"));
+$server->setClass("Soap12test");
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
diff --git a/ext/soap/tests/soap12/soap12-test.wsdl b/ext/soap/tests/soap12/soap12-test.wsdl
new file mode 100644
index 0000000..d1679b4
--- /dev/null
+++ b/ext/soap/tests/soap12/soap12-test.wsdl
@@ -0,0 +1,771 @@
+<?xml version="1.0"?>
+
+<definitions name="SOAP-12-TestDefinitions"
+ targetNamespace="http://whitemesa.net/wsdl/soap12-test"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:enc="http://www.w3.org/2003/05/soap-encoding"
+ xmlns:tns="http://whitemesa.net/wsdl/soap12-test"
+ xmlns:types="http://example.org/ts-tests/xsd"
+ xmlns:test="http://example.org/ts-tests"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:enc11="http://schemas.xmlsoap.org/soap/encoding/">
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.org/ts-tests/xsd">
+
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+
+ <complexType name="ArrayOfstring">
+ <complexContent>
+ <restriction base="enc11:Array">
+ <attribute ref="enc11:arrayType" wsdl:arrayType="xsd:string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ArrayOfint">
+ <complexContent>
+ <restriction base="enc11:Array">
+ <attribute ref="enc11:arrayType" wsdl:arrayType="xsd:int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ArrayOffloat">
+ <complexContent>
+ <restriction base="enc11:Array">
+ <attribute ref="enc11:arrayType" wsdl:arrayType="xsd:float[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ArrayOfSOAPStruct">
+ <complexContent>
+ <restriction base="enc11:Array">
+ <attribute ref="enc11:arrayType" wsdl:arrayType="types:SOAPStruct[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ </all>
+ </complexType>
+ <complexType name="SOAPStructStruct">
+ <all>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ <element name="varStruct" type="types:SOAPStruct"/>
+ </all>
+ </complexType>
+
+ <complexType name="SOAPArrayStruct">
+ <all>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ <element name="varArray" type="types:ArrayOfstring"/>
+ </all>
+ </complexType>
+
+ <!-- unknown header block type -->
+ <complexType name="UnknownType">
+ <sequence>
+ <element minOccurs="0" maxOccurs="1" name="stringValue" type="xsd:string" />
+ </sequence>
+ </complexType>
+
+ </schema>
+
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="http://example.org/ts-tests">
+
+ <import namespace="http://www.w3.org/1999/xlink" />
+ <import namespace="http://example.org/ts-tests/xsd" />
+
+ <!-- 3.2.1 echoOk -->
+ <element name="echoOk" type="xsd:string"/>
+
+ <!-- 3.2.2 responseOk -->
+ <element name="responseOk" type="xsd:string"/>
+
+ <!-- 3.2.3 Ignore -->
+ <element name="Ignore" type="xsd:string"/>
+
+ <!-- 3.2.4 requiredHeader -->
+ <element name="requiredHeader" type="xsd:string"/>
+
+ <element name="echoHeader" type="xsd:string"/>
+ <element name="echoHeaderResponse" type="xsd:string"/>
+
+ <!-- 3.2.5 DataHolder -->
+ <element name="DataHolder" type="test:DataHolder_t"/>
+ <complexType name="DataHolder_t">
+ <sequence>
+ <element name="Data" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <!-- 3.2.6 concatAndForwardEchoOk -->
+ <element name="concatAndForwardEchoOk"/>
+
+ <!-- 3.2.7 concatAndForwardEchoOkArg1 -->
+ <element name="concatAndForwardEchoOkArg1" type="xsd:string"/>
+
+ <!-- 3.2.8 concatAndForwardEchoOkArg2 -->
+ <element name="concatAndForwardEchoOkArg2" type="xsd:string"/>
+
+ <!-- 3.2.9 validateCountryCode -->
+ <element name="validateCountryCode" type="xsd:string"/>
+
+ <element name="validateCountryCodeResponse" type="xsd:string"/>
+
+ <!-- 3.2.10 validateCountryCodeFault -->
+ <element name="validateCountryCodeFault" type="xsd:string"/>
+
+ <!-- 3.2.11 echoResolvedRef -->
+ <element name="RelativeReference" type="test:RelativeReference_t"/>
+ <complexType name="RelativeReference_t">
+ <attribute ref="xml:base"/>
+ <attribute ref="xlink:href"/>
+ </complexType>
+
+ <element name="echoResolvedRef" type="test:echoResolvedRef_t"/>
+ <complexType name="echoResolvedRef_t">
+ <sequence>
+ <element ref="test:RelativeReference" minOccurs="1" maxOccurs="1"/>
+ </sequence>
+ </complexType>
+
+ <!-- 3.2.12 responseResolvedRef -->
+ <element name="responseResolvedRef" type="xsd:string"/>
+
+ <!-- echoOkUltimateReceiver added to support testing of "relay" -->
+ <element name="echoOkUltimateReceiver" type="xsd:string"/>
+
+ <!-- responseOkUltimateReceiver added to support testing of "relay" -->
+ <element name="responseOkUltimateReceiver" type="xsd:string"/>
+
+ <element name="Unknown" type="types:UnknownType" />
+
+ </schema>
+
+ </types>
+
+ <!-- 3.4.1 returnVoid rpc operation -->
+ <message name="returnVoidRequest"/>
+ <message name="returnVoidResponse"/>
+
+ <!-- 3.4.2 echoStruct rpc operation -->
+ <message name="echoStructRequest">
+ <part name="inputStruct" type="types:SOAPStruct"/>
+ </message>
+ <message name="echoStructResponse">
+ <part name="return" type="types:SOAPStruct"/>
+ </message>
+
+ <!-- 3.4.3 echoStructArray rpc operation -->
+ <message name="echoStructArrayRequest">
+ <part name="inputStructArray" type="types:ArrayOfSOAPStruct"/>
+ </message>
+ <message name="echoStructArrayResponse">
+ <part name="return" type="types:ArrayOfSOAPStruct"/>
+ </message>
+
+ <!-- 3.4.4 echoStructAsSimpleTypes rpc operation -->
+ <message name="echoStructAsSimpleTypesRequest">
+ <part name="inputStruct" type="types:SOAPStruct"/>
+ </message>
+ <message name="echoStructAsSimpleTypesResponse">
+ <part name="outputString" type="xsd:string"/>
+ <part name="outputInteger" type="xsd:int"/>
+ <part name="outputFloat" type="xsd:float"/>
+ </message>
+
+ <!-- 3.4.5 echoSimpleTypesAsStruct rpc operation -->
+ <message name="echoSimpleTypesAsStructRequest">
+ <part name="inputString" type="xsd:string"/>
+ <part name="inputInt" type="xsd:int"/>
+ <part name="inputFloat" type="xsd:float"/>
+ </message>
+ <message name="echoSimpleTypesAsStructResponse">
+ <part name="return" type="types:SOAPStruct"/>
+ </message>
+
+ <!-- 3.4.6 echoNestedStruct rpc operation -->
+ <message name="echoNestedStructRequest">
+ <part name="inputStruct" type="types:SOAPStructStruct"/>
+ </message>
+ <message name="echoNestedStructResponse">
+ <part name="return" type="types:SOAPStructStruct"/>
+ </message>
+
+ <!-- 3.4.7 echoNestedArray rpc operation -->
+ <message name="echoNestedArrayRequest">
+ <part name="inputStruct" type="types:SOAPArrayStruct"/>
+ </message>
+ <message name="echoNestedArrayResponse">
+ <part name="return" type="types:SOAPArrayStruct"/>
+ </message>
+
+ <!-- 3.4.8 echoFloatArray rpc operation -->
+ <message name="echoFloatArrayRequest">
+ <part name="inputFloatArray" type="types:ArrayOffloat"/>
+ </message>
+ <message name="echoFloatArrayResponse">
+ <part name="return" type="types:ArrayOffloat"/>
+ </message>
+
+ <!-- 3.4.9 echoStringArray rpc operation -->
+ <message name="echoStringArrayRequest">
+ <part name="inputStringArray" type="types:ArrayOfstring"/>
+ </message>
+ <message name="echoStringArrayResponse">
+ <part name="return" type="types:ArrayOfstring"/>
+ </message>
+
+ <!-- 3.4.10 echoIntegerArray rpc operation -->
+ <message name="echoIntegerArrayRequest">
+ <part name="inputIntegerArray" type="types:ArrayOfint"/>
+ </message>
+ <message name="echoIntegerArrayResponse">
+ <part name="return" type="types:ArrayOfint"/>
+ </message>
+
+ <!-- 3.4.11 echoBase64 rpc operation -->
+ <message name="echoBase64Request">
+ <part name="inputBase64" type="xsd:base64Binary"/>
+ </message>
+ <message name="echoBase64Response">
+ <part name="return" type="xsd:base64Binary"/>
+ </message>
+
+ <!-- 3.4.12 echoBoolean rpc operation -->
+ <message name="echoBooleanRequest">
+ <part name="inputBoolean" type="xsd:boolean"/>
+ </message>
+ <message name="echoBooleanResponse">
+ <part name="return" type="xsd:boolean"/>
+ </message>
+
+ <!-- 3.4.13 echoDate rpc operation -->
+ <message name="echoDateRequest">
+ <part name="inputDate" type="xsd:dateTime"/>
+ </message>
+ <message name="echoDateResponse">
+ <part name="return" type="xsd:dateTime"/>
+ </message>
+
+ <!-- 3.4.14 echoDecimal rpc operation -->
+ <message name="echoDecimalRequest">
+ <part name="inputDecimal" type="xsd:decimal"/>
+ </message>
+ <message name="echoDecimalResponse">
+ <part name="return" type="xsd:decimal"/>
+ </message>
+
+ <!-- 3.4.15 echoFloat rpc operation -->
+ <message name="echoFloatRequest">
+ <part name="inputFloat" type="xsd:float"/>
+ </message>
+ <message name="echoFloatResponse">
+ <part name="return" type="xsd:float"/>
+ </message>
+
+ <!-- 3.4.16 echoString rpc operation -->
+ <message name="echoStringRequest">
+ <part name="inputString" type="xsd:string"/>
+ </message>
+ <message name="echoStringResponse">
+ <part name="return" type="xsd:string"/>
+ </message>
+
+ <!-- 3.4.17 countItems rpc operation -->
+ <message name="countItemsRequest">
+ <part name="inputStringArray" type="types:ArrayOfstring"/>
+ </message>
+ <message name="countItemsResponse">
+ <part name="return" type="xsd:int"/>
+ </message>
+
+ <!-- 3.4.18 isNil rpc operation -->
+ <message name="isNilRequest">
+ <part name="inputString" type="xsd:string"/>
+ </message>
+ <message name="isNilResponse">
+ <part name="return" type="xsd:boolean"/>
+ </message>
+
+ <!-- DataHolder header block -->
+ <message name="DataHolderRequest">
+ <part name="DataHolder" type="test:DataHolder_t"/>
+ </message>
+ <message name="DataHolderResponse">
+ <part name="DataHolder" type="test:DataHolder_t"/>
+ </message>
+
+ <!-- empty message for doc/literal testing -->
+ <message name="emptyBodyRequest"/>
+ <message name="emptyBodyResponse"/>
+
+ <!-- echoOk body/header block -->
+ <message name="echoOkRequest">
+ <part name="echoOk" element="test:echoOk"/>
+ </message>
+ <message name="echoOkResponse">
+ <part name="responseOk" element="test:responseOk"/>
+ </message>
+
+ <message name="requiredHeaderRequest">
+ <part name="requiredHeader" element="test:requiredHeader"/>
+ </message>
+ <message name="echoHeaderRequest">
+ <part name="responseHeader" element="test:echoHeader"/>
+ </message>
+ <message name="echoHeaderResponse">
+ <part name="responseHeader" element="test:echoHeaderResponse"/>
+ </message>
+
+ <message name="echoResolvedRefRequest">
+ <part name="responseHeader" element="test:echoResolvedRef"/>
+ </message>
+ <message name="echoResolvedRefResponse">
+ <part name="responseHeader" element="test:responseResolvedRef"/>
+ </message>
+
+ <!-- "unknown" header block -->
+ <message name="UnknownHdrBlockLit">
+ <part name="Unknown" element="test:Unknown" />
+ </message>
+ <message name="UnknownHdrBlockEnc">
+ <part name="Unknown" type="types:UnknownType" />
+ </message>
+
+ <message name="validateCountryCodeRequest">
+ <part name="validateCountryCode" element="test:validateCountryCode" />
+ </message>
+ <message name="validateCountryCodeFault">
+ <part name="validateCountryCodeFault" element="test:validateCountryCodeFault" />
+ </message>
+ <message name="validateCountryCodeResponse">
+ <part name="validateCountryCodeResponse" element="test:validateCountryCodeResponse" />
+ </message>
+
+
+ <portType name="Soap12TestPortTypeDoc">
+ <operation name="emptyBody">
+ <input message="tns:emptyBodyRequest" />
+ <output message="tns:emptyBodyResponse" />
+ </operation>
+ <operation name="echoOk">
+ <input message="tns:echoOkRequest" />
+ <output message="tns:echoOkResponse" />
+ </operation>
+ <operation name="requiredHeader">
+ <input message="tns:requiredHeaderRequest" />
+ </operation>
+ <operation name="echoHeader">
+ <input message="tns:echoHeaderRequest" />
+ <output message="tns:echoHeaderResponse" />
+ </operation>
+ <operation name="echoResolvedRef">
+ <input message="tns:echoResolvedRefRequest" />
+ <output message="tns:echoResolvedRefResponse" />
+ </operation>
+ </portType>
+
+ <portType name="Soap12TestPortTypeRpc">
+
+ <!-- 3.4.1 returnVoid rpc operation -->
+ <operation name="returnVoid">
+ <input message="tns:returnVoidRequest"/>
+ <output message="tns:returnVoidResponse"/>
+ </operation>
+
+ <!-- 3.4.2 echoStruct rpc operation -->
+ <operation name="echoStruct" parameterOrder="inputStruct">
+ <input message="tns:echoStructRequest"/>
+ <output message="tns:echoStructResponse"/>
+ </operation>
+
+ <!-- 3.4.3 echoStructArray rpc operation -->
+ <operation name="echoStructArray" parameterOrder="inputStructArray">
+ <input message="tns:echoStructArrayRequest"/>
+ <output message="tns:echoStructArrayResponse"/>
+ </operation>
+
+ <!-- 3.4.4 echoStructAsSimpleTypes rpc operation -->
+ <operation name="echoStructAsSimpleTypes" parameterOrder="inputStruct outputString outputInteger outputFloat">
+ <input message="tns:echoStructAsSimpleTypesRequest"/>
+ <output message="tns:echoStructAsSimpleTypesResponse"/>
+ </operation>
+
+ <!-- 3.4.5 echoSimpleTypesAsStruct rpc operation -->
+ <operation name="echoSimpleTypesAsStruct" parameterOrder="inputString inputInteger inputFloat">
+ <input message="tns:echoSimpleTypesAsStructRequest"/>
+ <output message="tns:echoSimpleTypesAsStructResponse"/>
+ </operation>
+
+ <!-- 3.4.6 echoNestedStruct rpc operation -->
+ <operation name="echoNestedStruct" parameterOrder="inputStruct">
+ <input message="tns:echoNestedStructRequest"/>
+ <output message="tns:echoNestedStructResponse"/>
+ </operation>
+
+ <!-- 3.4.7 echoNestedArray rpc operation -->
+ <operation name="echoNestedArray" parameterOrder="inputStruct">
+ <input message="tns:echoNestedArrayRequest"/>
+ <output message="tns:echoNestedArrayResponse"/>
+ </operation>
+
+ <!-- 3.4.8 echoFloatArray rpc operation -->
+ <operation name="echoFloatArray" parameterOrder="inputFloatArray">
+ <input message="tns:echoFloatArrayRequest"/>
+ <output message="tns:echoFloatArrayResponse"/>
+ </operation>
+
+ <!-- 3.4.9 echoStringArray rpc operation -->
+ <operation name="echoStringArray" parameterOrder="inputStringArray">
+ <input message="tns:echoStringArrayRequest"/>
+ <output message="tns:echoStringArrayResponse"/>
+ </operation>
+
+ <!-- 3.4.10 echoIntegerArray rpc operation -->
+ <operation name="echoIntegerArray" parameterOrder="inputIntegerArray">
+ <input message="tns:echoIntegerArrayRequest"/>
+ <output message="tns:echoIntegerArrayResponse"/>
+ </operation>
+
+ <!-- 3.4.11 echoBase64 rpc operation -->
+ <operation name="echoBase64" parameterOrder="inputBase64">
+ <input message="tns:echoBase64Request"/>
+ <output message="tns:echoBase64Response"/>
+ </operation>
+
+ <!-- 3.4.12 echoBoolean rpc operation -->
+ <operation name="echoBoolean" parameterOrder="inputBoolean">
+ <input message="tns:echoBooleanRequest"/>
+ <output message="tns:echoBooleanResponse"/>
+ </operation>
+
+ <!-- 3.4.13 echoDate rpc operation -->
+ <operation name="echoDate" parameterOrder="inputDate">
+ <input message="tns:echoDateRequest"/>
+ <output message="tns:echoDateResponse"/>
+ </operation>
+
+ <!-- 3.4.14 echoDecimal rpc operation -->
+ <operation name="echoDecimal" parameterOrder="inputDecimal">
+ <input message="tns:echoDecimalRequest"/>
+ <output message="tns:echoDecimalResponse"/>
+ </operation>
+
+ <!-- 3.4.15 echoFloat rpc operation -->
+ <operation name="echoFloat" parameterOrder="inputFloat">
+ <input message="tns:echoFloatRequest"/>
+ <output message="tns:echoFloatResponse"/>
+ </operation>
+
+ <!-- 3.4.16 echoString rpc operation -->
+ <operation name="echoString" parameterOrder="inputString">
+ <input message="tns:echoStringRequest"/>
+ <output message="tns:echoStringResponse"/>
+ </operation>
+
+ <!-- 3.4.17 countItems rpc operation -->
+ <operation name="countItems" parameterOrder="inputStringArray">
+ <input message="tns:countItemsRequest"/>
+ <output message="tns:countItemsResponse"/>
+ </operation>
+
+ <!-- 3.4.18 isNil rpc operation -->
+ <operation name="isNil" parameterOrder="inputString">
+ <input message="tns:isNilRequest"/>
+ <output message="tns:isNilResponse"/>
+ </operation>
+
+ </portType>
+
+ <binding name="Soap12TestDocBinding" type="tns:Soap12TestPortTypeDoc">
+ <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="emptyBody">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" />
+ <soap12:header message="tns:echoOkRequest" part="echoOk" use="literal" />
+ <soap12:header message="tns:UnknownHdrBlockLit" part="Unknown" use="literal" />
+ <soap12:header message="tns:validateCountryCodeRequest" part="validateCountryCode" use="literal">
+ <soap12:headerfault message="tns:validateCountryCodeFault" part="validateCountryCodeFault" use="literal"/>
+ </soap12:header>
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ <soap12:header message="tns:echoOkResponse" part="responseOk" use="literal" />
+ <soap12:header message="tns:validateCountryCodeResponse" part="validateCountryCodeResponse" use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoOk">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" />
+ <soap12:header message="tns:echoOkRequest" part="echoOk" use="literal" />
+ <soap12:header message="tns:UnknownHdrBlockLit" part="Unknown" use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ <soap12:header message="tns:echoOkResponse" part="responseOk" use="literal" />
+ </output>
+ </operation>
+ <operation name="requiredHeader">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ </operation>
+ <operation name="echoHeader">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" />
+ <soap12:header message="tns:echoOkRequest" part="echoOk" use="literal" />
+ <soap12:header message="tns:UnknownHdrBlockLit" part="Unknown" use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ <soap12:header message="tns:echoOkResponse" part="responseOk" use="literal" />
+ </output>
+ </operation>
+ <operation name="echoResolvedRef">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+
+ <binding name="Soap12TestRpcBinding" type="tns:Soap12TestPortTypeRpc">
+ <soap12:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <!-- 3.4.1 returnVoid rpc operation -->
+ <operation name="returnVoid">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.2 echoStruct rpc operation -->
+ <operation name="echoStruct">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.3 echoStructArray rpc operation -->
+ <operation name="echoStructArray">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.4 echoStructAsSimpleTypes rpc operation -->
+ <operation name="echoStructAsSimpleTypes">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.5 echoSimpleTypesAsStruct rpc operation -->
+ <operation name="echoSimpleTypesAsStruct">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.6 echoNestedStruct rpc operation -->
+ <operation name="echoNestedStruct">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.7 echoNestedArray rpc operation -->
+ <operation name="echoNestedArray">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.8 echoFloatArray rpc operation -->
+ <operation name="echoFloatArray">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.9 echoStringArray rpc operation -->
+ <operation name="echoStringArray">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.10 echoIntegerArray rpc operation -->
+ <operation name="echoIntegerArray">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.11 echoBase64 rpc operation -->
+ <operation name="echoBase64">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.12 echoBoolean rpc operation -->
+ <operation name="echoBoolean">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.13 echoDate rpc operation -->
+ <operation name="echoDate">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.14 echoDecimal rpc operation -->
+ <operation name="echoDecimal">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.15 echoFloat rpc operation -->
+ <operation name="echoFloat">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.16 echoString rpc operation -->
+ <operation name="echoString">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ <soap12:header use="encoded" message="tns:DataHolderRequest" part="DataHolder" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ <soap12:header use="encoded" message="tns:DataHolderResponse" part="DataHolder" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.17 countItems rpc operation -->
+ <operation name="countItems">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ <!-- 3.4.18 isNil rpc operation -->
+ <operation name="isNil">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </input>
+ <output>
+ <soap12:body use="encoded" namespace="http://example.org/ts-tests" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/>
+ </output>
+ </operation>
+
+ </binding>
+
+
+ <service name="WhiteMesaSoap12TestSvc">
+ <port name="Soap12TestDocPort" binding="tns:Soap12TestDocBinding">
+ <soap12:address location="http://localhost/soap12/test-doc"/>
+ </port>
+ <port name="Soap12TestRpcPort" binding="tns:Soap12TestRpcBinding">
+ <soap12:address location="http://localhost/soap12/test-rpc"/>
+ </port>
+
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/test.wsdl b/ext/soap/tests/test.wsdl
new file mode 100644
index 0000000..0740b7d
--- /dev/null
+++ b/ext/soap/tests/test.wsdl
@@ -0,0 +1,55 @@
+<?xml version="1.0" ?>
+<definitions
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:si="http://soapinterop.org/xsd"
+ xmlns:tns="http://linuxsrv.home/~dmitry/soap/test.wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl">
+
+ <types>
+ <xsd:schema targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl">
+ <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+ <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
+ </xsd:schema>
+ </types>
+
+ <message name="AddRequest">
+ <part name="x" type="xsd:double" />
+ <part name="y" type="xsd:double" />
+ </message>
+ <message name="AddResponse">
+ <part name="result" type="xsd:double" />
+ </message>
+
+ <portType name="TestServicePortType">
+ <operation name="Add">
+ <input message="tns:AddRequest" />
+ <output message="tns:AddResponse" />
+ </operation>
+ </portType>
+
+ <binding name="TestServiceBinding" type="tns:TestServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="Add">
+ <soap:operation soapAction="Add" style="rpc" />
+ <input>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </input>
+ <output>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="TestService">
+ <port name="TestServicePort" binding="tns:TestServiceBinding">
+ <soap:address location="http://linuxsrv.home/~dmitry/soap/soap_server.php" />
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/transport001.phpt b/ext/soap/tests/transport001.phpt
new file mode 100644
index 0000000..9ab0d3d
--- /dev/null
+++ b/ext/soap/tests/transport001.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SOAP Transport 1: Local transport using SoapClient::__doRequest
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function Add($x,$y) {
+ return $x+$y;
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('Add');
+ }
+
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$x = new LocalSoapClient(NULL,array('location'=>'test://',
+ 'uri'=>'http://testuri.org'));
+var_dump($x->Add(3,4));
+echo "ok\n";
+?>
+--EXPECT--
+int(7)
+ok
diff --git a/ext/soap/tests/typemap001.phpt b/ext/soap/tests/typemap001.phpt
new file mode 100644
index 0000000..b5ed31d
--- /dev/null
+++ b/ext/soap/tests/typemap001.phpt
@@ -0,0 +1,63 @@
+--TEST--
+SOAP typemap 1: SoapServer support for typemap's from_xml()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php if (!extension_loaded('simplexml')) die("skip simplexml extension not available"); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+ <ns1:dotest>
+ <book xsi:type=\"ns1:book\">
+ <a xsi:type=\"xsd:string\">foo</a>
+ <b xsi:type=\"xsd:string\">bar</b>
+</book>
+</ns1:dotest>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_from_xml($xml) {
+ $sxe = simplexml_load_string($xml);
+ $obj = new book;
+ $obj->a = (string)$sxe->a;
+ $obj->b = (string)$sxe->b;
+ return $obj;
+}
+
+class test{
+ function dotest($book){
+ $classname=get_class($book);
+ return "Object: ".$classname. "(".$book->a.",".$book->b.")";
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "from_xml" => "book_from_xml"))
+ );
+
+$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options);
+$server->setClass("test");
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotestResponse><res xsi:type="xsd:string">Object: book(foo,bar)</res></ns1:dotestResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/typemap002.phpt b/ext/soap/tests/typemap002.phpt
new file mode 100644
index 0000000..ceb00f1
--- /dev/null
+++ b/ext/soap/tests/typemap002.phpt
@@ -0,0 +1,58 @@
+--TEST--
+SOAP typemap 2: SoapServer support for typemap's to_xml()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+<ns1:dotest2>
+<dotest2 xsi:type=\"xsd:string\">???</dotest2>
+</ns1:dotest2>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_to_xml($book) {
+ return '<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><a xsi:type="xsd:string">'.$book->a.'!</a><b xsi:type="xsd:string">'.$book->b.'!</b></book>';
+}
+
+class test{
+ function dotest2($str){
+ $book = new book;
+ $book->a = "foo";
+ $book->b = "bar";
+ return $book;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options);
+$server->setClass("test");
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotest2Response><book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:book"><a xsi:type="xsd:string">foo!</a><b xsi:type="xsd:string">bar!</b></book></ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/typemap003.phpt b/ext/soap/tests/typemap003.phpt
new file mode 100644
index 0000000..63bb76c
--- /dev/null
+++ b/ext/soap/tests/typemap003.phpt
@@ -0,0 +1,57 @@
+--TEST--
+SOAP Typemap 3: SoapClient support for typemap's from_xml()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php if (!extension_loaded('simplexml')) die("skip simplexml extension not available"); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body>
+<ns1:dotest2Response><res xsi:type="ns1:book">
+ <a xsi:type="xsd:string">foo</a>
+ <b xsi:type="xsd:string">bar</b>
+</res>
+</ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+function book_from_xml($xml) {
+ $sxe = simplexml_load_string($xml);
+ $obj = new book;
+ $obj->a = (string)$sxe->a;
+ $obj->b = (string)$sxe->b;
+ return $obj;
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "from_xml" => "book_from_xml"))
+ );
+
+$client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options);
+$ret = $client->dotest2("???");
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECTF--
+object(book)#%d (2) {
+ ["a"]=>
+ string(3) "foo"
+ ["b"]=>
+ string(3) "bar"
+}
+ok
diff --git a/ext/soap/tests/typemap004.phpt b/ext/soap/tests/typemap004.phpt
new file mode 100644
index 0000000..4fe15f7
--- /dev/null
+++ b/ext/soap/tests/typemap004.phpt
@@ -0,0 +1,43 @@
+--TEST--
+SOAP Typemap 4: SoapClient support for typemap's to_xml()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ echo $request;
+ exit;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+function book_to_xml($book) {
+ return '<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><a xsi:type="xsd:string">'.$book->a.'!</a><b xsi:type="xsd:string">'.$book->b.'!</b></book>';
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options);
+$book = new book();
+$book->a = "foo";
+$book->b = "bar";
+$ret = $client->dotest($book);
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotest><book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:book"><a xsi:type="xsd:string">foo!</a><b xsi:type="xsd:string">bar!</b></book></ns1:dotest></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/typemap005.phpt b/ext/soap/tests/typemap005.phpt
new file mode 100644
index 0000000..369d026
--- /dev/null
+++ b/ext/soap/tests/typemap005.phpt
@@ -0,0 +1,64 @@
+--TEST--
+SOAP typemap 5: SoapServer support for typemap's from_xml() (without WSDL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php if (!extension_loaded('simplexml')) die("skip simplexml extension not available"); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+ <ns1:dotest>
+ <book xsi:type=\"ns1:book\">
+ <a xsi:type=\"xsd:string\">foo</a>
+ <b xsi:type=\"xsd:string\">bar</b>
+</book>
+</ns1:dotest>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_from_xml($xml) {
+ $sxe = simplexml_load_string($xml);
+ $obj = new book;
+ $obj->a = (string)$sxe->a;
+ $obj->b = (string)$sxe->b;
+ return $obj;
+}
+
+class test{
+ function dotest($book){
+ $classname=get_class($book);
+ return "Object: ".$classname. "(".$book->a.",".$book->b.")";
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+$options=Array(
+ 'uri' => "http://schemas.nothing.com",
+ 'actor' => 'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "from_xml" => "book_from_xml"))
+ );
+
+$server = new SoapServer(NULL,$options);
+$server->setClass("test");
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotestResponse><return xsi:type="xsd:string">Object: book(foo,bar)</return></ns1:dotestResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/typemap006.phpt b/ext/soap/tests/typemap006.phpt
new file mode 100644
index 0000000..7ecf410
--- /dev/null
+++ b/ext/soap/tests/typemap006.phpt
@@ -0,0 +1,59 @@
+--TEST--
+SOAP typemap 6: SoapServer support for typemap's to_xml() (without WSDL, using SoapVar)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+<ns1:dotest2>
+<dotest2 xsi:type=\"xsd:string\">???</dotest2>
+</ns1:dotest2>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_to_xml($book) {
+ return '<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><a xsi:type="xsd:string">'.$book->a.'!</a><b xsi:type="xsd:string">'.$book->b.'!</b></book>';
+}
+
+class test{
+ function dotest2($str){
+ $book = new book;
+ $book->a = "foo";
+ $book->b = "bar";
+ return new SoapVar($book, null, "book", "http://schemas.nothing.com");
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+$options=Array(
+ 'uri' => "http://schemas.nothing.com",
+ 'actor' => 'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$server = new SoapServer(NULL,$options);
+$server->setClass("test");
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotest2Response><book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:book"><a xsi:type="xsd:string">foo!</a><b xsi:type="xsd:string">bar!</b></book></ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/typemap007.phpt b/ext/soap/tests/typemap007.phpt
new file mode 100644
index 0000000..b3451f1
--- /dev/null
+++ b/ext/soap/tests/typemap007.phpt
@@ -0,0 +1,59 @@
+--TEST--
+SOAP Typemap 7: SoapClient support for typemap's from_xml() (without WSDL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php if (!extension_loaded('simplexml')) die("skip simplexml extension not available"); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body>
+<ns1:dotest2Response><res xsi:type="ns1:book">
+ <a xsi:type="xsd:string">foo</a>
+ <b xsi:type="xsd:string">bar</b>
+</res>
+</ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+function book_from_xml($xml) {
+ $sxe = simplexml_load_string($xml);
+ $obj = new book;
+ $obj->a = (string)$sxe->a;
+ $obj->b = (string)$sxe->b;
+ return $obj;
+}
+
+$options=Array(
+ 'uri' => 'http://schemas.nothing.com',
+ 'location' => 'test://',
+ 'actor' => 'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "from_xml" => "book_from_xml"))
+ );
+
+$client = new TestSoapClient(NULL, $options);
+$ret = $client->dotest2("???");
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECTF--
+object(book)#%d (2) {
+ ["a"]=>
+ string(3) "foo"
+ ["b"]=>
+ string(3) "bar"
+}
+ok
diff --git a/ext/soap/tests/typemap008.phpt b/ext/soap/tests/typemap008.phpt
new file mode 100644
index 0000000..192f6dc
--- /dev/null
+++ b/ext/soap/tests/typemap008.phpt
@@ -0,0 +1,45 @@
+--TEST--
+SOAP Typemap 8: SoapClient support for typemap's to_xml() (without WSDL, using SoapVar)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ echo $request;
+ exit;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+function book_to_xml($book) {
+ return '<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><a xsi:type="xsd:string">'.$book->a.'!</a><b xsi:type="xsd:string">'.$book->b.'!</b></book>';
+}
+
+$options=Array(
+ 'uri' => 'http://schemas.nothing.com',
+ 'location' => 'test://',
+ 'actor' => 'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$client = new TestSoapClient(NULL, $options);
+$book = new book();
+$book->a = "foo";
+$book->b = "bar";
+$ret = $client->dotest(new SoapVar($book, null, "book", "http://schemas.nothing.com"));
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotest><book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:book"><a xsi:type="xsd:string">foo!</a><b xsi:type="xsd:string">bar!</b></book></ns1:dotest></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/typemap009.phpt b/ext/soap/tests/typemap009.phpt
new file mode 100644
index 0000000..ec5c38d
--- /dev/null
+++ b/ext/soap/tests/typemap009.phpt
@@ -0,0 +1,58 @@
+--TEST--
+SOAP typemap 9: SoapServer support for typemap's from_xml() (SoapFault)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+ <ns1:dotest>
+ <book xsi:type=\"ns1:book\">
+ <a xsi:type=\"xsd:string\">foo</a>
+ <b xsi:type=\"xsd:string\">bar</b>
+</book>
+</ns1:dotest>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_from_xml($xml) {
+ throw new SoapFault("Server", "Conversion Failed");
+}
+
+class test{
+ function dotest($book){
+ $classname=get_class($book);
+ return "Object: ".$classname. "(".$book->a.",".$book->b.")";
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "from_xml" => "book_from_xml"))
+ );
+
+$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options);
+$server->setClass("test");
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Conversion Failed</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/typemap010.phpt b/ext/soap/tests/typemap010.phpt
new file mode 100644
index 0000000..4eba634
--- /dev/null
+++ b/ext/soap/tests/typemap010.phpt
@@ -0,0 +1,58 @@
+--TEST--
+SOAP typemap 10: SoapServer support for typemap's to_xml() (SoapFault)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+<ns1:dotest2>
+<dotest2 xsi:type=\"xsd:string\">???</dotest2>
+</ns1:dotest2>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_to_xml($book) {
+ throw new SoapFault("Server", "Conversion Fault");
+}
+
+class test{
+ function dotest2($str){
+ $book = new book;
+ $book->a = "foo";
+ $book->b = "bar";
+ return $book;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options);
+$server->setClass("test");
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Conversion Fault</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/typemap011.phpt b/ext/soap/tests/typemap011.phpt
new file mode 100644
index 0000000..1e2addc
--- /dev/null
+++ b/ext/soap/tests/typemap011.phpt
@@ -0,0 +1,51 @@
+--TEST--
+SOAP Typemap 11: SoapClient support for typemap's from_xml() (SoapFault)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body>
+<ns1:dotest2Response><res xsi:type="ns1:book">
+ <a xsi:type="xsd:string">foo</a>
+ <b xsi:type="xsd:string">bar</b>
+</res>
+</ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+function book_from_xml($xml) {
+ throw new SoapFault("Client", "Conversion Error");
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "from_xml" => "book_from_xml"))
+ );
+
+$client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options);
+try {
+ $ret = $client->dotest2("???");
+} catch (SoapFault $e) {
+ $ret = "SoapFault = " . $e->faultcode . " - " . $e->faultstring;
+}
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECT--
+string(37) "SoapFault = Client - Conversion Error"
+ok
diff --git a/ext/soap/tests/typemap012.phpt b/ext/soap/tests/typemap012.phpt
new file mode 100644
index 0000000..847957a
--- /dev/null
+++ b/ext/soap/tests/typemap012.phpt
@@ -0,0 +1,47 @@
+--TEST--
+SOAP Typemap 12: SoapClient support for typemap's to_xml() (SoapFault)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ echo $request;
+ exit;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+function book_to_xml($book) {
+ throw new SoapFault("Client", "Conversion Error");
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options);
+$book = new book();
+$book->a = "foo";
+$book->b = "bar";
+try {
+ $ret = $client->dotest($book);
+} catch (SoapFault $e) {
+ $ret = "SoapFault = " . $e->faultcode . " - " . $e->faultstring;
+}
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECT--
+string(37) "SoapFault = Client - Conversion Error"
+ok
diff --git a/ext/soap/tests/typemap013.phpt b/ext/soap/tests/typemap013.phpt
new file mode 100644
index 0000000..d873eb4
--- /dev/null
+++ b/ext/soap/tests/typemap013.phpt
@@ -0,0 +1,58 @@
+--TEST--
+SOAP typemap 13: SoapServer support for typemap's to_xml() with default ns
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+<ns1:dotest2>
+<dotest2 xsi:type=\"xsd:string\">???</dotest2>
+</ns1:dotest2>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_to_xml($book) {
+ return '<book xmlns="http://schemas.nothing.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><a xsi:type="xsd:string">'.$book->a.'!</a><b xsi:type="xsd:string">'.$book->b.'!</b></book>';
+}
+
+class test{
+ function dotest2($str){
+ $book = new book;
+ $book->a = "foo";
+ $book->b = "bar";
+ return $book;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options);
+$server->setClass("test");
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotest2Response><book xmlns="http://schemas.nothing.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:book"><a xsi:type="xsd:string">foo!</a><b xsi:type="xsd:string">bar!</b></book></ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok