From 099d4688bfc08702949a9d7b23cb7e97988dfbdd Mon Sep 17 00:00:00 2001 From: "Herman J. Radtke III" Date: Fri, 21 Nov 2008 23:09:40 +0000 Subject: [PATCH] Updated soap-soapheader-construct.xml with an example that explains the necessary steps to generate attributes in the SOAP Header xml. Added soap-soapclient-setsoapheaders.xml for missing SoapClient->__setSoapHeaders method. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@269496 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../soap-soapclient-setsoapheaders.xml | 122 ++++++++++++++++++ .../functions/soap-soapheader-construct.xml | 35 ++++- 2 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 reference/soap/functions/soap-soapclient-setsoapheaders.xml diff --git a/reference/soap/functions/soap-soapclient-setsoapheaders.xml b/reference/soap/functions/soap-soapclient-setsoapheaders.xml new file mode 100644 index 0000000000..1002cf3cda --- /dev/null +++ b/reference/soap/functions/soap-soapclient-setsoapheaders.xml @@ -0,0 +1,122 @@ + + + + + SoapClient->__setSoapHeaders + + Sets SOAP headers for subsequent calls. + + + + &reftitle.description; + + SoapClient + + bool + __setSoapHeaders + mixedheaders + + + + Defines headers to be sent along with the SOAP requests. + + + + Calling this method will replace any previous values. + + + + + &reftitle.parameters; + + + + headers + + + The headers to be set. If not specified, the headers will be deleted. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + + Set A Single Header + + "http://localhost/soap.php", + 'uri' => "http://test-uri/")); +$header = new SoapHeader('http://soapinterop.org/echoheader/', + 'echoMeStringRequest', + 'hello world')); + +$client->__setSoapHeaders($header); + +$client->__soapCall("echoVoid", null); +?> +]]> + + + + + + Set Multiple Headers + + "http://localhost/soap.php", + 'uri' => "http://test-uri/")); +$headers = array(); + +$headers[] = new SoapHeader('http://soapinterop.org/echoheader/', + 'echoMeStringRequest', + 'hello world')); + +$headers[] = new SoapHeader('http://soapinterop.org/echoheader/', + 'echoMeStringRequest', + 'hello world again')); + +$client->__setSoapHeaders($headers); + +$client->__soapCall("echoVoid", null); +?> +]]> + + + + + + + diff --git a/reference/soap/functions/soap-soapheader-construct.xml b/reference/soap/functions/soap-soapheader-construct.xml index f6fc6e8506..2de07a2347 100644 --- a/reference/soap/functions/soap-soapheader-construct.xml +++ b/reference/soap/functions/soap-soapheader-construct.xml @@ -1,5 +1,5 @@ - + SoapHeader->__construct @@ -78,7 +78,7 @@ &reftitle.examples; - Some examples + Basic Example __soapCall("echoVoid", null, null, 'echoMeStringRequest', 'hello world')); ?> +]]> + + + + + + Complex Type With Attributes + + 'value1', 'attr2' => 'value2'); + +// the type_name and type_namespace parameters must be specified +// when specifying attributes +$complex_type = new SOAPVar($attributes, + SOAP_ENC_OBJECT, + 'ComplexType', // type_name + 'http://www.example.com/namespace', // type_namespace + 'complex_type', + 'http://www.example.com/namespace'); + + +$header = new SOAPHeader('http://www.example.com/namespace', + 'ComplexType', + $complex_type, + true); + +$client->__soapCall("someFunc", null, null, $header); +?> ]]>