I am getting IOException for this line of code.
Response oresponse = orequest.send();
**This above Response object contains Xml data** :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<person>
<first-name>xyz</first-name>
<last-name>abc</last-name>
<api-standard-profile-request>
<url>http:[Removed]</url>
<headers total="1">
<http-header>
<name>[removed]</name>
<value>[removed]</value>
</http-header>
</headers>
</api-standard-profile-request>
</person>
And my parsing code is given below.
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(oresponse.getStream());
I am getting IOException for this last line i.e dBuilder.parse(oresponse.getStream())
. means during parsing. How can i parse this xml.It is giving me :
java.io.IOException: stream is closed.
at sun.net.www.http.ChunkedInputStream.ensureOpen(Unknown Source)
at sun.net.www.http.ChunkedInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
tag missing in xml data you put above or this data you're getting ?
– Pratik Oct 04 '13 at 06:38tag start..? Why have you added an extra
..? Is it a typo..? – user2339071 Oct 04 '13 at 06:43