John,
I'm trying to diagnose some problems using the NJ libraries to
access a remote netCDF dataset located in a website directory
that requires basic HTTP authentication. It's getting a bit
frustrating, so I'm writing for any advice you might have.
I've created a CredentialsProvider dialog to handle the necessary
user input, and in general, it seems to work okay except that...
The first problem is that using NJ 4.2.21, when one enters an ID
and password and the result, the first attempt to enter these
credentials is _always_ rejected, and one is asked to enter them
again. The second time, it always works (assuming the ID and
password are correct, of course).
Once access is gained, I found that the data downloads were
taking much too long. A check of the webserver logs revealed
that the incoming requests were alternating between no
credentials received and a 401 response code, and receiving
the credentials but only passing back 20 kB of data.
I reverted to using NJ 4.2.18, which I had been using for a
couple months. The first problem above went away. The second
remained.
As a side issue, I found that with 4.2.21, the user agent info
received by the server was "Jakarta Commons-HttpClient/3.1",
but with 4.2.18, it included the user agent info that I
passed when creating the HttpClient object.
My code when using NJ 4.2.21 looks like
public static void initHttpClient (
CredentialsProvider cprov)
{
HttpClientManager.init (cprov,
"Panoply/3.0 (http://www.giss.nasa.gov/tools/panoply/); ");
}
My code when using 4.2.18 looks like
public static void initHttpClient (
CredentialsProvider cprov)
{
HttpClient client = HttpClientManager.init (cprov,
"Panoply/3.0 (http://www.giss.nasa.gov/tools/panoply/); ");
HTTPRandomAccessFile.setHttpClient (client);
CdmRemote.setHttpClient (client);
NetcdfDataset.setHttpClient (client);
DConnect2.setHttpClient (client);
}
Thanks,
rbs
--
Robert B. Schmunk, address@hidden
NASA Goddard Institute for Space Studies, 2880 Broadway, New York, NY 10025