title: How to write SOAP Authentication header with Ruby Savon
body: <p>I am making calls to a SOAP based API for the first time, and I have the following info from the documentation:</p>
  
  <blockquote>
    <p>In your client, construct your authorization header as follows:</p>
    
    <p>1 Concatenate the user name and password, for example:
    ExampleUsername:ExamplePassword</p>
    
    <p>2 Encode the string in base 64, for example:
    RXhhbXBsZVVzZXJOYW1lOkV4YW1wbGVQYXNzd29yZA==</p>
    
    <p>3 In your code, enter the Authorization header with the value Basic .</p>
    
    <p>Example Web Services header with encoded user name and password</p>
    
    <p>POST <a href="https://api.five9.com/wsadmin/AdminWebService" rel="noreferrer">https://api.five9.com/wsadmin/AdminWebService</a> HTTP/1.1</p>
    
    <p>Accept-Encoding: gzip,deflate</p>
    
    <p>Content-Type: text/xml;charset=UTF-8</p>
    
    <p>SOAPAction: ""</p>
    
    <p>Authorization: Basic RXhhbXBsZVVzZXJOYW1lOkV4YW1wbGVQYXNzd29yZA==</p>
  </blockquote>
  
  <p>I am using the Savon gem to make my call. How would I, using Ruby 1.9.3 and the Savon gem, authenticate an API call <code>api_call</code> given the above information?</p>
  
  <p>This is what I am using to setup the WSDL, or <code>client</code>.</p>
  
  <pre><code>client = Savon.client(wsdl: "https://api.five9.com/wsadmin/v2/AdminWebService?wsdl&amp;user=luigi@apitest.com")
  </code></pre>