• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sending request with basic authentication  RSS feed

 
ben dedeyan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have to connect to a Domino server and then send an xml transaction.
I'm connecting this way :
----------------------------------------------
URL u = new URL("url");
String userPassword= "domainname\\username assword";
String encoding= new sun.misc.BASE64Encoder().encode (userPassword.getBytes());

URLConnection uc= u.openConnection();
conn= (HttpURLConnection) uc;

conn.setRequestProperty("Authorization", "Basic " + encoding);
conn.setDoOutput(true);
conn.setDoInput(true);
----------------------------------------------------------------
Then I send my xml, flush & close my writer.
As soon as I try to get the response, the following pops up in my log :
---------------------------------
java.io.FileNotFoundException: Response: '500: Internal Server Error' for : 'url'
Request method: POST
Response message: Server Error
Response code: 500
<html><head><title>Error</title></head><body>The parameter is incorrect. </body></html>
---------------------------------
I used to get a 401, FilenotFoundException. I fixed it and now I always get this one.
Also, it doesn't seem that the Domino server logs anything, so it's probably never hit in the first place. Any ideas? Thanks!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!