I keep getting WCF service is in faulted state on the client side. How should I catch WCF exceptions, without breaking my WCF service?

前端 未结 3 1859
故里飘歌
故里飘歌 2021-02-04 15:48

I have a WCF service multiple UIs consume. When the user is unable to access the database, I get Unauthorised exception from the DB. I don\'t catch the exception on the server

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-04 16:17

    See the following link which talks about how WCF clients should catch faults/exceptions and potential problems you may run into with the 'using' statement in C#:

    http://msdn.microsoft.com/en-us/library/aa355056.aspx

    Baiscally you need to call Abort() on your client proxy. This will immediately set the state of the proxy to Closed.

提交回复
热议问题