in Technology by
What is one-way operation in WCF?

1 Answer

0 votes
by

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.

Use the one-way design pattern:

  • When the client must call operations and is not affected by the result of the operation at the operation level.
  • When using the NetMsmqBinding or the MsmqIntegrationBinding class. (For more information about this scenario, see Queues in Windows Communication Foundation.)

To create a one-way service contract, define your service contract, apply the OperationContractAttribute class to each operation, and set the IsOneWay property to true, as shown in the following sample code.

[ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")]
public interface IOneWayCalculator
{
    [OperationContract(IsOneWay = true)]
    void Add(double n1, double n2);
    [OperationContract(IsOneWay = true)]
    void Subtract(double n1, double n2);
    [OperationContract(IsOneWay = true)]
    void Multiply(double n1, double n2);
    [OperationContract(IsOneWay = true)]
    void Divide(double n1, double n2);
}

Related questions

0 votes
    Using the WCF web programming model one can specify an operation contract like so: [OperationContract] [WebGet ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    What is one-way operation?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    Que. The term Operation system means (a) A Set of programs which controls computer working. (b) The way ... disk drive operates. Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    The ___________ operation, denoted by −, allows us to find tuples that are in one relation but are not ... , Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    Which operation is most essential to the process of pancake sort? a) Flip the given data b) Find the largest of ... least of given data d) Inserting something into the given data...
asked Dec 28, 2022 in Technology by JackTerrance
0 votes
    The function preProcess estimates the required parameters for each operation. (a) True (b) False...
asked Oct 5, 2021 in Technology by JackTerrance
0 votes
    Which of these is a full form of CAS operation? (1)Save and Compare (2)Check and Compare (3)Compare and Swap (4)Compare and Save...
asked Sep 1, 2021 in Technology by JackTerrance
0 votes
    Find the command that forces MongoDB to use a particular index for a db.collection.find() operation. (1)explain() (2)hint() (3)hit()...
asked May 22, 2021 in Technology by JackTerrance
0 votes
    The flow controller is considered the mastermind of the operation. (1)True (2)False...
asked Apr 20, 2021 in Technology by JackTerrance
0 votes
    ____________ is considered as the mastermind of the operation. (1)Web Server (2)Extensions (3)All the options (4)Flow Controller...
asked Apr 18, 2021 in Technology by JackTerrance
0 votes
    What was the operation governance app you were demoing? It looks insanely good for our guest user and Teams management needs....
asked Mar 10, 2021 in Technology by JackTerrance
0 votes
    Hbase Region assignment operation is being handled by _________. a) zookeeper b) Hbase Master c) None of the options d) Region server...
asked Jan 26, 2021 in Technology by JackTerrance
0 votes
    Can we perform arithmetic operation on pointers?...
asked Jan 22, 2021 in Technology by JackTerrance
0 votes
    Operation Carried Out In Thermal Power Stations?...
asked Dec 12, 2020 in Technology by JackTerrance
0 votes
    What operation is performed by JOB statement? A - Job Identification B - Execution of program C - Includes name of the dataset to operate D - None of these...
asked Dec 4, 2020 in Technology by JackTerrance
...