/// <summary> /// </summary> /// <param name="operationDescription"></param> /// <param name="endpoint"></param> /// <returns></returns> protected override IDispatchMessageFormatter GetRequestDispatchFormatter(OperationDescription operationDescription, ServiceEndpoint endpoint) { IDispatchMessageFormatter formatter = null; //formatter = base.GetRequestDispatchFormatter(operationDescription, endpoint); if (this.IsGetOperation(operationDescription)) { var flags = BindingFlags.CreateInstance | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.InvokeMethod; var method = typeof(WebHttpBehavior).GetMethod("GetRequestDispatchFormatter", flags); return(method.Invoke(this.basicImplementor, new object[] { operationDescription, endpoint }) as IDispatchMessageFormatter); } else { formatter = new NissingDispatchMessageFormatter(); } return(formatter); }
/// <summary> /// </summary> /// <param name="operationDescription"></param> /// <param name="endpoint"></param> /// <returns></returns> protected override IDispatchMessageFormatter GetRequestDispatchFormatter(OperationDescription operationDescription, ServiceEndpoint endpoint) { IDispatchMessageFormatter formatter = null; //formatter = base.GetRequestDispatchFormatter(operationDescription, endpoint); if (this.IsGetOperation(operationDescription)) { var flags = BindingFlags.CreateInstance | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.InvokeMethod; var method = typeof(WebHttpBehavior).GetMethod("GetRequestDispatchFormatter", flags ); return method.Invoke(this.basicImplementor, new object[] { operationDescription, endpoint }) as IDispatchMessageFormatter; } else { formatter = new NissingDispatchMessageFormatter(); } return formatter; }