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

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c++ - Redefined variable in the other module -

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -