Example #1
0
        public void ApplyClientBehaviorNonDuplex()
        {
            // It must be applied to duplex callback runtime
            IEndpointBehavior eb = new CallbackBehaviorAttribute()
            {
                ConcurrencyMode = ConcurrencyMode.Multiple, ValidateMustUnderstand = false
            };
            var cd = ContractDescription.GetContract(typeof(IFoo));
            var se = new ServiceEndpoint(cd);
            var ed = new EndpointDispatcher(new EndpointAddress("http://localhost:" + NetworkHelpers.FindFreePort()), "IFoo", "urn:foo");
            var cr = ed.DispatchRuntime.CallbackClientRuntime;

            eb.ApplyClientBehavior(se, cr);
        }