/// <summary> /// 获取Client端处理请求的格式化器 /// </summary> /// <param name="operationDescription"></param> /// <param name="endpoint"></param> /// <returns></returns> protected override IClientMessageFormatter GetRequestClientFormatter(OperationDescription operationDescription, ServiceEndpoint endpoint) { IClientMessageFormatter formatter = null; if (this.IsWebGetOperation(operationDescription)) { formatter = base.GetRequestClientFormatter(operationDescription, endpoint); } else { // 沈峥注释,2015/3/19,去掉无参的请求调用默认Formatter //if (IsOperationHasParams(operationDescription) == false) //{ // formatter = base.GetRequestClientFormatter(operationDescription, endpoint); //} //else //{ // formatter = new WfJsonClientFormatter(operationDescription, endpoint); //} formatter = new WfJsonClientFormatter(operationDescription, endpoint); } return(formatter); }
/// <summary> /// 获取Client端处理请求的格式化器 /// </summary> /// <param name="operationDescription"></param> /// <param name="endpoint"></param> /// <returns></returns> protected override IClientMessageFormatter GetRequestClientFormatter(OperationDescription operationDescription, ServiceEndpoint endpoint) { IClientMessageFormatter formatter = null; if (this.IsWebGetOperation(operationDescription)) { formatter = base.GetRequestClientFormatter(operationDescription, endpoint); } else { // 沈峥注释,2015/3/19,去掉无参的请求调用默认Formatter //if (IsOperationHasParams(operationDescription) == false) //{ // formatter = base.GetRequestClientFormatter(operationDescription, endpoint); //} //else //{ // formatter = new WfJsonClientFormatter(operationDescription, endpoint); //} formatter = new WfJsonClientFormatter(operationDescription, endpoint); } return formatter; }