Hi Freeman

I don't know how I could fill the string (which contains the xml message) into 
an Any object without creating a DOM tree first? Maybe it's very easy but I 
haven't found much in the web how to deal with Any's. A hint would be great.

Message size is a very good point. I don't have a solution for that because I 
need a valid xml at the end. An idea is to parse the message till to the first 
child element of the soap body and put the value "truncated" in there.

Thanks
Oli


________________________________________
Von: Freeman Fang [[email protected]]
Gesendet: Freitag, 12. November 2010 08:39
An: [email protected]
Betreff: Re: Fill element of type any without parsing the xml document in 
advance

Hi,

I think you can still use CachedOutputStream  which is used in
LoggingInInterceptors(as you already mentioned).
Not sure why you don't wanna save it into a file, but actually you can
control to save it always in memory(although it's not a good idea for
very large message). By default only message size bigger then
64k(DEFAULT_THRESHOLD) will save as a temp file, you can change the
DEFAULT_THRESHOLD through java system property "org.apache.cxf.io.
CachedOutputStream.Threshold".

Also CachedOutputStream.toString() method can help you to write the
stream content into a String.

Freeman

On 2010-11-12, at 下午3:06, Oliver Wulff wrote:

> Hi all
>
>
>
> A web service provider has deployed an interceptor which should log
> the incoming message in a similar performant way as the logging
> interceptor but not into a file. Instead the incoming message is
> sent as part of a web service call with other monitoring related
> information. The message is passed as an any type.
>
>
>
> I want to avoid that a DOM tree is created when filling the any
> type. I have to make a copy of the message because the message is
> sent in a seperated thread (scheduler) to not block processing of
> the incoming request.
>
>
>
> I wanted to copy the stream into a string which can be read by the
> scheduler. But I haven't found a way to write the xml content of the
> cached string into the xml any.
>
>
>
> Any hints are highly appreciated.
>
>
>
> Thanks
>
> Oli


--
Freeman Fang

------------------------

FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org

Reply via email to