wcf IsOneWay

Jakob Aagesen 136 Reputation points
2021-02-11T14:12:54.457+00:00

hi
I have a WCF service that has a fire and forget function, like this:
[OperationContract(IsOneWay = true)]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
void ActivateFsnCommands(string token, bool activate);
I would like to know if i can remove IsOneWay and still be backward compatible with existing clients?
I want to be able handle exceptions thrown from this method.

Developer technologies | .NET | Other
0 comments No comments
{count} votes

Accepted answer
  1. Theobald Du-MSFT 326 Reputation points
    2021-02-16T02:16:46.207+00:00

    Hi @Jakob Aagesen , When the IsOneWay=true property is applied to the operation contract, it means the client returns as soon as an outbound message is queued for dispatch to the service; no response message is generated or sent. If you remove this property, I suggest you update the client to recall the service to avoid problems, because the server has been updated and will affect the call of the client. For details, please refer to OperationContractAttribute.IsOneWay Property. Processing the exception thrown in the method can refer to Handling Exceptions and Faults.

    ----------

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Theobald Du

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.