How to configure the behavior of the XML parser used by JAX-WS

My intention is to prevent the XML parser from referencing external objects defined in the DOCTYPE section at the beginning of the XML request, but I am interested in more generally setting up the XML parser used by JAX-WS at run time.

Looking through the available JAX-WS documentation (not formal, incomplete, "not" in many ways), I cannot find a way to express my JAX-WS configuration requirements. That would be great, because I would not have to deal with what's below.

Clutching gears with a screwdriver shows that it uses StAX. This means that I could use javax.xml.stream.XMLInputFactory and its setProperty(String, Object) method to configure it, but for this I need the specific XMLInputFactory instance used by JAX-WS. Setting system properties when starting the JVM does not do this trick; The properties must be set in the instance used by JAX-WS.

So, there is some way to configure the JAX-WS XML parser, which I don’t know about, or I will have to delve into JAX-WS to somehow hold the parser and configure it directly. The latter would be pretty lame.

Edit: I mean the standard JAX-WS implementation present in Sun / Oracle JDK. I am using Java 1.6.0 update 24. I assume it should be RI.

+4
source share
1 answer

I suggest you better use XStream for the same.

0
source

All Articles