views:

241

answers:

2

Is there a way to specify which XML parser cxf uses? Either through the cfx.xml file or programmatically?

Our app has the Woodstox parser on its classpath, and cxf seems to be using that by default. However, the Woodstox implementation seems to truncate large Base64 encoded byte arrays in the SOAP packet.

Removing Woodstox from the classpath eliminates this truncation problem, but that's not an option right now since other parts of our app also depends on Woodstox.

It would be ideal if I could simply tell cxf to use another XML parser. Is this possible?

+1  A: 

Try setting the following system property:

javax.xml.stream.XMLInputFactory=com.sun.xml.internal.stream.XMLInputFactoryImpl

See XMLInputFactory#newInstance() for details on how the XMLInputFactory is configured

Kevin
Thanks for the info about the XMLInputFactory, Kevin... While that didn't ultimately work for me that's good info to know...I ended up having to re-work our app to completely remove the dependency on on Woodstox...
CJS
You should be able to override the other XML parsing factories. Do you know which specific part is being used by Woodstox?
Kevin
A: 

Which Woodstox version are using? Could it be that problem you are encountering might have been fixed by a more recent Woodstox version? And if not, reported this issue? This could be much less work than rewriting your app.

StaxMan