Problem adding a behavior to an endpoint RRS feed

  • Question

  • Hello.

    I was attempting to use the code located at

    It's a clean way of dealing with the try/catch pattern for calling a service.

    However, after creating the factory and before calling "CreateChannel", I am adding a behavior like so: factory.Endpoint.Behaviors.Add(myBehavior);

    When I then invoke the method using "action(client)", the behavior is not there (it actually becomes a SOAP header, which is not present).

    My original code goes something like this:

    var myServiceProxy = new MyServiceClientProxy(“MyBinding”);
    var myBehavior = new BehaviorToBeAdded(“SomeValue”);  // Actually a SOAP header

    Then I'd invoke a service method, and that works.

    Any thoughts as to what's going on?

    Thanks in advance,


    Wednesday, January 29, 2014 7:59 PM


All replies