@@ -18,6 +18,18 @@ function foo() {
18
18
}
19
19
$ s ->addFunction ("foo " );
20
20
21
+ function handleFormatted ($ s , $ input ) {
22
+ ob_start ();
23
+ $ s ->handle ($ input );
24
+ $ response = ob_get_clean ();
25
+
26
+ // libxml2 2.13 has different formatting behaviour: it outputs <faultcode/> instead of <faultcode></faultcode>
27
+ // this normalizes the output to <faultcode/>
28
+ $ response = str_replace ('<faultcode></faultcode> ' , '<faultcode/> ' , $ response );
29
+ $ response = str_replace ('<env:Value></env:Value> ' , '<env:Value/> ' , $ response );
30
+ echo $ response ;
31
+ }
32
+
21
33
// soap 1.1
22
34
$ HTTP_RAW_POST_DATA = <<<EOF
23
35
<?xml version="1.0" encoding="UTF-8"?>
@@ -27,7 +39,7 @@ $HTTP_RAW_POST_DATA = <<<EOF
27
39
</SOAP-ENV:Body>
28
40
</SOAP-ENV:Envelope>
29
41
EOF ;
30
- $ s -> handle ( $ HTTP_RAW_POST_DATA );
42
+ handleFormatted ( $ s , $ HTTP_RAW_POST_DATA );
31
43
32
44
// soap 1.2
33
45
$ HTTP_RAW_POST_DATA = <<<EOF
@@ -38,10 +50,10 @@ $HTTP_RAW_POST_DATA = <<<EOF
38
50
</env:Body>
39
51
</env:Envelope>
40
52
EOF ;
41
- $ s -> handle ( $ HTTP_RAW_POST_DATA );
53
+ handleFormatted ( $ s , $ HTTP_RAW_POST_DATA );
42
54
?>
43
55
--EXPECT--
44
56
<? xml version="1.0 " encoding="UTF -8 "?>
45
- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode></faultcode ><faultstring>some msg</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
57
+ <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode/ ><faultstring>some msg</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
46
58
<? xml version="1.0 " encoding="UTF -8 "?>
47
- <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value></env:Value ></env:Code><env:Reason><env:Text>some msg</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
59
+ <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value/ ></env:Code><env:Reason><env:Text>some msg</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
0 commit comments