2016-03-01 136 views
0

我在流星js应用程序中使用EWS,并且使用lather来组成肥皂请求。在EWS中解析来自x500地址的电子邮件地址

我想获得的所有会议形式交换,我需要满足的组织者电子邮件地址(SMTP),但像它总是retreive X500 addrress:

/O=ABCD/OU=EXCHANGE ADMINISTRATIVE GROUP (ABCDEFGH)/CN=RECIPIENTS/CN=ABCD00000" 

...我已经寻找一个解决方案,并发现这一点:

NameResolutionCollection coll = service.ResolveName("/O=ABCD/OU=EXCHANGE ADMINISTRATIVE GROUP (ABCDEFGH)/CN=RECIPIENTS/CN=ABCD00000", ResolveNameSearchLocation.DirectoryOnly,true) 

但我没有使用C#,这怎么能在技术免费的方式来完成。

回答

1

一个ResolveName SOAP请求应该是这个样子https://msdn.microsoft.com/en-us/library/office/aa563518(v=exchg.150).aspx

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
 
    <soap:Header> 
 
     <t:RequestServerVersion Version="Exchange2007_SP1" /> 
 
    </soap:Header> 
 
    <soap:Body> 
 
     <m:ResolveNames ReturnFullContactData="true" SearchScope="ActiveDirectoryContacts"> 
 
     <m:UnresolvedEntry>test</m:UnresolvedEntry> 
 
     </m:ResolveNames> 
 
    </soap:Body> 
 
    </soap:Envelope>

所以在泡沫基于该页面在别的方法例如像

var lather = require('lather'); 
 
    
 
var resolveName = { 
 
    'm:ResolveNames' : { 
 
     attributes : [ 
 
      { ReturnFullContactData : 'true' }, 
 
      { SearchScope : 'ActiveDirectoryContacts' }, 
 
     ], 
 
     'm:UnresolvedEntry' : '/O=ABCD/OU=EXCHANGE ADMINISTRATIVE GROUP (ABCDEFGH)/CN=RECIPIENTS/CN=ABCD00000', 
 
     
 
    }, 
 
}; 
 
    
 
lather.up({ 
 
    body : resolveName, 
 
    headers : { 
 
     Authorization : lather.basicAuth(exchangeUserName, exchangePassword), 
 
    }, 
 
    additionalNamespaces : [ 
 
     'xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"', 
 
     'xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"', 
 
    ], 
 
    method : 'POST', 
 
    url : 'https://outlook.office365.com/EWS/Exchange.asmx', 
 
}, function(error, res, body) { 
 
    ... 
 
});

,就可以(但可能需要一些改变)

干杯 格伦

+0

非常感谢你。这工作完美。 – eomeroff