Inheritance: IOperationInvoker
Exemplo n.º 1
0
 public override void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
 {
     base.ApplyDispatchBehavior(endpoint, endpointDispatcher);
     if (this.EnableAutomaticHelpPage)
     {
         HelpPageInvoker invoker = new HelpPageInvoker()
         {
             Description = endpoint.Contract, BaseUri = endpoint.ListenUri, Behavior = this
         };
         endpointDispatcher.DispatchRuntime.OperationSelector = new WrappedOperationSelector(invoker.GetHelpPageOperationSelector(), endpointDispatcher.DispatchRuntime.OperationSelector);
         // add the help page operation
         DispatchOperation helpPageOperation = new DispatchOperation(endpointDispatcher.DispatchRuntime, HelpPageInvoker.OperationName, "help", null);
         helpPageOperation.DeserializeRequest = false;
         helpPageOperation.SerializeReply     = false;
         helpPageOperation.Invoker            = invoker;
         endpointDispatcher.DispatchRuntime.Operations.Add(helpPageOperation);
     }
     endpointDispatcher.DispatchRuntime.Operations.Remove(endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation);
     endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation = new DispatchOperation(endpointDispatcher.DispatchRuntime, "*", "*", "*");
     endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation.DeserializeRequest = false;
     endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation.SerializeReply     = false;
     endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation.Invoker            = new UnhandledOperationInvoker()
     {
         BaseUri = endpoint.ListenUri, HelpPageLink = this.HelpPageLink
     };
 }
Exemplo n.º 2
0
 public override void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
 {
     base.ApplyDispatchBehavior(endpoint, endpointDispatcher);
     if (this.EnableAutomaticHelpPage)
     {
         HelpPageInvoker invoker = new HelpPageInvoker() { Description = endpoint.Contract, BaseUri = endpoint.ListenUri, Behavior = this };
         endpointDispatcher.DispatchRuntime.OperationSelector = new WrappedOperationSelector(invoker.GetHelpPageOperationSelector(), endpointDispatcher.DispatchRuntime.OperationSelector);
         // add the help page operation
         DispatchOperation helpPageOperation = new DispatchOperation(endpointDispatcher.DispatchRuntime, HelpPageInvoker.OperationName, "help", null);
         helpPageOperation.DeserializeRequest = false;
         helpPageOperation.SerializeReply = false;
         helpPageOperation.Invoker = invoker;
         endpointDispatcher.DispatchRuntime.Operations.Add(helpPageOperation);
     }
     endpointDispatcher.DispatchRuntime.Operations.Remove(endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation);
     endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation = new DispatchOperation(endpointDispatcher.DispatchRuntime, "*", "*", "*");
     endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation.DeserializeRequest = false;
     endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation.SerializeReply = false;
     endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation.Invoker = new UnhandledOperationInvoker() { BaseUri = endpoint.ListenUri, HelpPageLink = this.HelpPageLink };
 }