Attached is the code sample for authenticating and connecting to a MS Exchange 
server 2003.
It is a sample JSP.

Let me know if oyu have any questions.


Thanks
Ekan

-----Original Message-----
From: Azam Jalali [mailto:[EMAIL PROTECTED]
Sent: Monday, January 02, 2006 4:49 AM
To: [email protected]
Subject: [email protected]


Dear Ekan,
I appreciate your guide.
Would you please send your code sample.  
Thanks in advance
Azam Jalali

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:[EMAIL PROTECTED]
Sent: Sun 12/25/2005 1:30 AM
To: [email protected]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


                
---------------------------------
Yahoo! for Good - Make a difference this year. 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to