protected override IClientMessageFormatter GetReplyClientFormatter(OperationDescription operationDescription, ServiceEndpoint endpoint) { IClientMessageFormatter xmlFormatter = base.GetReplyClientFormatter(operationDescription, endpoint); IClientMessageFormatter jsonFormatter = new JsonClientFormatter(endpoint.Address.Uri, operationDescription, this.DefaultBodyStyle); return(new JsonOrXmlReplyFormatter(xmlFormatter, jsonFormatter)); }
protected override IClientMessageFormatter GetRequestClientFormatter(OperationDescription operationDescription, ServiceEndpoint endpoint) { if (GetRequestFormat(operationDescription) == WebMessageFormat.Json) { JsonClientFormatter jsonFormatter = new JsonClientFormatter(endpoint.Address.Uri, operationDescription, this.DefaultBodyStyle); return(jsonFormatter); } else { return(base.GetRequestClientFormatter(operationDescription, endpoint)); } }