使用jwebDav从JAVA Web应用程序访问Exchange Server [英] Accessing Exchange Server from JAVA web Application using jwebDav

查看:58
本文介绍了使用jwebDav从JAVA Web应用程序访问Exchange Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的问题/问题与从我的Java Web应用程序连接到Microsoft Exchange Server的jWebDav库有关。

的事情是我正在使用jwebDav从我在内部网络中的Java Web应用程序连接到Microsoft Exchange Server。当我的应用程序去访问用户邮箱时,除了这个例外



 com.independentsoft.webdav.exchange.WebdavException: 404 未找到
(SourceFile: 341
at com.independentsoft.webdav.exchange.WebdavClient.getMailbox(SourceFile: 245
at com.independentsoft.webdav.exchange.WebdavClient.getMailbox( SourceFile: 233 )MainClass.main的
(MainClass.java: 23
引起:com.independentsoft.webdav.exchange.WebdavException: 404 在com.independentsoft.webdav.exchange.WebdavClient.a找不到
(SourceFile: 324
... 3 更多





此问题的测试程序如下:



WebdavClient client = null;
字符串 mailBoxUrl = https:// [服务器IP] / ews / [用户名] @ [域名] .com;

字符串 userName = [用户名] @ [域] .COM;
字符串密码= [密码] ;

client = new WebdavClient(mailBoxUrl,userName,password);
尝试 {
client.setMailboxUrl(mailBoxUrl);
client.performFormsBasedAuthentication(mailBoxUrl);
client.getMailbox();
} catch (例外e){
// TODO自动生成的捕获块
e.printStackTrace();
}





Exchange Server版本是2007



什么我发现是404错误是一些事情,如所需的页面未找到,因为我在客户端站点面临这个问题,所以我也花了一些时间与IT团队计算otu如果thr是一些访问问题等但他们也没有来得出结论,他们正在研究如何解决这个访问问题,我不太了解网络因此无法告诉你他们为此工作但问题仍然存在。



所以最后在这里我要求的是任何建议你的方面我应该寻找什么,并检查IT网络方面或在应用程序级别,以帮助解决这个问题。



我也检查telnet到服务器并且没问题。

 telnet [服务器IP]  443  





这个应用程序工作正常的另一件事在我办公室的实验室环境中使用Exchange Server 2003 R2。

解决方案

如果您使用JWebDAV,则必须使用此URL:



字符串mailBoxUrl =https:// [服务器IP] /交换/ [电子邮件地址];




i才有机会昨天检查客户端服务器的问题。我们已经尝试了很多方法,但IT和我都无法确定实际原因,但昨天我已经尝试过这个(日历集成)与jwebservices库 http://www.independentsoft.com/jwebservices/index.html [ ^ ]并且它非常容易且成功地完成并且日历条目已成功创建并且用户邮寄日历。



之前我使用的是这个图书馆 http://www.independentsoft.com/jwebdav/ [ ^ ]



  private   void  webServicesTester(){
try
{
服务服务= 服务( https:// [Mail Server IP] / ews / Exchange .asmx [用户邮件ID] [密码]);
SimpleDateFormat dateFormat = new SimpleDateFormat( yyyy -MM-dd HH:mm:ss);
日期startTime = dateFormat.parse( 2013-07-25 6:00:00);
日期endTime = dateFormat.parse( 2013-07-25 8:00:00);

预约约会= 约会();
appointment.setSubject( Test);
appointment.setBody( new 正文( 正文。));
appointment.setStartTime(startTime);
appointment.setEndTime(endTime);
appointment.setLocation( 我的办公室);
appointment.setReminderIsSet(true);
appointment.setReminderMinutesBeforeStart( 30 );
System.out.println( 试图连接);

// 在此语句中,它连接到服务器并创建约会条目
ItemId itemId = service.createItem(约会);
}
catch (例外e)
{
e.printStackTrace();
}
}


如果你使用JWebDAV,你必须使用这个网址:



String mailBoxUrl =https:// [server IP] / exchange / [emailaddress];


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

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,

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.

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.

解决方案

If you use JWebDAV you have to use this url:

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


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/[^]

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();
        }
}


If you use JWebDAV you have to use this url:

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


这篇关于使用jwebDav从JAVA Web应用程序访问Exchange Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