Hi gnodet,

Many Thanks for the reply.
My problem is that, i need to extract the Inputstream from Streamsouce.
The piece of code, used is :

Source source = in.getContent();   ( "in" is the Normalised in message).

SourceTransformer sourceTransformer = new SourceTransformer();
Document xml = sourceTransformer.toDOMDocument(source);

StreamSource stSource = (StreamSource )source ;
InputStream inStream = stSource.getInputStream();

The problem with this code is that, i'm getting java.io.IOException:Stream
closed.

I tried the solution, which u suggested yesterday, but getting the same
exception.

Cheers,
Sathya.




gnodet wrote:
> 
> Try using the org.apache.servicemix.jbi.jaxp.SourceTransformer class.
>    Source newSource = new StringSource(new
> SourceTransformer().toString(oldSource));
> 
> 
> On Mon, May 5, 2008 at 3:20 PM, Sathyashankar <[EMAIL PROTECTED]> wrote:
>>
>>  Hi,
>>  I need to convert Streamsource to stringsource/bytessource.
>>  The casting works fine at compile time, but throws a "Cannot cast"
>> exception
>>  at runtime...
>>  Any suggestions???
>>  Thanks in advance.
>>  --
>>  View this message in context:
>> http://www.nabble.com/Streamsource-to-Stringsource-tp17061479p17061479.html
>>  Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Streamsource-to-Stringsource-tp17061479p17071596.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Reply via email to