none
AfterReceiveReply not firing with message callbacks RRS feed

  • Question

  • Hello all,

    I'm currently working with wsDualHttpBinding, and I cannot figure out how to intercept responses (at the client side via AfterReceiveReply) once a callback is invoked by a service.

    The BeforeSendRequest is working properly but not the AfterReceiveReply. Note that I'm getting the expected responses from my services. The following is how I assign the endpoint behavior to my client:

    client.Endpoint.Behaviors.Add(new MyEndpointBehavior());

    Does callback response interception require special consideration that I missed out?

    Thanks in advance.


    Friday, January 3, 2014 9:28 PM

Answers

  • I finally found the solution. In case someone else is having the same problem, you need to add the following to your ApplyClientBehavior method:

    public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
    {
         clientRuntime.CallbackDispatchRuntime.MessageInspectors.Add(new MyDispatchMessageInspector()); 
    
    }


    • Marked as answer by Arabian Nights Friday, January 3, 2014 11:05 PM
    • Edited by Arabian Nights Friday, January 3, 2014 11:11 PM Add code block
    Friday, January 3, 2014 11:04 PM

All replies

  • I finally found the solution. In case someone else is having the same problem, you need to add the following to your ApplyClientBehavior method:

    public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
    {
         clientRuntime.CallbackDispatchRuntime.MessageInspectors.Add(new MyDispatchMessageInspector()); 
    
    }


    • Marked as answer by Arabian Nights Friday, January 3, 2014 11:05 PM
    • Edited by Arabian Nights Friday, January 3, 2014 11:11 PM Add code block
    Friday, January 3, 2014 11:04 PM
  • I finally found the solution. In case someone else is having the same problem, you need to add the following to your ApplyClientBehavior method:

    public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
    {
         clientRuntime.CallbackDispatchRuntime.MessageInspectors.Add(new MyDispatchMessageInspector()); 
    
    }


    What is MyDispatchMessageInspector() ? It's not mentioned elsewhere. Glad you found a solution, but I am still hunting.
    Thursday, May 16, 2019 12:32 PM