Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 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));
     }
 }