
Exchange 2007及后续版本提供了EWS,等于是提供了一个供其他应用使用的接口,而我们的Exchange是2003版,没有EWS,貌似不能方便地把其他系统的Calendar同步到Exchange...
有人说,用WebDAV可以,但我觉得还是复杂了点。
昨天看到httpBuilder,刹那间有了办法:我们不是有Exchange提供的webmail吗?我们可以手动登录上去 *** 作自己的Calendar,可不可以让几行代码替我们去做这个事情呢?很到应用所做的事情不过是代替人工 *** 作而已。
开始研究:
打开浏览器,指向Microsoft Outlook Web Access,出现登录页面
VIEw Source,Ctrl + F,找'<form'和'<input',不难找到登录表单提交的url和传输的表单变量:
<FORM action="/exchweb/bin/auth/owaauth.dll" method="POST" name="logonForm">
<input type="hIDden" name="destination" value="https://webmail.domain.com/Exchange/">
<input type="hIDden" name="flags" value="0">
<input type="text" ID="username" name="username"...
<input type="password" autocomplete="off" ID="password" name="password"...
在groovyConsole中写几行代码并执行以下看看:
import groovyx.net.http.*def http = new httpBuilder( 'https://webmail.domain.com' )http.post( path: '/exchweb/bin/auth/owaauth.dll',body: [destination:'https://webmail.domain.com/Exchange',flags:'0',username:'domain/username',password:'pwd']) {res-> if( res.statusline.statusCode == 302 ) { println 'logged in successfully.' }}http.get( path: '/Exchange/username/日历',ContentType:groovyx.net.http.ContentType.TEXT,query:[Cmd:'contents']) {res,reader-> System.out << reader} 成功地读取了我的日历!按照这种先登录后 *** 作的模式来, *** 作Exchange Server上的Calendar乃至Task,InBox等其他Folders也是举手之劳而已。
总结以上是内存溢出为你收集整理的没有EWS,怎么把其他系统的Calendar同步到Exchange?全部内容,希望文章能够帮你解决没有EWS,怎么把其他系统的Calendar同步到Exchange?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)