简体   繁体   中英

How to catch an exception and recall the method in WCF?

What I'm trying to do is that I'm calling one WCF service (sever) from within another WCF service (client), server service has authentication and authorization mechanism,
when I call login method in server WCF it logged the client and creates a token that expired after amount of time, when that token expired an exception with "Access Denied" message thrown by server service.

What I want to do is to catch this exception in client service and recall the same method recalled in client with the same parameters after I do a login.
Do I have to use global error handler or IOperationInvoker class to handle it ?
I mean when my custom made token expired how could I know and recall the same method ?

您应该构建WCF服务以准备处理请求

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM