protected override void OnOpening() { if (this.Endpoint == null) { return; } // if the binding is missing, set up a default binding if (this.Endpoint.Binding == null && this.Endpoint.Address != null) { this.Endpoint.Binding = GetDefaultBinding(this.Endpoint.Address.Uri); } WebServiceHost.SetRawContentTypeMapperIfNecessary(this.Endpoint, false); if (this.Endpoint.Behaviors.Find <WebHttpBehavior>() == null) { this.Endpoint.Behaviors.Add(new WebHttpBehavior()); } base.OnOpening(); }