On Thu, Oct 18, 2012 at 3:56 PM, Daniel Kulp <[email protected]> wrote:
> It really could be just about anywhere. Can I ask to see the
> code that is creating the seek:SSEK header?
Here's the relevant code. The line within the try/catch is our
workaround to this problem: adding it makes the ssek namespace appear
in the canonicalized fragment, but without it we have the problem I
reported.
SOAPMessage soapMessage = message.getContent(SOAPMessage.class);
try {
// Adding this line worked to resolve our problem
soapMessage.getSOAPHeader().addNamespaceDeclaration("ssek",
"http://schemas.ssek.org/ssek/2006-05-10/");
} catch (SOAPException e) {
e.printStackTrace();
}
Document doc = soapMessage.getSOAPPart();
if (doc.getElementsByTagNameNS("http://schemas.xmlsoap.org/soap/envelope/",
"Header").getLength() > 0){
Node soapheader =
doc.getElementsByTagNameNS("http://schemas.xmlsoap.org/soap/envelope/",
"Header").item(0);
Element SSEK =
doc.createElementNS("http://schemas.ssek.org/ssek/2006-05-10/",
"ssek:SSEK");
SSEK.setAttributeNS("http://schemas.xmlsoap.org/soap/envelope/",
"soapenv:mustUnderstand", "1");
Element senderIdElement =
doc.createElementNS("http://schemas.ssek.org/ssek/2006-05-10/",
"ssek:SenderId");
senderIdElement.setTextContent(senderId);
senderIdElement.setAttribute("Type", "CN");
Element recieverIdElement =
doc.createElementNS("http://schemas.ssek.org/ssek/2006-05-10/",
"ssek:ReceiverId");
recieverIdElement.setTextContent(recieverId);
recieverIdElement.setAttribute("Type", "CN");
Element txIdElement =
doc.createElementNS("http://schemas.ssek.org/ssek/2006-05-10/",
"ssek:TxId");
txIdElement.setTextContent(UUID.randomUUID().toString());
SSEK.appendChild(senderIdElement);
SSEK.appendChild(recieverIdElement);
SSEK.appendChild(txIdElement);
soapheader.appendChild(SSEK);
}