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

1.2k views Asked by At

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) ?

2

There are 2 answers

2
Ladislav Mrnka On BEST ANSWER

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.

0
Masterfu On

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.