Colm O hEigeartaigh wrote: > > It sounds like it could be a problem with the SAAJ implementation you're > using. What does the SOAP message look like going over the wire, does > the Body element have the SOAP-ENV namespace defined? What version of > WSS4J, Axis/CXF etc are you using? Can you create a test-case? >
The SOAP message going over the wire does not have the SOAP-ENV namespace defined in the body. The SOAP-ENV namespace is defined in the Envelope. Basically it looks like this: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> ... </SOAP-ENV:Header> <SOAP-ENV:Body wsu:Id="id-26831805" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> ... </SOAP-ENV:Body> </SOAP-ENV:Envelope> Hi Colm, Versions: Wss4j: 1.5.6 Axis2-kernel-1.3.jar I also have Axis-1.4 libraries as dependencies of Wss4j, but I assume those are only there for compilation purposes? Not sure though... I have created the following test case. It takes the file "Document.xml" as input and extracts the body element. When I invoke it from my J2SE application that creates and sends the SOAP message (via a simple main() method), the result is as you can see it in "main.xml". When I do the same thing at receiving side, in my J2EE servlet, the result is as you can see it in "http-8080-1.xml". In the J2EE case, the namespace is added to the body tag. Somehow this leads me to assume that I am looking at a classloading problem, where the J2SE side uses a different implementation than the J2EE side, but up till now I have found no differences. Below is the Java code that performs the test case. I have instantiated the individual variables in order to make debugging easier for me. Still puzzled, so if you see anything I have overlooked, I would appreciate hearing from you. Regards, Rik Gruwez import java.io.File; import java.io.FileOutputStream; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.apache.ws.security.SOAPConstants; import org.apache.ws.security.util.WSSecurityUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; public class TestNS { public static void testSibling() { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); Document doc = dbf.newDocumentBuilder().parse(new File("d:\\document.xml")); SOAPConstants sc = WSSecurityUtil.getSOAPConstants(doc.getDocumentElement()); Element selectedElem = WSSecurityUtil.findBodyElement(doc, sc); String fileName = "d:\\" + Thread.currentThread().getName() + ".xml"; FileOutputStream fos = new FileOutputStream(fileName); DOMSource ds = new DOMSource(selectedElem); StreamResult sr = new StreamResult(fos); TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); transformer.transform(ds, sr); fos.close(); } catch (Exception e) { e.printStackTrace(); } } } http://www.nabble.com/file/p22720609/document.xml document.xml http://www.nabble.com/file/p22720609/main.xml main.xml http://www.nabble.com/file/p22720609/http-8080-1.xml http-8080-1.xml http://www.nabble.com/file/p22720609/namespace.zip namespace.zip -- View this message in context: http://www.nabble.com/Body-attributes-get-modified-when-verifying-digest-tp22718268p22720609.html Sent from the WSS4J mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
