Best way to catch a WCF exception in Silverlight?

前端 未结 9 1108
悲哀的现实
悲哀的现实 2020-12-31 06:43

I have a Silverlight 2 application that is consuming a WCF service. As such, it uses asynchronous callbacks for all the calls to the methods of the service. If the service

9条回答
  •  误落风尘
    2020-12-31 07:03

    I check the Error property of the event args in the service method completed event handler. I haven't had issues with the event handler not being called. In the case where the server goes down, the call takes a few seconds then comes back with a ProtocolException in the Error property.

    Assuming you have tried this and your callback really never gets called, you might look into customizing the generated proxy class. See this article.

提交回复
热议问题