'Access internal SAX Parser instance from JAX WS JAXB SOAP message
I have written a client of a web service that needs to insert a custom SOAP header,which I do using a SOAP Handler.However I get error when running it:
Exception in thread "main" javax.xml.ws.WebServiceException: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
and found that the solution should be to add :
SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true);
final SAXParser saxParser = spf.newSAXParser();
taken from Parse XML with namespace without prefix: NAMESPACE_ERR
The problem is how to access the SAX parser that the SOAP message is using in order to set it to this new instance with the correct behaviour?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
