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 Azam Jalali <ja...@yahoo.com> on 2006/01/02 11:24:03 UTC

Unauthorized (401) exception in Exchange Server

I want to connect to a microsoft exchange server 2003 to call mkcolMet 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", "");
             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, it done successfully without exception. I need to solve it in my code without opening mailbox in browser at first time. 
 Is this possible with Jakarta Slide ?
 
 Best Regards
 Azam Jalali
 
 
		
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping