SoapHeader::__construct
PHP function
Edit on GitHub ✎
(PHP 5, PHP 7, PHP 8)
SoapHeader constructor
Description
SoapHeader::__construct(string $namespace, string $name, [mixed $data], [bool $mustunderstand], [string $actor])
Constructs a new SoapHeader object.
Parameters
namespaceThe namespace of the SOAP header element.
nameThe name of the SoapHeader object.
dataA SOAP header's content. It can be a PHP value or a
SoapVarobject.mustUnderstandValue of the
mustUnderstandattribute of the SOAP header element.actorValue of the
actorattribute of the SOAP header element.
Examples
SoapHeader::__construct() example
php
<?php
$client = new SoapClient(null, array('location' => "http://localhost/soap.php",
'uri' => "http://test-uri/"));
$client->__soapCall("echoVoid", null, null,
new SoapHeader('http://soapinterop.org/echoheader/',
'echoMeStringRequest',
'hello world'));
?>See Also
SoapClient::__soapCallSoapVar::__constructSoapParam::__constructSoapServer::addSoapHeader