D
Derek
Hello all, this is my first time posting to a Usenet group, so please
forgive me for my "green-ness." Anyway, my problem is this: I need to
connect to a website that provides current and historical weather data
and does so through a web interface. To get the information you pass it
the type of data you want and a few constraints and the server
retrieves the data in plain text.
Here's an example:
http://nomads.ncdc.noaa.gov:9091/do...6_0600_fff.asc?tmp[0:0][0:6:25][0:180][0:359]
However, if I try to connect to the page with the following,
URL url = new
URL("http://nomads.ncdc.noaa.gov:9091/do...0600_fff.ascii?tmp[0:0][0:6:25][0:180][0:359]");
InputStream stream = url.openStream();
I get the following Exception:
java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at java.net.URL.openStream(Unknown Source)
Now, I've already set the proxy so that it can connect to outside web
pages (I've already tried it out on more mundane pages with no
problems), so I'm not sure what else I need to do to be able to connect
to it to retrieve the data. Can anyone help me out? Many thanks!
-Derek
forgive me for my "green-ness." Anyway, my problem is this: I need to
connect to a website that provides current and historical weather data
and does so through a web interface. To get the information you pass it
the type of data you want and a few constraints and the server
retrieves the data in plain text.
Here's an example:
http://nomads.ncdc.noaa.gov:9091/do...6_0600_fff.asc?tmp[0:0][0:6:25][0:180][0:359]
However, if I try to connect to the page with the following,
URL url = new
URL("http://nomads.ncdc.noaa.gov:9091/do...0600_fff.ascii?tmp[0:0][0:6:25][0:180][0:359]");
InputStream stream = url.openStream();
I get the following Exception:
java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at java.net.URL.openStream(Unknown Source)
Now, I've already set the proxy so that it can connect to outside web
pages (I've already tried it out on more mundane pages with no
problems), so I'm not sure what else I need to do to be able to connect
to it to retrieve the data. Can anyone help me out? Many thanks!
-Derek