Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3573|回复: 1
打印 上一主题 下一主题

同步方案 EAS[exchange activeserver]

[复制链接]

388

主题

602

帖子

2218

积分

金牌会员

Rank: 6Rank: 6

积分
2218
跳转到指定楼层
楼主
发表于 2015-10-19 19:38:27 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 hechengjin 于 2016-4-5 19:50 编辑

1.xmlhttprequest

function downloadCmEnterpriseDirecotry(name, obj){  
    var prefBranch = Components.classes["@mozilla.org/preferences-service;1"]
                                .getService(Components.interfaces.nsIPrefService).getBranch(null);
    let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsISupports);
    let url = prefBranch.getCharPref("cm.enterprise.dir.request");
    //let url = "http://testmail1/service/serviceapi.do?func=serviceapi:corpAddr&sid=lJ8g9RCqKRVRHRLxLrKSRRnUbMlsOhBL000001&r=816cb4fba8de414e9fcd72098e28e8bf";
    request.open("POST", url, true);
    request.overrideMimeType("application/xml");
    request.setRequestHeader("Cache-Control", "no-cache");

    request.addEventListener("error", function(event) {onError_downloadCmEnterprise(event, name, obj); } ,false);
    request.addEventListener("load", function(event) {onLoad_downloadCmEnterprise(event, name, obj); }, false);

    // 格式化函数
    String.prototype.format= function(){
       var args = arguments;
       return this.replace(/\{(\d+)\}/g,function(s,i){
            return args;
       });
    }

        // 解密密码
        let plainPwd = decodePassword(name, obj.password);
        
    try{
        var body = '{"email":"{0}","passwd":"{1}"}'.format(name, plainPwd);

    } catch (e) {
        mm3w.log("downloadCmEnterpriseDirecotry error = " + e);
    }

    request.send(body);
}


function onLoad_downloadCmEnterprise(event, name, obj){
    let aRequest = event.target;
    let json = null;
    try {
        let responseText = aRequest.responseText;
        var json = eval('('+aRequest.responseText+')');
        if (json.code != "S_OK"){
            enableRefresh(obj.menuJson);
            updateloadingEnd(name);
            return;
        }

    } catch (e) {
         mm3w.log("onLoad_downloadCmEnterprise = " + e);
                 return;
    }


    mm3w.log("request cm enterprise dir ok!");
    // 保存企业通讯录到本地
    saveEnterpriseDirectoryToLocal(json, name, obj);   
}

2.jquery



回复

使用道具 举报

388

主题

602

帖子

2218

积分

金牌会员

Rank: 6Rank: 6

积分
2218
沙发
 楼主| 发表于 2016-3-27 22:07:38 | 只看该作者
-------------------Mozilla Thunderbird CardDAV Addon
  CardDAV是一种通讯录同步的开放协议。使用 CardDAV 同步的通讯录可以编辑、修改或者删除,并且你在手机上的这些操作也同样会和服务器同步,并同时同步到你的其他设备上。
CardDAV/CalDAV服务 (什么是CardDAV/CalDAV,它又是如何设置?)
-------------
---------------------
---------------
SyncML
------------

Hotmail Calendar only currently supports two-way syncing over EAS[exchange activeserver] (mobile devices, Windows 8) and with Windows Live Mail and Outlook. We don't provide connections over CalDAV or WCAP, the protocols Lightning supports.


------

-------------------------
LDAP
现在市场上有关LDAP的产品已有很多,各大软件公司都在他们的产品中集成了LDAP服务,如Microsoft的ActiveDirectory、Lotus的Domino Directory、IBM的WebSphere中也集成了LDAP服务。LDAP的开源实现是OpenLDAP,它比商业产品一点也不差,而且源码开发。
------------------------

