$client = new SoapClient('https://example.com/soap_wsdl'); $header = new SoapHeader( 'http://example.com/soap', // namespace 'Auth', // name ['username' => 'myuser', 'password' => 'mypassword'] // data ); $headers = [$header]; $client->__setSoapHeaders($headers); // Now make a SOAP request $response = $client->someMethod();In this example, we create a new `SoapHeader` object with a custom namespace, name, and data. We then pass this `SoapHeader` object to the `__setSoapHeaders` method along with an array of `SoapHeader` objects. These headers will be included in the subsequent SOAP requests made by the `SoapClient`. The `__setSoapHeaders` method is part of the PHP built-in SOAP extension, which is automatically loaded when the `php-soap` package is installed.