我正在尝试编写一个小型Java客户端,以使用Microsoft Exchange服务器通过Exchange Web服务(EWS)提供的服务。为了进行实验,我从这里设置了Exchange Online帐户。
然后,我将Outlook客户端配置为在交易所和Outlook的“测试电子邮件自动配置”窗口上使用新创建的邮件,我尝试为该客户端检索Services.wsdl的链接:
然后,我尝试访问Availability Services URL,输入用户名和密码,并打开以下页面:
然后,我尝试访问在该页面上为service.wsdl指定的URL,但出现“找不到页面”错误。所以
Q1 - The WSDL file can be downloaded from the Exchange server endpoint that you wish to hit. I don't have credentials to try this, but this should work:
https://outlook.office365.com/EWS/Services.wsdl
It's usually in the EWS directory and named Services.wsdl. I just looked at your other screenshots above and inferred the same format.
Q2 - For Office 365 (which you are testing with), Microsoft recommends this approach for manually finding the URL to hit for API calls. (Alternative much more detailed desciption here: How to get services.wsdl for Office 365?)
然而自行构建存根和发现的URL调用是大量的工作,你不必须做,如果你使用一个预先构建的Java库,如微软自己的EWS的Java API或该第三方库。它们基本上都具有相同的作用,即在一个Jar中公开Java类,使您可以调用任何Exchange服务器。如果愿意,他们还将负责自动发现要使用的URL(这是一个称为Autodiscover的功能)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句