885522 wrote:Or the credentials are in fact wrong. I'm rusty, but I believe the password needs to be Base64 encoded.
It says unauthorised for the url.
Does that mean the authenticator is not being called?
Is there any other authentication configuration missing on the server.The server seems to be doing its job - keeping you out. So the authentication configuration must be present.
repCon.setRequestMethod("POST");"POST" is the default when you call doOutput(true). Remove that.
repCon.setRequestProperty("Content-type", "application/pdf" );You are sending a PDF? Doesn't seem likey, as you have it in a String. Remove that.
repCon.setRequestProperty("Content-length", Integer.toString(parameterString.length()));Don't set that. Java will do it, and do it accurately. Remove that.
repCon.setRequestProperty("Authorization","Basic");The Authenticator will do this when necessary. Remove that. At present you are saying there is authorization with the request even when there isn't (i.e. the first time, before the server asks for it).
Does that mean the authenticator is not being called?You can test that for yourself.
Is there any other authentication configuration missing on the server.You've already overdone it. Try the changes mentioned above.