Hi Simon,
Simon Buettner wrote:
> Hi Roland, i tried this code:
> FilePost.setRequestEntity(new InputStreamRequestEntity(new
> FileInputStream(file), file.length()));
> try {
> //Proxy konfigurieren
> if(proxyInfo.isUsingProxyServer())
> {
> //Proxy Infos
> mHttpClient.getHostConfiguration().setProxyHost(new
> ProxyHost(proxyInfo.getProxyHost(),proxyInfo.getProxyPort()));
> mHttpClient.getState().setProxyCredentials(new
> AuthScope(proxyInfo.getProxyHost(), proxyInfo.getProxyPort()),
> proxyInfo.getProxyCredentials());
>
> }
> filePost.setDoAuthentication(true);
> mHttpClient.getParams().setAuthenticationPreemptive(true);
> mHttpClient.getState().setCredentials(new
> AuthScope(proxyInfo.getProxyHost(), proxyInfo.getProxyPort()),
> proxyInfo.getProxyCredentials());
>
> int status = mHttpClient.executeMethod(filePost);
> }
> catch(Exception e){
> e.printStackTrace();
> }
>
>
> And i get the following exception:
> 09.01.2006 16:34:12 org.apache.commons.httpclient.HttpMethodDirector
> authenticateHost
> WARNUNG: Required credentials not available for BASIC <any realm>@localhost:80
> 09.01.2006 16:34:12 org.apache.commons.httpclient.HttpMethodDirector
> authenticateHost
> WARNUNG: Preemptive authentication requested but no default credentials
> available
That is not an exception, it is a warning. Either the proxy credentials or
the credentials for the target server are not set as default credentials. If
you don't have to authenticate against both at the same time, that should be
ok. HttpClient can't tell whether it is supposed to perform preemptive auth
only against the proxy, or only against the target server, or both. So it
prints a warning about the missing credentials, just in case.
cheers,
Roland
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]