3
votes

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.

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:

enter image description here

Then I tried hitting Availability Services url, entered the username and password and it opened following page:

enter image description here

I then tried to hit the url specified on that page for service.wsdl, but it gave Page Not Found error. SO

  • Q1 where will I get WSDL file, and
  • Q2 which 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.
1

1 Answers

11
votes

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?)

However building the stubs yourself and finding URLs to invoke is a lot of work that you don't have to do if you use a pre-built Java library such as Microsoft's own EWS Java API or 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).