Well, if anything, it's an issue either with the StAX parser or with JAXB, not
really CXF. Would you be in a position to create a small test case using
just JAXB?
Basically, do something like: (pseudo code, probably not correct)
JAXBContext ctx = JAXBContext.newInstance(TextWithNodes.class);
XMLStreamReader reader = ... create a reader for you message
Object o = ctx.createUnmarshaller().unmarshal(reader);
And check out that object to see if that has the problem. In theory, it
should as that's pretty much all we do. The issue is whether the reader is
reporting the whitespace or not. You could also try debugging that a bit:
while (int event = reader.next() != XMLStreamReader.END_DOCUMENT) {
System.out.println(event);
if (event == XMLStreamReader.TEXT) {
System.out.println("text: " + reader.getCharacters();
}
}
or similar just to see if the reader is reporting the whitespace texts.
Dan
On Sun January 24 2010 10:39:34 am Adam Funk wrote:
> On 2010-01-22, Adam Funk wrote:
> > I'm working on a web-service client using a set of CXF-based tools
> > developed by a colleague who knows a lot more about WSs than I do
> > (although he couldn't explain the following problem).
>
> FWIW, we use CXF 2.1.5, although I just tried it with 2.2.5 and got
> the same problem.
>
> > #v+
> > <TextWithNodes><Node id="0"/> <Node id="1"/>Internationalisation<Node
> > id="21"/> <Node id="22"/>vertical<Node id="30"/> <Node
> > id="31"/>stream<Node id="37"/>:<Node id="38"/> <Node id="39"/>INT<Node
> > id="42"/> <Node id="43"/>VS<Node id="45"/> <Node id="46"/>UPDATE<Node
> > id="52"/>
 #v-
> >
> > But the Element is serialized as follows:
> >
> > #v+
> > <TextWithNodes><Node id="0"/><Node id="1"/>Internationalisation<Node
> > id="21"/><Node id="22"/>vertical<Node id="30"/><Node id="31"/>stream<Node
> > id="37"/>:<Node id="38"/><Node id="39"/>INT<Node id="42"/><Node
> > id="43"/>VS<Node id="45"/><Node id="46"/>UPDATE<Node id="52"/> #v-
>
> Is it fair to say that disregarding the xml:space="preserve" attribute
> this way is a bug in CXF? Or is there some configuration option that
> I'm failing to set?
>
> Thanks,
> Adam
>
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog