简体   繁体   中英

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

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.

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