Thanks Swastik,
It's working.
But my problem is response now coming in XML format. And I am using DOM parser.
I can able to parse it through
String url = "http://myname.cmpname.com/mobile/search.php?name=mobile&surname=developer";
URL url = new URL(link);
DocumentBuilder builder = factory.newDocumentBuilder();
Document dom = builder.parse(url.openConnection().getInputStream());
Now when I passing the response String in builder.parse(response) as you have given me
String response=hc.execute(postMethod,res);
it is giving error as
org.xml.sax.SAXParseException: InputSource needs either stream or reader
I am not using SAXParser at all.
My code is.
It will fetch the data getting response in the string but giving error at Document dom = builder.parse(response);
What am I missing or where am I wrong?