Windows Service using EWS received a Connection Closed error. RRS feed

  • Question

  • So I'm working on a Windows Service that uses EWS. Everything appeared to be working correctly in debug. Had been running for hours. I've also been having ISP issues today as well. A few minutes ago I got an error that the connection was closed.  How can I test to see if my connection is open?

    Friday, September 19, 2014 6:30 PM

All replies

  • Hi 

    To Test if EWS  connection is open do below

    log on by using any user account against the affected Mailbox server on port 444 https://<servername>:444/ews/exchange.asmx. If the test is successful then the connection is open.

    In addition You can check the below things

    Check your SSL settings and correct them according to your testing needs require ssl(443) or normal http (80).

    Run the below command and see if ews health set are in a healthy state 

    Get-ServerHealth servername.domain.com | ?{$_.HealthSetName -eq "EWS.Protocol"}

    probably restart MSExchangeServicesAppPool and see the results

    Atlast you can review the protocol log files on the Mailbox server. On the Mailbox server, the logs reside in the <exchange server installation directory>\Logging\Ews folder.

    Also Refer : http://technet.microsoft.com/en-us/library/ms.exch.scom.ews.protocol(v=exchg.150).aspx

    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

    Sunday, September 21, 2014 3:13 PM
  • What's the context of your application ? eg are you using Streaming notifications or what EWS operations are you using when you get the error ? apart from Steaming notifications EWS operations don't hold the connection open they are all request (POST) and response. If your doing something like uploading a large attachment and your underlying Internet connection is unreliable then you may see some termination type errors. So you need to look at what's happening if underlying TCP issues are bubbling up exceptions in your code all you can do is catch and retry them (ultimately you need to fix your Network link). Basically things like Timeout etc may effect the speed at which you network issues bubble back as exception in your code.


    Monday, September 22, 2014 4:39 AM