title: Axis 1.4 Soap Header add Username and Password
body: <p>I have an axis 1.4 web service client. i need to add username and password to soap message header. i did it, but i generates some undesirable attributes too.</p>
  
  <p>This is my code :</p>
  
  <pre><code>   SOAPHeaderElement sec = new SOAPHeaderElement(
              "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
              "wsse:Security");
  
      SOAPHeaderElement token = new SOAPHeaderElement("",
              "wsse:UsernameToken");
      SOAPHeaderElement username = new SOAPHeaderElement("", "wsse:Username");
      SOAPHeaderElement password = new SOAPHeaderElement("", "wsse:Password");
      username.addTextNode("testuser");
      password.addTextNode("testpass");
  
      token.addChildElement(username);
      token.addChildElement(password);
      sec.addChildElement(token);
  </code></pre>
  
  <p>this is soap header that i want to generate:</p>
  
  <pre><code>    &lt;soapenv:Header&gt; 
  &lt;wsse:Security 
       xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;         
      &lt;wsse:UsernameToken&gt; 
          &lt;wsse:Username&gt;testuser&lt;/wsse:Username&gt; 
          &lt;wsse:Password&gt;testpass&lt;/wsse:Password&gt;
      &lt;/wsse:UsernameToken&gt; 
  &lt;/wsse:Security&gt; 
  </code></pre>
  
  <p></p>
  
  <p>this is the header generated :</p>
  
  <pre><code>    &lt;soapenv:Header&gt;
  &lt;wsse:Security 
      soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" 
      soapenv:mustUnderstand="0" 
      xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;wsse:UsernameToken 
          soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" 
          soapenv:mustUnderstand="0" 
          xmlns:wsse=""&gt;
              &lt;wsse:Username 
                  soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" 
                  soapenv:mustUnderstand="0" 
                  xmlns:wsse=""&gt;testuser&lt;/wsse:Username&gt;
              &lt;wsse:Password 
                  soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" 
                  soapenv:mustUnderstand="0" 
                  xmlns:wsse=""&gt;testpass&lt;/wsse:Password&gt;
      &lt;/wsse:UsernameToken&gt;
  &lt;/wsse:Security&gt;
  </code></pre>
  
  <p></p>
  
  <p>other namespaces and attributes not problem but empty <strong>xmlns:wsse=""</strong> attributes cause my client to get error from web service. In soap-ui when i throw this empty attributes, i get successful response. In java code i get parsing error from web service.</p>
  
  <p>I can't generate header without these attributes.If i add "wsse" prefix to header elements, it add <strong>xmlns:wsse=""</strong> attribute to these elements too.
  Without wsse prefix i get error from web service.</p>
  
  <p>How can i generate header with wsse prefix and without <strong>xmlns:wsse=""</strong> attribute in axis 1.4? </p>