ConFoo Montreal 2026: Call for Papers

Voting

: min(three, one)?
(Example: nine)

The Note You're Voting On

snuufix+nospam at gmail dot com
14 years ago
I am using SOAP call response headers to sign request results.

After alot of hours, I finally got the best way to get SOAP response headers (other than parsing __getLastResponse() witch requires trace option enabled) is using __soapCall() wrapper.

You can extend SoapClient class and wrap some functions to make sure you get the headers.

<?php

class API extends SoapClient
{

// ... Constructor, etc.

// Get SOAP Server response headers
public function __soapCall($function, $arguments, $options = array(), $input_headers = null, &$output_headers = null)
{
parent::__soapCall($function, $arguments, $options, $input_headers, $output_headers);

print_r($output_headers); // Array of response headers
}

// If you are using WSDL you need this, so you still can call functions directly without calling __soapCall manualy
public function __call($func, $args)
{
return
$this->__soapCall($func, $args);
}

?>

<< Back to user notes page

To Top