--------Host: i.163.com---------foxmail能同步网易的通讯录------------端口 80---ActiveSync----
POST /Microsoft-Server-ActiveSync?User=hechengjin88&DeviceId=8E7B680BDF4190392477FC9734E76E33&DeviceType=Foxmail&Cmd=Sync HTTP/1.0
Content-Length: 2486
Accept: text/html, */*
User-Agent: Foxmail/7.0
Host: i.163.com
Connection: keep-alive
Content-Type: application/vnd.ms-sync.wbxml
MS-ASProtocolVersion: 12.0
Authorization: Basic aGVjaGVuZ2ppbjg4QDEyNi5jb206cmljaGluZm8yMDE0
..j.E\OK.4..R.Contacts#AllContacts....U.100..W[.1...VGP.Contacts..L.Contact_6..]..[.dd@126.com..^.dddddd.._.ddd..i.ddd..|.iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAIAAADY27xgAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAA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lQ6YebQfhBijGG2XXgTcF5DGB0822VwF/d3kHOBhxGHY71VqxuyLEMWpq1BTOT0rAYh9iBQQL59P0FoziDxR4ABAH7dltbCII8dAAAAAElFTkSuQmCC........HTTP/1.1 200 OK
Server: nginx
Date: Thu, 22 Jan 2015 10:58:58 GMT
Content-Type: application/vnd.ms-sync.wbxml
Connection: close
X-Date: Thu, 22 Jan 2015 10:58:58 GMT
..j.EN.1..\OP.Contacts..K.5..R.Contacts#AllContacts..N.1..FGL.Contact_6..M.36950959482771583q..N.1.......

--------Host:ex.qq.com---------foxmail能同步QQ的通讯录------------端口 80---ActiveSync----




zindus-0.8.41-tb+sm+pb+sb.xpi
http://www.zindus.com/faq-thunderbird/

exquilla_for_microsoft_exchange-31.0.1136-tb-windows.xpi

Sync Google contacts with Thunderbird using CardDav
http://www.ghacks.net/2012/12/15 ... bird-using-carddav/


什麼是Exchange Web Services Managed API
http://www.dotblogs.com.tw/wadehuang36/archive/2012/07/04/ews-first.aspx

Exchange Web Services Managed API(以下簡稱 EWS)是微軟提供 .Net Framework 版本,存取 Exchange Server 的API,Outlook 有的資料都可以用 EWS 存取,所以用 EWS 打迼自己的 Outlook 也是可能的,以下是 EWS 提供的功能:

  • Availability
  • Bulk Transfer (new in Exchange 2010)
  • Conversations (new in Exchange 2010)
  • Delegate Management
  • Exchange Store Search
  • Exchange Search (new in Exchange 2010)
  • Federated Sharing (new in Exchange 2010)
  • Folder
  • Inbox Rules (new in Exchange 2010)
  • Item
  • Mail Tips (new in Exchange 2010)
  • Messaging Records Management
  • Message Tracking (new in Exchange 2010)
  • Notification
  • Service Configuration (new in Exchange 2010)
  • Synchronization
  • Unified Messaging (new in Exchange 2010)
  • User Configuration (new in Exchange 2010)
  • Utility
  • Autodiscover service


可存取的類型有:

  • email
  • meetings
  • tasks
  • notes
  • docs
  • journals
  • contacts
  • im
為什麼叫Web Services Managed API 呢?
因為 Exchange Server 也有提供SOAP+XML的Web Services 給所有的語言使用(如: JAVA、Python 等等),而 Web Services Managed API 就是 Web Services 使用 .Net Framework 再包裝過 ,跟使用 Visual Studio 的 Web 參考所產生的 Proxy 完全不一樣(Proxy 產生的超難用),如果你想要直接使用 SOPA+XML 存取 EWS,可以使用下例網址取得定義與XML Schema。
而連線網址使用 http://server/EWS/Exchange.asmx


回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|firemail ( 粤ICP备15085507号-1 )

GMT+8, 2024-11-26 07:37 , Processed in 0.064514 second(s), 22 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表