Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
My question/issue is related to jWebDav library to connect to Microsoft Exchange Server from my Java web Application.
thing is that I'm using jwebDav to connect to Microsoft Exchange Server from my java web Application in internal network. when my application go to access users mailbox it though this excepion

Java
com.independentsoft.webdav.exchange.WebdavException: 404 Not Found
	at com.independentsoft.webdav.exchange.WebdavClient.a(SourceFile:341)
	at com.independentsoft.webdav.exchange.WebdavClient.getMailbox(SourceFile:245)
	at com.independentsoft.webdav.exchange.WebdavClient.getMailbox(SourceFile:233)
	at MainClass.main(MainClass.java:23)
Caused by: com.independentsoft.webdav.exchange.WebdavException: 404 Not Found
	at com.independentsoft.webdav.exchange.WebdavClient.a(SourceFile:324)
	... 3 more


my test program for this issue is following,

Java
WebdavClient client = null;
		String mailBoxUrl = "https://[server IP]/ews/[username]@[domain].com";
		
		String userName = "[username]@[domain].com";
		String password = "[password]";
		
		client = new WebdavClient(mailBoxUrl, userName, password);
		try {
			client.setMailboxUrl(mailBoxUrl);
			client.performFormsBasedAuthentication(mailBoxUrl);
			client.getMailbox();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}


Exchange Server version is 2007

what i found is that is 404 error is some thing like that required page not found and as Im facing this issue at client site so I also spent some time with IT team to figure otu if thr is some access issue etc. but they also not come to conclusion and they are studying the issue about how to resolve this access issue, well I dont know much about Networking so cant tell you much that what they were working for this but issue still exists.

so finally here what I'm asking for is that any suggestion your side that what should i look for and to check either IT Network side or at application level that help resolving this issue.

I've also check the telnet to the server and is fine.
Java
telnet [server IP] 443


one more thing that this same application was working fine in lab environment in my office with Exchange Server 2003 R2.
Posted
Comments
Prasad Khandekar 16-May-13 11:39am    
May be the WebDav support on your Exchange Server 2007 is not configured properly. Have a look at this article on MSDN (http://technet.microsoft.com/en-us/library/bb676493(v=exchg.80).aspx). Contact your Infrastructure Manager and get it configured properly.
Shubhashish_Mandal 17-May-13 3:53am    
did you try with default SMTP address ?

If you use JWebDAV you have to use this url:

String mailBoxUrl = "https://[server IP]/exchange/[emailaddress]";
 
Share this answer
 
Hi,
i just got chance yesterday to check the issue with client server. we have tried many ways but both IT and Me cannot figure the actual cause, but yesterday i've tried this thing (calendar integration) with jwebservices library http://www.independentsoft.com/jwebservices/index.html[^] and its very easily and successfully done and calendar entry is successfully created and users mail calendar.

previously i was using this library http://www.independentsoft.com/jwebdav/[^]

Java
private void webServicesTester() {
	try
        {
            Service service = new Service("https://[Mail Server IP]/ews/Exchange.asmx", "[User Mail Id]", "[password]");
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date startTime = dateFormat.parse("2013-07-25 6:00:00");
            Date endTime = dateFormat.parse("2013-07-25 8:00:00");

            Appointment appointment = new Appointment();
            appointment.setSubject("Test");
            appointment.setBody(new Body("Body text."));
            appointment.setStartTime(startTime);
            appointment.setEndTime(endTime);
            appointment.setLocation("My Office");
            appointment.setReminderIsSet(true);
            appointment.setReminderMinutesBeforeStart(30);
            System.out.println("Trying to connect");
            
            //Here on this statement it connects to the server and create Appointment entry
            ItemId itemId = service.createItem(appointment);
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
}
 
Share this answer
 
If you use JWebDAV you have to use this url:

String mailBoxUrl = "https://[server IP]/exchange/[emailaddress]";
 
Share this answer
 
If you use JWebDAV you have to use this url:

String mailBoxUrl = "https://[server IP]/exchange/[emailaddress]";
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900