Unable to receive Response from URLConnection

Hi,

This problem might look trivial. But we are facing problem in this one. We are using JDK 1.4.2.

We need to hit a URL through JAVA which will create few other actions.We are using HttpURLConnection to connect to URL. We are not able to receive response from few connections and unable to track them . We need to find out what is the response code for that request.

url = new URL(s);

urlConnection = (HttpURLConnection) url.openConnection();

urlConnection.setRequestMethod("GET");

urlConnection.getResponseMessage();

urlConnection.disconnect();

In our primilary investigation, we came to know that the Server will allow limited no. of connections only. We may invoke more number of URL Connections.

Can any body suggest what could be the problem here and How can we get response code ?

Thanks in advance.

Message was edited by:

freakyCoder

[924 byte] By [freakyCodera] at [2007-11-27 2:15:18]
# 1
Is your client blocking on getResponseMessage()? throwing an exception? If the server is not closing its response stream you would not get a response code. Where are you checking response code?
developer_jbsa at 2007-7-12 2:11:59 > top of Java-index,Core,Core APIs...