java - Convert StreamResult to string or xml -


Use for spring as a stream result

  StreamSource source = new StreamSource (New StringReader (message)); StreamResult Results = New Stream Result (System.out); WebServiceTemplate.sendSourceAndReceiveToResult ("http: // someUri", source, new SOAP action callback ("some callback"), results); Return result;   

I get results, but I want to remove it as an XML or string (just want to see the content to generate the feedback).

How can I do this?

Try it:

 Try  {stream source source = new StreamSource (new stringreader ("& lt; xml & gt; blabla & lt; / xml & gt;")); Stringworld author = new stringwriter (); Stream result result = new streamerscult (author); TransformFactoryTFC = TransformerFactor.New instance (); Transformer Transformer = TFTC NEUT Transformers (); Transformer.transform (source, result); String strResult = writer.toString (); } Hold (exception e) {e.printStackTrace (); }    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -