I have the scenario. I will send a request to the web service, and get the XML response. Used XML class from json.lib to convert the XML to JSON. Time to get response from the web service is 7s, and parsing takes anywhere around 4-8 seconds. Then all i need to do is, parse the JSON to an much desired format.
Ex : JSON after convert the XML
{"Response":{"Response":{"type" : [{1,2,3}]},"value":[{100,200,300}]}}
I am converting this JSON to below format
[{"type":1,"value":100},{"type":2,"value":200},{"type":3,"value":300}]
The problem is, this particular conversion of JSON -> JSON takes hell-a-lot of time, so instead of display result within 15 secs, it's taking around 25 secs, and the worst part is, if JSON is bit big, it takes upto 90 secs. Can you tell me what should i do to make this fast?
I am using Spring 3.0 + Tomcat 6.0.29 + json.lib for JSON parsing.
Updated :
Code i am using to convert the XML to JSON.
JSONObject ResponseObj = XML.toJSONObject(elementToString.getelementToString((Element)Responses.item(0)));