Java 在线获取 Microsoft Exchange 的 services.wsdl
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19196559/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Getting services.wsdl for Microsoft Exchange online
提问by Mahesha999
I am trying to write a small Java client for consuming services provided by Microsoft Exchange server through Exchange Web Services (EWS). For experimenting I set up Exchange Online account from here.
我正在尝试编写一个小型 Java 客户端,用于通过 Exchange Web 服务 (EWS) 使用 Microsoft Exchange 服务器提供的服务。为了进行试验,我从这里设置了 Exchange Online 帐户。
Then I configured my Outlook client to use the newly created mail on exchange and outlook's Test Email Auto-Configuration windows I tried to retrieve the link for Services.wsdl for that client:
然后我将 Outlook 客户端配置为在 Exchange 和 Outlook 的测试电子邮件自动配置窗口中使用新创建的邮件,我尝试检索该客户端的 Services.wsdl 链接:
Then I tried hitting Availability Services url, entered the username and password and it opened following page:
然后我尝试点击可用性服务 url,输入用户名和密码并打开以下页面:
I then tried to hit the url specified on that page for service.wsdl, but it gave Page Not Found error. SO
然后我尝试点击该页面上为 service.wsdl 指定的 url,但它给出了找不到页面的错误。所以
- Q1where will I get WSDL file, and
- Q2which link should I hit while developing Java client. In my office environment I get WSDL file over configured Exchange server which directly opens WSDL file but am guessing what should be in case of exchange online.
- Q1我从哪里获得 WSDL 文件,以及
- Q2在开发 Java 客户端时我应该点击哪个链接。在我的办公环境中,我通过配置的 Exchange 服务器获取 WSDL 文件,该服务器直接打开 WSDL 文件,但我在猜测在线交换的情况下应该是什么。
采纳答案by Brian Kelly
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:
Q1- WSDL 文件可以从您希望访问的 Exchange 服务器端点下载。我没有尝试此操作的凭据,但这应该有效:
https://outlook.office365.com/EWS/Services.wsdl
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.
它通常位于 EWS 目录中,名为 Services.wsdl。我只是看了你上面的其他截图并推断出相同的格式。
Q2- For Office 365 (which you are testing with), Microsoft recommends this approachfor manually finding the URL to hit for API calls. (Alternative much more detailed desciption here: How to get services.wsdl for Office 365?)
Q2- 对于 Office 365(您正在测试),Microsoft 建议使用此方法手动查找 API 调用要命中的 URL。(这里还有更详细的描述:如何获取 Office 365 的 services.wsdl?)
However building the stubs yourself and finding URLs to invoke is a lot of work that you don'thave to do if you use a pre-built Java library such as Microsoft's own EWS Java APIor this 3rd party library. They both do basically the same thing, which is to expose Java classes in a Jar that allow you to make calls to any Exchange server. They will also take care of automatically discovering the URL to use, if you wish (it's a feature called Autodiscover).
但是,如果您使用预构建的 Java 库(例如 Microsoft 自己的EWS Java API或此3rd 方库),则自己构建存根并查找要调用的 URL 是很多工作不必做的。它们都做基本相同的事情,即在 Jar 中公开 Java 类,允许您调用任何 Exchange 服务器。如果您愿意,他们还将负责自动发现要使用的 URL(这是一项名为Autodiscover的功能)。