简体   繁体   English

如何捕获异常并调用WCF中的方法?

[英]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, 我想做的是从另一个WCF服务(客户端)中调用一个WCF服务(服务器),服务器服务具有身份验证和授权机制,
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. 当我在服务器WCF中调用登录方法时,它记录了客户端并创建了一个令牌,该令牌在一段时间后过期,当该令牌过期时,服务器服务会抛出“访问被拒绝”消息的异常。

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 ? 我是否必须使用全局错误处理程序或IOperationInvoker类来处理它?
I mean when my custom made token expired how could I know and recall the same method ? 我的意思是,当我的定制令牌过期时,我怎么知道和记得相同的方法?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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