c# - How to declare Exchange Web Service -


i have in c# application new web service generated using add web reference tool.

it called exchangewebservices in solution explorer.

but when try add sample code found on stackoverflow: 652549: read-ms-exchange-email-in-c-sharp won't compile.

i have compile error message

exchangewebservices namespace used type. 

here line of code trying use.

exchangewebservices service =new exchangewebservices(exchangeversion.exchange2013_sp3); 

i have @ top of form class this:

using email2case_winform.exchangewebservices; 

what doing wrong here please?

i going guess code in answer other stack isn't quite correct, more of concept how things written (edit - or written against older version of ews). either way, there excellent examples here: http://msdn.microsoft.com/en-us/library/office/bb408521(v=exchg.140).aspx.

taking guts of it, should end like:

// identify service binding , user. exchangeservicebinding service = new exchangeservicebinding(); service.requestserverversionvalue = new requestserverversion(); service.requestserverversionvalue.version = exchangeversiontype.exchange2010; service.credentials = new networkcredential("<username>", "<password>", "<domain>"); service.url = @"https://<fqdn>/ews/exchange.asmx"; 

from there can use service create requests or whatever need do. note code copied msdn link above you'll want refer further explanation. best of luck!


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -