protected function applySoapHeaders()
    {
        $headers = $this->request->getHeaders() ?: [];

        if ($headers instanceof SoapHeader) {

            $headers = [ $headers ];

        } else {

            foreach ($headers as &$header) {
                if ($header instanceof SoapHeader) continue;

                $namespace      = isset($header['namespace']) ? $header['namespace'] : null;
                $name           = isset($header['name']) ? $header['name'] : null;
                $data           = isset($header['data']) ? $header['data'] : null;
                $mustUnderstand = isset($header['mustunderstand']) ? $header['mustunderstand'] : null;
                $actor          = isset($header['actor']) ? $header['actor'] : null;

                $header = new SoapHeader($namespace, $name, $data, $mustUnderstand, $actor);
            }
        }

        unset($header);

        $this->client->__setSoapHeaders($headers);
    }