Hi,
why, when I do this in a SOAPHandler:

SOAPEnvelope envelope = smc.getMessage().getSOAPPart().getEnvelope();

SOAPHeader header = envelope.getHeader();
if (header == null) {
    header = envelope.addHeader();
}

Name head = envelope.createName("head", "wsse", "http://handler.com";);
SOAPHeaderElement auth = header.addHeaderElement(head);

SOAPElement username = auth.addChildElement("UserName");
username.addTextNode(user);

SOAPElement token = auth.addChildElement("Token");
token.addTextNode(this.token);

do I get this as a result:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
   <SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";>
      <wsse:head xmlns:wsse="http://handler.com";>
         <UserName>tmcsoap</UserName>
         <Token>kxXafFye9lpZmKg798plf8SjDqS5TjCwKSvZsI7exFE=</Token>
      </wsse:head>
   </SOAP-ENV:Header>
   <soap:Body>
   ...
   </soap:Body>
</soap:Envelope>

Why does CXF (3.1.x in Wildfly 10) use a second namespace for the header?

And help or pointers would be appreciated,
Nicholas

Reply via email to