When you are creating the SSEK Element you need to also add the ssek
namespace to the element, e.g.:

Element SSEK =
doc.createElementNS("http://schemas.ssek.org/ssek/2006-05-10/";,
"ssek:SSEK");

SSEK.setAttributeNS("http://www.w3.org/2000/xmlns/";, "xmlns:ssek", "
http://schemas.ssek.org/ssek/2006-05-10/";);

Doing this instead of adding the workaround should solve the problem.

Colm.

On Fri, Oct 19, 2012 at 8:37 AM, Jesper Nygårds <[email protected]>wrote:

> 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);
> }
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Reply via email to