Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 692853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:41:37+00:00 2026-05-14T02:41:37+00:00

I’ve been tasked with writing a SOAP web-service in .Net to be middleware between

  • 0

I’ve been tasked with writing a SOAP web-service in .Net to be middleware between EWS2010 and an application server that previously used WebDAV to connect to Exchange. (As I understand it, WebDAV is going away with EWS2010, so the application server will no longer be able to connect as it previously did, and it is exponentially harder to connect to EWS without WebDAV. The theory is that doing it in .Net should be easier than anything else… Right?!)

My end goal is to be able to get and create/update email, calendar items, contacts, and to-do list items for a specified Exchange account. (Deleting is not currently necessary, but I may build it in for future consideration, if it’s easy enough).

I was originally given some sample code, which did in fact work, but I quickly realized that it was outdated. The types and classes used appear nowhere in the current documentation.

For example, the method used to create a connection to the Exchange server was:

ExchangeService svc = new ExchangeService();
svc.Credentials = new WebCredentials(AuthEmailAddress, AuthEmailPassword);
svc.AutodiscoverUrl(AutoDiscoverEmailAddress);

For what it’s worth, this was using an assembly that came with the sample code: Microsoft.Exchange.WebServices.dll (“MEWS”).

Before I realized that this wasn’t the current standard way to accomplish the connection, and it worked, I tried to build on it and add a method to create calendar items, which I copied from here:

static void CreateAppointment(ExchangeServiceBinding esb)
{
    // Create the appointment.
    CalendarItemType appointment = new CalendarItemType();

    ...
}

Right away, I’m confronted with the difference between ExchangeService and ExchangeServiceBinding (“ESB”); so I started Googling to try and figure out how to get an ESB definition so that the CreateAppointment method will compile. I found this blog post that explains how to generate a proxy class from a WSDL, which I did.

Unfortunately, this caused some conflicts where types that were defined in the original Assembly, Microsoft.Exchange.WebServices.dll (that came with the sample code) overlapped with Types in my new EWS.dll assembly (which I compiled from the code generated from the services.wsdl provided by the Exchange server).

I excluded the MEWS assembly, which only made things worse. I went from a handful of errors and warnings to 25 errors and 2,510 warnings. All kinds of types and methods were not found. Something is clearly wrong, here.

So I went back on the hunt. I found instructions on adding service references and web references (i.e. the extra steps it takes in VS2008), and I think I’m back on the right track.

I removed (actually, for now, just excluded) all previous assemblies I had been trying; and I added a service reference for https://my.exchange-server.com/ews/services.wsdl

Now I’m down to just 1 error and 1 warning.

Warning:
The element ‘transport’ cannot contain child element ‘extendedProtectionPolicy’ because the parent element’s content model is empty.

This is in reference to a change that was made to web.config when I added the service reference; and I just found a fix for that here on SO. I’ve commented that section out as indicated, and it did make the warning go away, so woot for that.

The error hasn’t been so easy to get around, though:

Error:
The type or namespace name ‘ExchangeService’ could not be found (are you missing a using directive or an assembly reference?)

This is in reference to the function I was using to create the EWS connection, called by each of the web methods:

private ExchangeService getService(String AutoDiscoverEmailAddress, String AuthEmailAddress, String AuthEmailPassword)
{
    ExchangeService svc = new ExchangeService();
    svc.Credentials = new WebCredentials(AuthEmailAddress, AuthEmailPassword);
    svc.AutodiscoverUrl(AutoDiscoverEmailAddress);
    return svc;
}

This function worked perfectly with the MEWS assembly from the sample code, but the ExchangeService type is no longer available. (Nor is ExchangeServiceBinding, that was the first thing I checked.)

At this point, since I’m not following any directions from the documentation (I couldn’t find anywhere in the documentation that said to add a service reference to your Exchange server’s services.wsdl — but that does seem to be the best/farthest I’ve gotten so far), I feel like I’m flying blind.

I know I need to figure out whatever it is that should replace ExchangeService / ExchangeServiceBinding, implement that, and then work through whatever errors crop up as a result of that switch…

But I have no idea how to do that, or where to look for how to do it. Googling “ExchangeService” and “ExchangeServiceBinding” only seem to lead back to outdated blog posts and MSDN, neither of which has proven terribly helpful thus far.

What should I replace ExchangeService / ExchangeServiceBinding with? Is there some other location that documents working with EWS that is better than MSDN?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:41:37+00:00Added an answer on May 14, 2026 at 2:41 am

    I would recommend moving to the Managed EWS API. It’s much easier to use than trying to cobble everything together yourself. It supports both Exchange 2007 SP1 and Exchange 2010. I think you’ll find it much easier to use and will probably eliminate your issues.

    Version 1:
    Here is the download from Microsoft.

    And here are the MSDN docs.

    For Version 2 (thanks @ruffin!)

    Download – MSDN Docs


    Added by question asker:

    Additional links that proved helpful:

    • Setting the service URL (manually or via Autodiscover)
    • Working with the EWS Managed API – some basic documentation on common tasks
    • Download for EWS Managed API installer – same download as above; also includes a little bit of documentation and intellisense data for visual studio.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm looking for suggestions for debugging... If you view this site in Firefox or
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.