Example of PHP code for retrieving SOAP headers in the response

Here is an example to help you retrieve the SOAP HEADER headers in the response:
//Retrieving SOAP Header in the response to store 
// headers in a table (here $responseHeader)
	
	$dom = new DOMDocument;
	$dom->loadXML($client->__getLastResponse(), LIBXML_NOWARNING);
	$path = new DOMXPath($dom);
	$headers = $path->query('//*[local-name()="Header"]/*');	
		
	$responseHeader = array();				
	foreach($headers as $headerItem) {				
		
		$responseHeader[$headerItem->nodeName] = $headerItem->nodeValue;				
	}