List of usage examples for javax.xml.soap SOAPHeader removeChild
public Node removeChild(Node oldChild) throws DOMException;
oldChild
from the list of children, and returns it. From source file:be.agiv.security.handler.WSSecurityHandler.java
private void appendSecurityHeader(SOAPHeader soapHeader, Element securityElement) { soapHeader.removeChild(securityElement); soapHeader.appendChild(securityElement); }
From source file:be.fedict.eid.idp.protocol.ws_federation.sts.WSSecuritySoapHandler.java
private void handleOutboundMessage(SOAPMessageContext context) throws SOAPException { SOAPMessage soapMessage = context.getMessage(); SOAPPart soapPart = soapMessage.getSOAPPart(); SOAPHeader soapHeader = soapMessage.getSOAPHeader(); if (null == soapHeader) { SOAPEnvelope soapEnvelope = soapPart.getEnvelope(); soapHeader = soapEnvelope.addHeader(); }// w ww .j a v a 2 s .co m WSSecHeader wsSecHeader = new WSSecHeader(); Element securityElement; try { securityElement = wsSecHeader.insertSecurityHeader(soapPart); } catch (WSSecurityException e) { throw new SOAPException("WS-Security error: " + e.getMessage(), e); } soapHeader.removeChild(securityElement); soapHeader.appendChild(securityElement); WSSecTimestamp wsSecTimeStamp = new WSSecTimestamp(); wsSecTimeStamp.build(soapPart, wsSecHeader); }