Hey there
Guess you might want to check the authentication type your using in your code eg are you trying to use basic authentication where the default in EWS would be NTLM and the basic will be disabled by default.
If you want to enable Basic you can perform the below:
Go to Internet Information Services Manager -> Sites -> Default Web Site -> EWS -> Authentication -> Basic Authentication: Set to enabled
So basically the problem lies on identifying your code using which type of authentication and enabling them on the EWS will most likely solve your issue
Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you Check out my latest blog posts on http://exchangequery.com Thanks Sathish
(MVP)