Added SoapHeader in SoapRequest

This commit is contained in:
Francis Besset
2011-09-04 23:42:03 +02:00
parent caeb484e19
commit 5790a89571
4 changed files with 104 additions and 5 deletions

View File

@ -37,6 +37,7 @@ class SoapClient
$this->options = array(
'debug' => false,
'cache_type' => null,
'namespace' => null,
);
// check option names and live merge, if errors are encountered Exception will be thrown
@ -114,10 +115,26 @@ class SoapClient
return $this->getNativeSoapClient()->__soapCall(
$soapRequest->getFunction(),
$soapRequest->getArguments(),
$soapRequest->getOptions()
$soapRequest->getOptions(),
$soapRequest->getHeaders()
);
}
/**
* @param string The SoapHeader name
* @param mixed The SoapHeader value
*
* @return \SoapHeader
*/
public function createSoapHeader($name, $value)
{
if (null === $namespace = $this->getOption('namespace')) {
throw new \RuntimeException('You cannot create SoapHeader if you do not specify a namespace.');
}
return new \SoapHeader($namespace, $name, $value);
}
/**
* @return \SoapClient
*/