When an operation has no return value, and the client does not care about the
success or failure of the invocation. WCF offers one-way operations to support
this sort of fire-and-forget invocation,: once the client issues the call, WCF
generates a request message, but no correlated reply message will ever return to
the client. The one-way message exchange pattern is useful when a client needs
to send information to a service but doesn't receive a response. In reality,
it's "fire and acknowledge" because the caller receives an acknowledgement that
the message was successfully committed to the communication channel.
When a client sends a message to a service endpoint whose operation is marked as
one-way, control is returned to the caller before the service operation
completes. One-way operations are specified on the [OperationContract] attribute
by using the IsOneWay=true modifier.
Configuring One-Way Operations
The OperationContract has a property IsOneWay which is Boolean type.
Default value of IsOneWay property is false. You need to set IsOneWay to true to
configures the method as a one-way operation:
- [AttributeUsage(AttributeTargets.Method)]
- public sealed class OperationContractAttribute : Attribute
- {
- public bool IsOneWay
- { get; set; }
- }
- [ServiceContract]
- public interface IArticleService
- {
- [OperationContract(IsOneWay=true)]
- void OneWayMethod();
- }

Join the conversation! Your thoughts help the community grow.