title: Python Sud's custom soap header where one complex element has no namespace?
body: <p>The API I am working with requires a custom defined api_key in the soap header. Successful authentication with the following using Sud's <a href="https://suds-py3.readthedocs.io/en/latest/#custom-soap-headers" rel="nofollow noreferrer">Custom Soap Headers docs</a>:</p>
  <pre class="lang-py prettyprint-override"><code># create auth soap_header
  api_key = &quot;abc123&quot;
  auth_ns = ('apiKey', 'https://api.redacted.net/2.0/')
  api_key = Element('api_key', ns=auth_ns).setText(api_key)
  self.client.set_options(soapheaders=api_key)
  </code></pre>
  <p>The API also uses a pager for multiple records defined in the soap header. I am having issues getting it to work in parallel with authentication. Note that the pager and auth are not defined in the WSDL. Also, the pager does not have a namespace (ns) like the auth does.</p>
  <p><strong>Documentation Provided:</strong></p>
  <pre><code>  &lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
    xmlns:ns=&quot;https://api.redacted.net/2.0/&quot;&gt;
       &lt;soapenv:Header&gt;
         &lt;ns:apiKey&gt;
            &lt;api_key&gt;***&lt;/api_key&gt;
         &lt;/ns:apiKey&gt;
         &lt;pager&gt;&lt;page&gt;2&lt;/page&gt;&lt;per_page&gt;100&lt;/per_page&gt;&lt;/pager&gt;
       &lt;/soapenv:Header&gt;
       &lt;soapenv:Body&gt;
          &lt;ns:getCaseUpdates&gt;
             &lt;case_id&gt;2038217180&lt;/case_id&gt;
          &lt;/ns:getCaseUpdates&gt;
       &lt;/soapenv:Body&gt;
    &lt;/soapenv:Envelope&gt;
  </code></pre>
  <p>This however does not work when including the pager:</p>
  <pre class="lang-py prettyprint-override"><code># create auth soap_header
  api_key = &quot;abc123&quot;
  auth_ns = ('apiKey', 'https://api.redacted.net/2.0/')
  auth = Element('api_key', ns=auth_ns).setText(CFG.get(f&quot;{self.config_prefix}KEY&quot;))
  #self.client.set_options(soapheaders=ns)
  
  # create pager
  pager_ns = ('pager') # no namespace, see spec above
  page = Element('page', ns=pager_ns).setText(2)
  per_page = Element('per_page', ns=pager_ns).setText(50)
  
  # set client options with headers
  self.client.set_options(soapheaders=(auth, (page, per_page)))
  </code></pre>
  <p>Providing an empty string or None from pager_ns namespace also fails.
  If I could get this to work for an api call, I could abstract the pager out for use only when needed. I have reviewed other SO questions but they do not cover the issue of the missing namespace. The wsdl cannot be contractually provided. Any help would be appreciated. Thank you.</p>