You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by "Subramanian, Ekan G" <Su...@con-way.com> on 2005/12/30 16:08:48 UTC

RE: Unauthorized (401) exception (SCL: 6)

Hi Azam,
Usually FBA (Form based authentication) is turned on on the exchange server. When you try to access the exchange server using slide, you will get a 401 error as you have not supplied the credentials. The way to avoid this is to first supply the credentials and login using FBA programmatically, get the session cookies and send the cookies everytime with your webdav request.
I have done this and it works. Let me know and I can send you the code sample.
The other option is to do this using javascript (AJAX). The advantage is that the browser will take care of sending the credentials (assuming you are executing the code from a browser in a machine which is logged on to your network).
 
Hope this helps
Thanks
Ekan

________________________________

From: Azam Jalali [mailto:jalali_azam@yahoo.com]
Sent: Sun 12/25/2005 1:30 AM
To: slide-user@jakarta.apache.org
Subject: Unauthorized (401) exception (SCL: 6)



 I want to connect to a microsoft exchange server 2003 to call mkcolMethod and etc.
 I used the following code :

             HttpURL hrl = new HttpURL("http://" + MailBoxManager.getDirectoryServer() + "/exchange/man/");
          
             NTCredentials ntc = new NTCredentials("man", "password", "opxiAppServer.cc.basamad.acc", "CC");
             WebdavResource wdr = new WebdavResource(hrl, ntc, WebdavResource.ALL, DepthSupport.DEPTH_1);
 boolean done=false;
   done = wdr.mkcolMethod("/exchange/temp/opxi");//.list();
             if (!done) {
                 String msg = wdr.getStatusMessage();
                 System.out.println("mesg = " + msg);
             }

 After running this code i got this exception
 mesg= Unauthorized (401) is occured.
   Before trying with the above code snippet, I tried to access my Exchange server through Outlook Web Access (OWA) from my browser. for the next time, when I tried to connect to the Exchange server using my code snippet, Every thing was ok.Mkcol Method is done  successfully without exception. I need to solve it in my code without opening mailbox from browser at first time.
 Is this possible with Jakarta Slide ?

 Best Regards
 Azam Jalali



               
---------------------------------
Yahoo! Photos
 Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.



---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org