title: Constructing this SOAP header properly?
body: <p>I'm attempting to build a proper SOAP header:</p>
  
  <pre><code>&lt;soapenv:Envelope
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:sen="https://webservices.averittexpress.com/SendWebImageService"&gt;
  &lt;soapenv:Header
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;ns:authnHeader
  soapenv:mustUnderstand="0"
  xmlns:ns="http://webservices.averittexpress.com/authn"&gt;
  &lt;Username&gt;xxxxxxxx&lt;/Username&gt; &lt;Password&gt;xxxxxxxx&lt;/Password&gt;
  &lt;/ns:authnHeader&gt; &lt;/soapenv:Header&gt;
  </code></pre>
  
  <p>This is my Savon client call, I'm using version 2:</p>
  
  <pre><code>client = Savon.client(
    wsdl: api_url,
    raise_errors: false,
    convert_request_keys_to: :camelcase,
    element_form_default: :qualified,
    env_namespace: :soapenv,
    soap_header: {'username' =&gt; username, 'password' =&gt; password }
  )
  </code></pre>
  
  <p>I'm getting the following SOAP error:</p>
  
  <pre><code>fault=&gt;
    {:faultcode=&gt;"soapenv:Server",
    :faultstring=&gt;"java.lang.NullPointerException",
    :detail=&gt;nil}}
  </code></pre>
  
  <p>How do I get the <code>sapoenv:mustUserstand="0"</code> line, and what is it?</p>
  
  <p>Plus I'm confused how to set the <code>xmlns:ns="http://webservices.averittexpress.com/authn"&gt;</code>.</p>
  
  <p>I've little experience using SOAP requests, and am coming from a Ruby/Rails RESTful background. Any help would be appreciated.                   </p>