title: Soapclient wsdl initialize with custom http request header
body: <p>I have wsld url.  I have to add custom http request header  to authorize for this  wsdl.  When I try soapclient  as following , I get error.</p>
  
  <pre><code>/* userName and password is masked in this question */
  $opts = array(
          'http'=&gt;array(
                  "userName:xxxxx\r\n".
                  "password:xxxxxx\r\n"
          )
  
  );
  $streamContext  = stream_context_create($opts);
  $cilent = new SoapClient("https://iflyrestest.ibsgen.com:6013/iRes_Booking_WS/services/AvailabilityPort?wsdl" , array('stream_context'    =&gt; $streamContext));
  </code></pre>
  
  <p>Error: </p>
  
  <pre><code>Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't find &lt;definitions&gt; in
  </code></pre>
  
  <p>Because response  is like 'You are not authorized to access this URL...'</p>
  
  <p>Also When I try function 'file_get_content()' with same stream_context,  I successfully get  content of this url.</p>
  
  <p>How should I use soapclient for this case ?    </p>