开发者

How to fire-and-forget in WCF when using wsHttpBinding

开发者 https://www.devze.com 2023-02-14 03:11 出处:网络
I have a WCF service hosted in IIS and it is consumed by an ASP.NET application. Service and client are on diferent servers and communicate over internet.

I have a WCF service hosted in IIS and it is consumed by an ASP.NET application. Service and client are on diferent servers and communicate over internet.

Message security over wsHttpBinding is used as the security开发者_开发知识库 model (using X.509 certificate).

I tested the service with Fiddler and everything seems OK unless for a single call there are 4 sessions in fiddler (two round-trips). I don't need sessions with WCF and want my calling threads (which are asp.net worker threads), not to be blocked when calling a WCF method.

How can I achieve fire-and-forget pattern when using a WCF service (I can change the service contract if needed) ?


Fire and forget (One-Way operation) only says that your operation doesn't return any result and so client doesn't have to wait for server processing. But it has nothing to do with infrastracture calls you see in fiddler. First of all turn off estabilishSecurityContext and negotiateServiceCredentials in your security element (these are turned on by default) and try it again.


I assume that when you say "fire-and-forget" you are referring to a web service call that yields no return parameters. WCF has the notion of One-Way Method invocation that might help you here.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号