title: PHP Soap Basic Authorization without Header
body: <p>I've got a project in front of me that requires me to build a Soap Client in PHP and pass with the call/request a basic authorization. The client's WSDL doesn't specify a header. This is throwing me off because the basic authorization is needed to access the API in order to use the webservice (a simple user lookup).</p>
  
  <p>This is my code:
  <pre><code><code>&lt;</code>?php
  try {
  $fullname = "Joe Smith";
  $zipcode = "33149";
  $session = "1a2b3c4d5e6f";</p>
  
  <p>$client = new SoapClient('example.wsdl', array('location'=>'https://webservice/location', 'username'=>"Green", 'password'=>"tearocks"));</p>
  
  <p>$search = $client->userSearch($session, $fullname, $zipcode);
  print $search;
  } catch (SoapFault $e) {
  echo $e->faultstring;
  }
  ?>
  </pre></code></p>
  
  <p>The result displays "Unauthorized Request", a 401 error. I've gone through the php.net manual and various ebooks without avail. Any thoughts?</p>