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

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -