summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2004-02-03 16:44:57 +0000
committerDmitry Stogov <dmitry@php.net>2004-02-03 16:44:57 +0000
commit75e4f43d0cc03d71e227a478b17a2b8d71953dbf (patch)
tree187b03edd765282b1e5cea6072e920a40e3a24bd
parentf3a114a97f8fa0c39bf2c915619ccb634c87a604 (diff)
downloadphp-git-75e4f43d0cc03d71e227a478b17a2b8d71953dbf.tar.gz
Initial support for client-part SOAP headers (very incomlete)
-rw-r--r--ext/soap/interop/client_round2_interop.php90
-rw-r--r--ext/soap/interop/client_round2_params.php422
-rw-r--r--ext/soap/interop/echoheadersvc.wsdl.php388
-rw-r--r--ext/soap/interop/server_round2_base.php2
-rw-r--r--ext/soap/interop/server_round2_groupB.php2
-rw-r--r--ext/soap/interop/server_round2_groupC.php14
-rw-r--r--ext/soap/php_encoding.c14
-rw-r--r--ext/soap/php_http.c7
-rw-r--r--ext/soap/php_packet_soap.c13
-rw-r--r--ext/soap/php_packet_soap.h2
-rw-r--r--ext/soap/php_soap.h11
-rw-r--r--ext/soap/soap.c222
12 files changed, 841 insertions, 346 deletions
diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php
index a1dd706d7d..dfdced7b85 100644
--- a/ext/soap/interop/client_round2_interop.php
+++ b/ext/soap/interop/client_round2_interop.php
@@ -263,21 +263,6 @@ class Interop_Client
}
$test_name = $soap_test->test_name;
- // add header info to the test name
- if ($soap_test->headers) {
- foreach ($soap_test->headers as $h) {
- $destination = 0;
- if (get_class($h) == 'soap_header') {
- if ($h->attributes['SOAP-ENV:actor'] == 'http://schemas.xmlsoap.org/soap/actor/next') $destination = 1;
- $test_name .= ":{$h->name},$destination,{$h->attributes['SOAP-ENV:mustUnderstand']}";
- } else {
- if (!$h[3] || $h[3] == 'http://schemas.xmlsoap.org/soap/actor/next') $destination = 1;
- if (!$h[2]) $h[2] = 0;
- $qn = new QName($h[0]);
- $test_name .= ":{$qn->name},$destination,".(int)$h[2];
- }
- }
- }
$sql = "delete from results where endpoint=$endpoint_id ".
"and class='$this->currentTest' and type='$this->paramType' ".
@@ -414,13 +399,13 @@ class Interop_Client
}
$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);
- }
- }
+// // 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);
@@ -432,7 +417,11 @@ class Interop_Client
}
$return = eval('return $soap->'.$soap_test->method_name.'('.$args.');');
} else {
+ if ($soap_test->headers || $soap_test->headers_expect) {
+ $return = $soap->__call($soap_test->method_name,$soap_test->method_params,$soapaction, $namespace, $soap_test->headers, $result_headers);
+ } else {
$return = $soap->__call($soap_test->method_name,$soap_test->method_params,$soapaction, $namespace);
+ }
}
@@ -449,36 +438,10 @@ class Interop_Client
}
// compare header results
- $header_result = array();
$headers_ok = TRUE;
-
- # XXX need to implement header support!
- #
- #if ($soap_test->headers) {
- # // $header is already a SOAP_Header class
- # foreach ($soap_test->headers as $header) {
- # if (get_class($header) != 'soap_header') {
- # // assume it's an array
- # $header = new SOAP_Header($header[0], NULL, $header[1], $header[2], $header[3], $header[4]);
- # }
- # $expect = $soap_test->headers_expect[$header->name];
- # $header_result[$header->name] = array();
- # // XXX need to fix need_result to identify the actor correctly
- # $need_result = $hresult ||
- # ($header->attributes['SOAP-ENV:actor'] == 'http://schemas.xmlsoap.org/soap/actor/next'
- # && $header->attributes['SOAP-ENV:mustUnderstand']);
- # if ($expect) {
- # $hresult = $soap->headers[key($expect)];
- # $ok = !$need_result || $this->compareResult($hresult ,$expect[key($expect)]);
- # } else {
- # $hresult = $soap->headers[$header->name];
- # $expect = $this->decodeSoapval($header);
- # $ok = !$need_result || $this->compareResult($hresult ,$expect);
- # }
- # $header_result[$header->name]['ok'] = $ok;
- # if (!$ok) $headers_ok = FALSE;
- # }
- #}
+ 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);
@@ -503,6 +466,10 @@ class Interop_Client
"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){
@@ -604,27 +571,6 @@ class Interop_Client
// 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 ($this->testMethod && $this->currentTest == 'GroupC') {
- // we have to figure things out now
- if (!preg_match('/(.*):(.*),(\d),(\d)/',$this->testMethod, $m)) continue;
-
- // is the header in the headers list?
- $gotit = FALSE;
- foreach ($soap_test->headers as $header) {
- if (get_class($header) == 'soap_header') {
- if ($header->name == $m[2]) {
- $gotit = $header->attributes['SOAP-ENV:actor'] == ($m[3]?SOAP_TEST_ACTOR_NEXT:SOAP_TEST_ACTOR_OTHER);
- $gotit = $gotit && $header->attributes['SOAP-ENV:mustUnderstand'] == $m[4];
- }
- } else {
- if ($header[0] == $m[2]) {
- $gotit = $gotit && $header[3] == ($m[3]?SOAP_TEST_ACTOR_NEXT:SOAP_TEST_ACTOR_OTHER);
- $gotit = $gotit && $header[4] == $m[4];
- }
- }
- }
- if (!$gotit) continue;
- }
// if we are skipping the rest of the tests (due to error) note a fault
if ($skipendpoint) {
diff --git a/ext/soap/interop/client_round2_params.php b/ext/soap/interop/client_round2_params.php
index b8d54918ae..0b8017418b 100644
--- a/ext/soap/interop/client_round2_params.php
+++ b/ext/soap/interop/client_round2_params.php
@@ -19,7 +19,6 @@
// $Id$
//
-define('SOAP_TEST_ACTOR_NEXT','http://schemas.xmlsoap.org/soap/actor/next');
define('SOAP_TEST_ACTOR_OTHER','http://some/other/actor');
class SOAP_Test {
@@ -90,18 +89,6 @@ class SOAP_Test {
}
echo "testing $this->test_name : ";
- if ($this->headers) {
- foreach ($this->headers as $h) {
- if (get_class($h) == 'soap_header') {
-
- echo "\n {$h->name},{$h->attributes['SOAP-ENV:actor']},{$h->attributes['SOAP-ENV:mustUnderstand']} : ";
- } else {
- if (!$h[4]) $h[4] = SOAP_TEST_ACTOR_NEXT;
- if (!$h[3]) $h[3] = 0;
- echo "\n $h[0],$h[4],$h[3] : ";
- }
- }
- }
if ($debug) {
print "method params: ";
@@ -428,223 +415,192 @@ $soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray',
)),$arrstr);
-#//***********************************************************
-#// GROUP C header tests
-#
-#//***********************************************************
-#// echoMeStringRequest php val tests
-#
-#// echoMeStringRequest with endpoint as header destination, doesn't have to understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStringRequest', 'hello world', 0,SOAP_TEST_ACTOR_NEXT);
-#$test->headers_expect['echoMeStringRequest'] = array('echoMeStringResponse'=>'hello world');
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeStringRequest with endpoint as header destination, must understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStringRequest', 'hello world', 1,SOAP_TEST_ACTOR_NEXT);
-#$this->type = 'soapval'; // force a soapval version of this test
-#$test->headers_expect['echoMeStringRequest'] = array('echoMeStringResponse'=>'hello world');
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeStringRequest with endpoint NOT header destination, doesn't have to understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStringRequest', 'hello world', 0, SOAP_TEST_ACTOR_OTHER);
-#$test->headers_expect['echoMeStringRequest'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeStringRequest with endpoint NOT header destination, must understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStringRequest', 'hello world', 1, SOAP_TEST_ACTOR_OTHER);
-#$test->headers_expect['echoMeStringRequest'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#//***********************************************************
-#// echoMeStringRequest soapval tests
-#
-#// echoMeStringRequest with endpoint as header destination, doesn't have to understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->type = 'soapval';
-#$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStringRequest', 'string', 'hello world');
-#$test->headers_expect['echoMeStringRequest'] = array('echoMeStringResponse'=>'hello world');
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeStringRequest with endpoint as header destination, must understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->type = 'soapval';
-#$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStringRequest', 'string', 'hello world', 1);
-#$this->type = 'soapval'; // force a soapval version of this test
-#$test->headers_expect['echoMeStringRequest'] = array('echoMeStringResponse'=>'hello world');
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeStringRequest with endpoint NOT header destination, doesn't have to understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->type = 'soapval';
-#$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStringRequest', 'string', 'hello world', 0, SOAP_TEST_ACTOR_OTHER);
-#$test->headers_expect['echoMeStringRequest'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeStringRequest with endpoint NOT header destination, must understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->type = 'soapval';
-#$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStringRequest', 'string', 'hello world', 1, SOAP_TEST_ACTOR_OTHER);
-#$test->headers_expect['echoMeStringRequest'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeStringRequest with endpoint header destination, must understand,
-#// invalid namespace, should recieve a fault
-##$test = new SOAP_Test('echoVoid', NULL);
-##$test->type = 'soapval';
-##$test->headers[] = new SOAP_Header('{http://unknown.org/echoheader/}echoMeStringRequest', 'string', 'hello world', 1);
-##$test->headers_expect['echoMeStringRequest'] = array();
-##$test->expect_fault = TRUE;
-##$soap_tests['GroupC'][] = $test;
-#
-#//***********************************************************
-#// php val tests
-#// echoMeStructRequest with endpoint as header destination, doesn't have to understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStructRequest',
-# array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325),
-# 0,SOAP_TEST_ACTOR_NEXT);
-#$test->headers_expect['echoMeStructRequest'] =
-# array('echoMeStructResponse'=> 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', NULL);
-#$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStructRequest',
-# array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325),
-# 1,SOAP_TEST_ACTOR_NEXT);
-#$test->headers_expect['echoMeStructRequest'] =
-# array('echoMeStructResponse'=> 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', NULL);
-#$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStructRequest',
-# array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325),
-# 0, SOAP_TEST_ACTOR_OTHER);
-#$test->headers_expect['echoMeStructRequest'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeStructRequest with endpoint NOT header destination, must understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeStructRequest',
-# array('varString'=>'arg', 'varInt'=>34, 'varFloat'=>325.325),
-# 1, SOAP_TEST_ACTOR_OTHER);
-#$test->headers_expect['echoMeStructRequest'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#//***********************************************************
-#// soapval tests
-#// echoMeStructRequest with endpoint as header destination, doesn't have to understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->type = 'soapval';
-#$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStructRequest',NULL,
-# array( #push struct elements into one soap value
-# new SOAP_Value('varString','string','arg'),
-# new SOAP_Value('varInt','int',34),
-# new SOAP_Value('varFloat','float',325.325)
-# ));
-#$test->headers_expect['echoMeStructRequest'] =
-# array('echoMeStructResponse'=> 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', NULL);
-#$test->type = 'soapval';
-#$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStructRequest',NULL,
-# array( #push struct elements into one soap value
-# new SOAP_Value('varString','string','arg'),
-# new SOAP_Value('varInt','int',34),
-# new SOAP_Value('varFloat','float',325.325)
-# ), 1);
-#$test->headers_expect['echoMeStructRequest'] =
-# array('echoMeStructResponse'=> 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', NULL);
-#$test->type = 'soapval';
-#$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStructRequest',NULL,
-# array( #push struct elements into one soap value
-# new SOAP_Value('varString','string','arg'),
-# new SOAP_Value('varInt','int',34),
-# new SOAP_Value('varFloat','float',325.325)
-# ), 0, SOAP_TEST_ACTOR_OTHER);
-#$test->headers_expect['echoMeStructRequest'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeStructRequest with endpoint NOT header destination, must understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->type = 'soapval';
-#$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeStructRequest',NULL,
-# array( #push struct elements into one soap value
-# new SOAP_Value('varString','string','arg'),
-# new SOAP_Value('varInt','int',34),
-# new SOAP_Value('varFloat','float',325.325)
-# ), 1, SOAP_TEST_ACTOR_OTHER);
-#$test->headers_expect['echoMeStructRequest'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#//***********************************************************
-#// echoMeUnknown php val tests
-#// echoMeUnknown with endpoint as header destination, doesn't have to understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeUnknown', 'nobody understands me!',0,SOAP_TEST_ACTOR_NEXT);
-#$test->headers_expect['echoMeUnknown'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeUnknown with endpoint as header destination, must understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeUnknown', 'nobody understands me!',1,SOAP_TEST_ACTOR_NEXT);
-#$test->headers_expect['echoMeUnknown'] = 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', NULL);
-#$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeUnknown', 'nobody understands me!',0, SOAP_TEST_ACTOR_OTHER);
-#$test->headers_expect['echoMeUnknown'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeUnknown with endpoint NOT header destination, must understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->headers[] = array('{http://soapinterop.org/echoheader/}echoMeUnknown', 'nobody understands me!', 1, SOAP_TEST_ACTOR_OTHER);
-#$test->headers_expect['echoMeUnknown'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#//***********************************************************
-#// echoMeUnknown soapval tests
-#// echoMeUnknown with endpoint as header destination, doesn't have to understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->type = 'soapval';
-#$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeUnknown','string','nobody understands me!');
-#$test->headers_expect['echoMeUnknown'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeUnknown with endpoint as header destination, must understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->type = 'soapval';
-#$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeUnknown','string','nobody understands me!',1);
-#$test->headers_expect['echoMeUnknown'] = 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', NULL);
-#$test->type = 'soapval';
-#$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeUnknown','string','nobody understands me!', 0, SOAP_TEST_ACTOR_OTHER);
-#$test->headers_expect['echoMeUnknown'] = array();
-#$soap_tests['GroupC'][] = $test;
-#
-#// echoMeUnknown with endpoint NOT header destination, must understand
-#$test = new SOAP_Test('echoVoid', NULL);
-#$test->type = 'soapval';
-#$test->headers[] = new SOAP_Header('{http://soapinterop.org/echoheader/}echoMeUnknown','string','nobody understands me!', 1, SOAP_TEST_ACTOR_OTHER);
-#$test->headers_expect['echoMeUnknown'] = array();
-#$soap_tests['GroupC'][] = $test;
-
-
-?> \ No newline at end of file
+//***********************************************************
+// 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/echoheadersvc.wsdl.php b/ext/soap/interop/echoheadersvc.wsdl.php
index b310960657..e7070242a3 100644
--- a/ext/soap/interop/echoheadersvc.wsdl.php
+++ b/ext/soap/interop/echoheadersvc.wsdl.php
@@ -5,16 +5,394 @@ 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/">
- <import location="http://www.whitemesa.com/interop/InteropTest.wsdl" namespace="http://soapinterop.org/"/>
- <import location="http://www.whitemesa.com/interop/InteropTest.wsdl" namespace="http://soapinterop.org/xsd"/>
- <import location="http://www.whitemesa.com/interop/InteropTestC.wsdl" namespace="http://soapinterop.org/"/>
+ <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.php"/>
+ <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/server_round2_base.php b/ext/soap/interop/server_round2_base.php
index ea76bddc40..b059cd887f 100644
--- a/ext/soap/interop/server_round2_base.php
+++ b/ext/soap/interop/server_round2_base.php
@@ -99,7 +99,7 @@ class SOAP_Interop_Base {
}
}
-$server = new SoapServer("http://test-uri");
+$server = new SoapServer("http://soapinterop.org/");
$server->bind((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php");
$server->setClass("SOAP_Interop_Base");
$server->handle();
diff --git a/ext/soap/interop/server_round2_groupB.php b/ext/soap/interop/server_round2_groupB.php
index 921f31d934..9501912008 100644
--- a/ext/soap/interop/server_round2_groupB.php
+++ b/ext/soap/interop/server_round2_groupB.php
@@ -52,7 +52,7 @@ class SOAP_Interop_GroupB {
}
}
-$server = new SoapServer("http://test-uri");
+$server = new SoapServer("http://soapinterop.org/");
$server->bind((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php");
$server->setClass("SOAP_Interop_GroupB");
$server->handle();
diff --git a/ext/soap/interop/server_round2_groupC.php b/ext/soap/interop/server_round2_groupC.php
index 0c5492cda8..7372cae437 100644
--- a/ext/soap/interop/server_round2_groupC.php
+++ b/ext/soap/interop/server_round2_groupC.php
@@ -24,16 +24,24 @@ class SOAP_Interop_GroupC {
function echoMeStringRequest($string)
{
- return new SOAP_Value('{'.$this->method_namespace.'}echoMeStringResponse','string',$string);
+// return $string;
+ return new SoapVar($string, XSD_STRING, "string", XSD_NAMESPACE, "echoMeStringResponse", $this->method_namespace);
}
function echoMeStructRequest($struct)
{
- return new SOAP_Value('{'.$this->method_namespace.'}echoMeStructResponse','SOAPStruct',$struct);
+// return $struct;
+ return new SoapVar($struct, SOAP_ENC_OBJECT, "SOAPStruct", "http://soapinterop.org/", "echoMeStructResponse",$this->method_namespace);
+// new SOAP_Value('{'.$this->method_namespace.'}echoMeStructResponse','SOAPStruct',$struct);
+ }
+
+ function echoVoid()
+ {
}
}
-$server = new SoapServer("http://test-uri");
+$server = new SoapServer("http://soapinterop.org/");
+$server->bind((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/php_encoding.c b/ext/soap/php_encoding.c
index ca21504ed2..dc8141ccfb 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -262,11 +262,13 @@ xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr par
node = master_to_xml(enc, *zdata, style, parent);
}
- if (zend_hash_find(Z_OBJPROP_P(data), "enc_stype", sizeof("enc_stype"), (void **)&zstype) == SUCCESS) {
- if (zend_hash_find(Z_OBJPROP_P(data), "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 (style == SOAP_ENCODED) {
+ if (zend_hash_find(Z_OBJPROP_P(data), "enc_stype", sizeof("enc_stype"), (void **)&zstype) == SUCCESS) {
+ if (zend_hash_find(Z_OBJPROP_P(data), "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));
+ }
}
}
@@ -2329,7 +2331,7 @@ static xmlNodePtr check_and_resolve_href(xmlNodePtr data)
href = get_attribute_ex(data->properties, "ref", SOAP_1_2_ENC_NAMESPACE);
if (href) {
char* id;
- xmlNodePtr ret;
+ xmlNodePtr ret;
if (href->children->content[0] == '#') {
id = href->children->content+1;
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index fc82fabe67..8c8d24e55f 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -56,10 +56,9 @@ static int stream_alive(php_stream *stream TSRMLS_DC)
}
/* Proxy HTTP Authentication */
-static void proxy_authentication(zval* this_ptr, smart_str* soap_headers)
+static void proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC)
{
zval **login, **password;
- TSRMLS_FETCH();
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_login", sizeof("_proxy_login"), (void **)&login) == SUCCESS) {
char* buf;
@@ -132,7 +131,7 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, in
smart_str_appendc(&soap_headers, ':');
smart_str_append_unsigned(&soap_headers, phpurl->port);
smart_str_append_const(&soap_headers, " HTTP/1.1\r\n");
- proxy_authentication(this_ptr, &soap_headers);
+ 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);
@@ -332,7 +331,7 @@ int send_http_soap_request(zval *this_ptr, xmlDoc *doc, char *location, char *so
/* Proxy HTTP Authentication */
if (use_proxy && !use_ssl) {
- proxy_authentication(this_ptr, &soap_headers);
+ proxy_authentication(this_ptr, &soap_headers TSRMLS_CC);
}
/* Send cookies along with request */
diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c
index 7792c1cd91..84a0c5d75e 100644
--- a/ext/soap/php_packet_soap.c
+++ b/ext/soap/php_packet_soap.c
@@ -22,7 +22,7 @@
#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 TSRMLS_DC)
+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;
@@ -177,6 +177,17 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
}
}
+ if (soap_headers && head) {
+ trav = head->children;
+ while (trav != NULL) {
+ if (trav->type == XML_ELEMENT_NODE) {
+ zval *val = master_to_zval(NULL, trav);
+ add_assoc_zval(soap_headers, (char*)trav->name, val);
+ }
+ trav = trav->next;
+ }
+ }
+
/* Check if <Body> contains <Fault> element */
fault = get_node_ex(body->children,"Fault",envelope_ns);
if (fault != NULL) {
diff --git a/ext/soap/php_packet_soap.h b/ext/soap/php_packet_soap.h
index 12a9af5637..5eef76cd30 100644
--- a/ext/soap/php_packet_soap.h
+++ b/ext/soap/php_packet_soap.h
@@ -22,6 +22,6 @@
#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 TSRMLS_DC);
+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_soap.h b/ext/soap/php_soap.h
index c429c314f4..2796d7e6b3 100644
--- a/ext/soap/php_soap.h
+++ b/ext/soap/php_soap.h
@@ -109,6 +109,7 @@ struct _soapService {
} soap_class;
HashTable *mapping;
+ int version;
int type;
char *actor;
char *uri;
@@ -127,6 +128,16 @@ struct _soapService {
#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"
+
ZEND_BEGIN_MODULE_GLOBALS(soap)
HashTable *defEncNs;
HashTable *defEncPrefix;
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index c44353df74..7337e7e848 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -53,7 +53,7 @@ static sdlFunctionPtr get_doc_function(sdlPtr sdl, xmlNodePtr node);
static sdlFunctionPtr deseralize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval **parameters[], int *version, soapHeader **headers TSRMLS_DC);
static xmlDocPtr seralize_response_call(sdlFunctionPtr function, char *function_name,char *uri,zval *ret, soapHeader *headers, int version TSRMLS_DC);
-static xmlDocPtr seralize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval **arguments, int arg_count, int version TSRMLS_DC);
+static xmlDocPtr seralize_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 seralize_parameter(sdlParamPtr param,zval *param_val,int index,char *name, int style, xmlNodePtr parent TSRMLS_DC);
static xmlNodePtr seralize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent TSRMLS_DC);
@@ -67,11 +67,13 @@ static void soap_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_proper
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);\
+ zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\
+ int _old_soap_version = SOAP_GLOBAL(soap_version);\
SOAP_GLOBAL(use_soap_error_handler) = 1;
#define SOAP_SERVER_END_CODE() \
- SOAP_GLOBAL(use_soap_error_handler) = old_handler
+ SOAP_GLOBAL(use_soap_error_handler) = _old_handler;\
+ SOAP_GLOBAL(soap_version) = _old_soap_version;
#define HTTP_RAW_POST_DATA "HTTP_RAW_POST_DATA"
@@ -107,6 +109,7 @@ static zend_class_entry* soap_server_class_entry;
static zend_class_entry* soap_fault_class_entry;
zend_class_entry* soap_var_class_entry;
zend_class_entry* soap_param_class_entry;
+zend_class_entry* soap_header_class_entry;
ZEND_DECLARE_MODULE_GLOBALS(soap);
@@ -117,6 +120,7 @@ static void (*old_error_handler)(int, const char *, const uint, const char*, va_
#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_MINIT_FUNCTION(soap);
PHP_MSHUTDOWN_FUNCTION(soap);
@@ -186,6 +190,9 @@ PHP_METHOD(soapfault, soapfault);
/* SoapParam Functions */
PHP_METHOD(soapparam, soapparam);
+/* SoapHeader Functions */
+PHP_METHOD(soapheader, soapheader);
+
static zend_function_entry soap_functions[] = {
#ifdef HAVE_PHP_DOMXML
PHP_FE(soap_encode_to_xml, NULL)
@@ -214,13 +221,26 @@ static zend_function_entry soap_server_functions[] = {
{NULL, NULL, NULL}
};
+#ifdef ZEND_ENGINE_2
+ZEND_BEGIN_ARG_INFO(__call_args, 0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(1)
+ZEND_END_ARG_INFO();
+#else
+unsigned char __call_args[] = { 6, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
+#endif
+
static zend_function_entry soap_client_functions[] = {
PHP_ME(soapobject, soapobject, NULL, 0)
PHP_ME(soapobject, __login, NULL, 0)
PHP_ME(soapobject, __useproxy, NULL, 0)
PHP_ME(soapobject, __isfault, NULL, 0)
PHP_ME(soapobject, __getfault, NULL, 0)
- PHP_ME(soapobject, __call, NULL, 0)
+ PHP_ME(soapobject, __call, __call_args, 0)
PHP_ME(soapobject, __trace, NULL, 0)
PHP_ME(soapobject, __getlastrequest, NULL, 0)
PHP_ME(soapobject, __getlastresponse, NULL, 0)
@@ -239,6 +259,11 @@ static zend_function_entry soap_param_functions[] = {
{NULL, NULL, NULL}
};
+static zend_function_entry soap_header_functions[] = {
+ PHP_ME(soapheader, soapheader, NULL, 0)
+ {NULL, NULL, NULL}
+};
+
zend_module_entry soap_module_entry = {
#ifdef STANDARD_MODULE_HEADER
STANDARD_MODULE_HEADER,
@@ -387,6 +412,9 @@ PHP_MINIT_FUNCTION(soap)
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(NULL, NULL);
le_url = register_list_destructors(delete_url, NULL);
le_service = register_list_destructors(delete_service, NULL);
@@ -406,10 +434,16 @@ PHP_MINIT_FUNCTION(soap)
REGISTER_LONG_CONSTANT("XSD_1999_TIMEINSTANT", XSD_1999_TIMEINSTANT, 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("UNKNOWN_TYPE", UNKNOWN_TYPE, 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_STRING_CONSTANT("XSD_NAMESPACE", XSD_NAMESPACE, CONST_CS | CONST_PERSISTENT);
+
REGISTER_LONG_CONSTANT("XSD_ANYTYPE", XSD_ANYTYPE, 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);
@@ -528,6 +562,38 @@ PHP_METHOD(soapparam,soapparam)
add_property_zval(this_ptr, "param_data", data);
}
+/* SoapHeader functions */
+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) {
+ php_error(E_ERROR, "Invalid arguments to SoapHeader constructor");
+ }
+
+ add_property_stringl(this_ptr, "namespace", ns, ns_len, 1);
+ add_property_stringl(this_ptr, "name", name, name_len, 1);
+ if (data) {
+#ifndef ZEND_ENGINE_2
+ zval_add_ref(&data);
+#endif
+ add_property_zval(this_ptr, "data", data);
+ }
+ add_property_bool(this_ptr, "mustUnderstand", must_understand);
+ if (actor == NULL) {
+ add_property_long(this_ptr, "actor", SOAP_ACTOR_NEXT);
+ } else if (Z_TYPE_P(actor) == IS_LONG) {
+ add_property_long(this_ptr, "actor", Z_LVAL_P(actor));
+ } else if (Z_TYPE_P(actor) == IS_STRING) {
+ add_property_stringl(this_ptr, "actor", Z_STRVAL_P(actor), Z_STRLEN_P(actor), 1);
+ } else {
+ php_error(E_ERROR, "Invalid arguments to SoapHeader constructor");
+ }
+}
+
/* SoapFault functions */
PHP_METHOD(soapfault,soapfault)
{
@@ -593,16 +659,18 @@ PHP_METHOD(soapserver,soapserver)
soapServicePtr service;
char *uri, *actor = NULL;
int ret, uri_len, actor_len;
+ long version = SOAP_1_1;
SOAP_SERVER_BEGIN_CODE();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &uri, &uri_len, &actor, &actor_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &uri, &uri_len, &version, &actor, &actor_len) == FAILURE) {
php_error(E_ERROR, "Invalid arguments to SoapServer constructor");
}
service = emalloc(sizeof(soapService));
memset(service, 0, sizeof(soapService));
+ service->version = version;
service->uri = estrndup(uri, uri_len);
if (actor) {
service->actor = estrndup(actor, actor_len);
@@ -980,6 +1048,7 @@ PHP_METHOD(soapserver, handle)
SOAP_SERVER_BEGIN_CODE();
FETCH_THIS_SERVICE(service);
+ SOAP_GLOBAL(soap_version) = service->version;
ZERO_PARAM();
INIT_ZVAL(retval);
@@ -1061,6 +1130,14 @@ PHP_METHOD(soapserver, handle)
php_error(E_ERROR, "Bad Request");
}
if (xmlGetIntSubset(doc_request) != NULL) {
+ xmlNodePtr env = get_node(doc_request->children,"Envelope");
+ if (env && env->ns) {
+ if (strcmp(env->ns->href,SOAP_1_1_ENV_NAMESPACE) == 0) {
+ SOAP_GLOBAL(soap_version) = SOAP_1_1;
+ } else if (strcmp(env->ns->href,SOAP_1_2_ENV_NAMESPACE) == 0) {
+ SOAP_GLOBAL(soap_version) = SOAP_1_2;
+ }
+ }
php_error(E_ERROR,"DTD are not supported by SOAP");
}
@@ -1437,7 +1514,9 @@ static void do_soap_call(zval* thisObj,
zval** real_args,
zval* return_value,
char* soap_action,
- char* call_uri
+ char* call_uri,
+ HashTable* soap_headers,
+ zval* output_headers
TSRMLS_DC)
{
zval **tmp;
@@ -1481,10 +1560,10 @@ zend_try {
sdlBindingPtr binding = fn->binding;
if (binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes;
- request = seralize_function_call(thisObj, fn, NULL, fnb->input.ns, real_args, arg_count, soap_version TSRMLS_CC);
+ request = seralize_function_call(thisObj, fn, NULL, fnb->input.ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
ret = send_http_soap_request(thisObj, request, binding->location, fnb->soapAction, soap_version TSRMLS_CC);
} else {
- request = seralize_function_call(thisObj, fn, NULL, sdl->target_ns, real_args, arg_count, soap_version TSRMLS_CC);
+ request = seralize_function_call(thisObj, fn, NULL, sdl->target_ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
ret = send_http_soap_request(thisObj, request, binding->location, NULL, soap_version TSRMLS_CC);
}
@@ -1493,7 +1572,7 @@ zend_try {
if (ret) {
ret = get_http_soap_response(thisObj, &buffer, &len TSRMLS_CC);
if (ret) {
- parse_packet_soap(thisObj, buffer, len, fn, NULL, return_value TSRMLS_CC);
+ parse_packet_soap(thisObj, buffer, len, fn, NULL, return_value, output_headers TSRMLS_CC);
efree(buffer);
}
}
@@ -1518,7 +1597,7 @@ zend_try {
if (call_uri == NULL) {
call_uri = Z_STRVAL_PP(uri);
}
- request = seralize_function_call(thisObj, NULL, function, call_uri, real_args, arg_count, soap_version TSRMLS_CC);
+ request = seralize_function_call(thisObj, NULL, function, call_uri, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
if (soap_action == NULL) {
smart_str_appends(&action, call_uri);
@@ -1537,7 +1616,7 @@ zend_try {
if (ret) {
ret = get_http_soap_response(thisObj, &buffer, &len TSRMLS_CC);
if (ret) {
- ret = parse_packet_soap(thisObj, buffer, len, NULL, function, return_value TSRMLS_CC);
+ ret = parse_packet_soap(thisObj, buffer, len, NULL, function, return_value, output_headers TSRMLS_CC);
efree(buffer);
}
}
@@ -1615,6 +1694,9 @@ PHP_METHOD(soapobject, __call)
{
char *function, *soap_action = NULL, *uri = NULL;
int function_len, soap_action_len, uri_len, i = 0;
+ HashTable* soap_headers = NULL;
+ zval *headers = NULL;
+ zval *output_headers = NULL;
zval *args;
zval **real_args;
zval **param;
@@ -1622,8 +1704,31 @@ PHP_METHOD(soapobject, __call)
HashPosition pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa|ss",
- &function, &function_len, &args, &soap_action, &soap_action_len, &uri, &uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa|sszz",
+ &function, &function_len, &args, &soap_action, &soap_action_len, &uri, &uri_len, &headers, &output_headers) == FAILURE) {
+ php_error(E_ERROR, "Invalid arguments to SoapObject->__call");
+ }
+
+ if (headers == NULL || Z_TYPE_P(headers) == IS_NULL) {
+ } else if (Z_TYPE_P(headers) == IS_ARRAY) {
+ zval** tmp;
+
+ soap_headers = Z_ARRVAL_P(headers);
+ zend_hash_internal_pointer_reset(soap_headers);
+ while (zend_hash_get_current_data(soap_headers, (void**)&tmp) == SUCCESS) {
+ if (Z_TYPE_PP(tmp) != IS_OBJECT ||
+ Z_OBJCE_PP(tmp) != soap_header_class_entry) {
+ php_error(E_ERROR, "Invalid arguments to SoapObject->__call");
+ }
+ zend_hash_move_forward(soap_headers);
+ }
+ } else if (Z_TYPE_P(headers) == IS_OBJECT &&
+ Z_OBJCE_P(headers) == soap_header_class_entry) {
+ soap_headers = emalloc(sizeof(HashTable));
+ zend_hash_init(soap_headers, 0, NULL, NULL/*ZVAL_PTR_DTOR*/, 0);
+ zend_hash_next_index_insert(soap_headers, &headers, sizeof(zval*), NULL);
+ headers = NULL;
+ } else{
php_error(E_ERROR, "Invalid arguments to SoapObject->__call");
}
@@ -1636,9 +1741,16 @@ PHP_METHOD(soapobject, __call)
/*zval_add_ref(param);*/
real_args[i++] = *param;
}
- do_soap_call(this_ptr, function, function_len, arg_count, real_args, return_value, soap_action, uri TSRMLS_CC);
-
+ if (output_headers) {
+ array_init(output_headers);
+ }
+ do_soap_call(this_ptr, function, function_len, arg_count, real_args, return_value, soap_action, uri, soap_headers, output_headers TSRMLS_CC);
efree(real_args);
+
+ if (soap_headers && ! headers) {
+ zend_hash_destroy(soap_headers);
+ efree(soap_headers);
+ }
}
PHP_METHOD(soapobject, __isfault)
@@ -1747,7 +1859,7 @@ static void soap_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_proper
zval **arguments = (zval **) emalloc(sizeof(zval *) * arg_count);
zend_get_parameters_array(ht, arg_count, arguments);
- do_soap_call(this_ptr, function, Z_STRLEN(function_name->element) + 1, arg_count, arguments, return_value, NULL, NULL TSRMLS_CC);
+ do_soap_call(this_ptr, function, Z_STRLEN(function_name->element) + 1, arg_count, arguments, return_value, NULL, NULL, NULL, NULL TSRMLS_CC);
efree(arguments);
}
zval_dtor(&function_name->element);
@@ -1901,6 +2013,10 @@ static void deseralize_parameters(xmlNodePtr params, sdlFunctionPtr function, in
}
}
}
+ if (num_of_params > cur_param) {
+ TSRMLS_FETCH();
+ soap_server_fault("Client","Missing parameter", NULL, NULL TSRMLS_CC);
+ }
(*parameters) = tmp_parameters;
(*num_params) = num_of_params;
}
@@ -2187,8 +2303,10 @@ static int seralize_response_call2(xmlNodePtr body, sdlFunctionPtr function, cha
} else {
style = main?SOAP_RPC:SOAP_DOCUMENT;
use = main?SOAP_ENCODED:SOAP_LITERAL;
- ns = encode_add_ns(body, uri);
- method = xmlNewChild(body, ns, function_name, NULL);
+ if (style == SOAP_RPC) {
+ ns = encode_add_ns(body, uri);
+ method = xmlNewChild(body, ns, function_name, NULL);
+ }
}
if (function != NULL) {
@@ -2224,6 +2342,10 @@ static int seralize_response_call2(xmlNodePtr body, sdlFunctionPtr function, cha
xmlNodeSetName(param, (*sparam)->element->name);
xmlSetNs(param, ns);
}
+ } else if (strcmp(param->name,"return") == 0) {
+ ns = encode_add_ns(param, uri);
+ xmlNodeSetName(param, function_name);
+ xmlSetNs(param, ns);
}
}
} else if (param_count > 1 && Z_TYPE_P(ret) == IS_ARRAY) {
@@ -2403,7 +2525,7 @@ static xmlDocPtr seralize_response_call(sdlFunctionPtr function, char *function_
return doc;
}
-static xmlDocPtr seralize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval **arguments, int arg_count, int version TSRMLS_DC)
+static xmlDocPtr seralize_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;
xmlNode *envelope = NULL, *body, *method = NULL;
@@ -2429,6 +2551,68 @@ static xmlDocPtr seralize_function_call(zval *this_ptr, sdlFunctionPtr function,
}
xmlDocSetRootElement(doc, envelope);
+ if (soap_headers) {
+ xmlNodePtr head = xmlNewChild(envelope, ns, "Header", NULL);
+ 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;
+
+ if (zend_hash_find(ht, "data", sizeof("data"), (void**)&tmp) == SUCCESS) {
+ h = master_to_xml(NULL,*tmp,SOAP_DOCUMENT,head);
+ xmlNodeSetName(h, Z_STRVAL_PP(name));
+ } else {
+ h = xmlNewNode(NULL, 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, SOAP_1_1_ENV_NS_PREFIX":mustUnderstand","1");
+ } else {
+ xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":mustUnderstand","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, SOAP_1_1_ENV_NS_PREFIX":actor",Z_STRVAL_PP(tmp));
+ } else {
+ xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",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, SOAP_1_1_ENV_NS_PREFIX":actor",SOAP_1_1_ACTOR_NEXT);
+ }
+ } else {
+ if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) {
+ xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",SOAP_1_2_ACTOR_NEXT);
+ } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NONE) {
+ xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",SOAP_1_2_ACTOR_NONE);
+ } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_UNLIMATERECEIVER) {
+ xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",SOAP_1_2_ACTOR_UNLIMATERECEIVER);
+ }
+ }
+ }
+ }
+ }
+ zend_hash_move_forward(soap_headers);
+ }
+ }
+
body = xmlNewChild(envelope, ns, "Body", NULL);
if (function && function->binding->bindingType == BINDING_SOAP) {