Hello Zoltán, That's correct behaviour as per HTTP Specification :) Don't worry about the second call, since the first did not succeed. Problems can occur if you try to call a PUT http method of more than XXXX MB, since the PUT method would take forever to be uploaded the first time, fail, and take a second eternity to execute properly with the authorization header. My advice is to make a HEAD http method (small footprint) on the remote resource to make sure you have the connection authenticated b4 you make a 'big' method call.
Best regards, Miguel Figueiredo -----Original Message----- From: Zoltán Lörincz [mailto:[EMAIL PROTECTED] Sent: terça-feira, 11 de Janeiro de 2005 8:22 To: Slide Users Mailing List Subject: NotificationListener subscribe & Authorization Hello, i found an unwanted behavoir related to the WebDav notifications and authorization. The problem is that the "SUBSCRIBE" method is called twice. The first time without the "Authorization:" header, and only when a HTTP/1.1 401 Unauthorized response was received then the "Authorization:" header is inserted to the request. The same thing happens for every "POLL" and "UNSUBSCRIBE" method too. Is this a normal behavoir? Does somebody know what do i have to change to have the "Authorization" header included the first time into the requests? Thank you. I am using the following code fragment to create a subscribtion: success = true; HttpURL rootUrl = davManager.getCurrentURL(); UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(rootUrl.getUser(), rootUrl.getPassword()); listener = new NotificationListener("", 0, davManager.getRepositoryHost(), davManager.getRepositoryPort(), Protocol.getProtocol("http"), credentials, davManager.getProjectRootPath(), pollInterval, false); success = listener.subscribe("Update/newmember", "", DepthSupport.DEPTH_INFINITY, pollInterval, 100, newMemberSubscriber, credentials); success = success?listener.subscribe("Delete", "", DepthSupport.DEPTH_INFINITY, pollInterval, 100, deleteSubscriber, credentials):false; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]