Можно изменить используемые заголовки HTTP, но только путем расширения собственного класса PHP SoapClient.
Примерно так:
class MySoapClient extends \SoapClient
public function __doRequest($request, $location, $action, $version, $one_way = 0)
{
//Send the HTTP request and get the response using curl or fsockopen,
//of course setting Content-Encoding to accept-gzip,accept-deflate.
//Also set Accept-Encoding to deflate
//Put the response in a variable called $response
//Set the headers used for this request; this is how you would do it if you used curl:
$this->__last_request_headers = curl_getinfo($curlHandle, CURLINFO_HEADER_OUT);
$this->__last_request = $request;
//decompress the response
$response = gzinflate( substr($response, 10, -8) );
return $response;
}
}
Кажется, что OP уже знает об этом, но вот совет для других, которые могут не знать об этом: чтобы увидеть SOAP-запрос, как он будет отправлен родным классом PHP SoapClient, установите 'trace' опция к истине:
$client = new \SoapClient($wsdlPath, array('trace'=>true));
Затем, после выполнения вашего SOAP-запроса, вы можете сделать это, чтобы увидеть использованные заголовки:
var_dump( $client->__getLastRequestHeaders() );