0

how can i get the response "AS IS" (XML Format) in a string or inputstream? The response i am getting from my SOAP webservice in a String, it seems to be ALL in one line and not formatted XML. How can i do this? (Edited): I tried to change the getResponseBodyAsStream but i get this response: org.apache.commons.httpclient.AutoCloseInputStream@23597cac

Code to get the response:

String response = post.getResponseBodyAsString();

      bufferedReader.close();
      return response;

Returned string:

<tag1>name</tag1><name>JustaName</name>etc...

How can i get this nice like(example):

<tag1>name</tag1>
<name>JustaName
</name>etc...
Dark Soul
  • 83
  • 5
  • 14

1 Answers1

0

If you need that XML formatted badly, you can do it by building a Document out of it and then Transform it back to String. Check Get full xml text from Node instance

Community
  • 1
  • 1
Svoice
  • 98
  • 4