title: Android Retrofit soap request envelope with security header
body: <p>I have written a soap request envelop class with security headers. I am using retrofit2 and its simplexml converter. Some how stuck to find problems in it. I am getting internal server error 500 while using below class. I have remove getter and setter so that question will be precise.</p>
  
  <pre><code>@Root(name = "soapenv")
  @NamespaceList({
      @Namespace(prefix = "new", reference = "http://www.example.org/ClassViewRQST"),
      @Namespace(prefix = "soapenv", reference = "http://schemas.xmlsoap.org/soap/envelope/")
  })
  public class PeopleSoftRequest {
  
  @Element(name = "soapenv:Header", required = false)
  private PeopleSoftHeader header;
  
  @Root(name = "soapenv:Header", strict = false)
  public static class PeopleSoftHeader {
  
      @Element(name = "wsse:Security", required = false)
      private Security security;
  }
  
  @NamespaceList({
          @Namespace(prefix = "mustUnderstand", reference = "1"),
          @Namespace(prefix = "wsse", reference = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")
  })
  @Root(name = "wsse:Security", strict = false)
  public static class Security {
  
      @Element(name = "wsse:UsernameToken", required = false)
      private UserNameToken userNameToken;
  }
  
  @Root(name = "wsse:UsernameToken", strict = false)
  public static class UserNameToken {
      @Element(name = "wsse:Username", required = false)
      private String username;
  
      @Namespace(prefix = "type", reference = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText")
      @Element(name = "wsse:Password", required = false)
      private String passWord;
  
  }
  
  @Element(name = "Body", required = false)
  private PeopleSoftBody body;
  }
  </code></pre>
  
  <p>Below is the raw soap request envelope for reference.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:new="http://www.example.org/ClassViewRQST"&gt;
  &lt;soapenv:Header&gt;
      &lt;wsse:Security soapenv:mustUnderstand="1" 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;XXXXXXX&lt;/wsse:Username&gt;
              &lt;wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"&gt;XXXXXXXX&lt;/wsse:Password&gt;
          &lt;/wsse:UsernameToken&gt;
      &lt;/wsse:Security&gt;
  &lt;/soapenv:Header&gt;\n
  &lt;soapenv:Body&gt;
  &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>