/** * ns4 is declared on Envelope and Body and is used in faultcode. So making sure the correct ns4 * is picked up for payload source */ public void testPayloadSource1() throws Exception { String soap18Msg = "<S:Envelope xmlns:S='http://schemas.xmlsoap.org/soap/envelope/' xmlns:ns4='A'>" + "<S:Body xmlns:ns4='http://schemas.xmlsoap.org/soap/envelope/'>" + "<S:Fault>" + "<faultcode>ns4:Server</faultcode>" + "<faultstring>com.sun.istack.XMLStreamException2</faultstring>" + "</S:Fault>" + "</S:Body>" + "</S:Envelope>"; Message message = useStreamCodec(soap18Msg); Source source = message.readPayloadAsSource(); InputStream is = getInputStream(source); XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(is); xsr.next(); xsr.next(); assertEquals("http://schemas.xmlsoap.org/soap/envelope/", xsr.getNamespaceURI("ns4")); }