Covers Windows Communication Foundation: service, data and operation contracts, endpoints, bindings (basicHttp, wsHttp, netTcp, netNamedPipe), SOAP and WS-Security/ReliableMessaging/transactions, configuration in web.config, and the modern options (gRPC, REST, CoreWCF, the WCF client packages).
WCF (Windows Communication Foundation, .NET 3.0, 2006) is a unified framework for service communication. You define a contract ([ServiceContract] interface, [DataContract] types, [FaultContract] for typed SOAP faults) and expose it on one or more endpoints, each with an address and a binding. The binding chooses transport, encoding and security: BasicHttpBinding for SOAP 1.1 interop, WSHttpBinding for the WS-* standards (WS-Security, reliable messaging, transactions), NetTcpBinding for fast binary Windows-to-Windows calls.
It was popular because one model covered HTTP, TCP, named pipes and MSMQ, configured in XML. On .NET 10 the WCF client is still available as NuGet packages, but there is no built-in WCF server: you host SOAP services with CoreWCF (community-built, Microsoft-supported, actively developed) or replace them with gRPC (internal RPC) or REST (public and browser clients). The trade-off: CoreWCF is the cheapest move but keeps you on SOAP.
"WCF is the service framework from .NET 3.0. The model is the ABCs. The contract is an interface marked
[ServiceContract], with[OperationContract]methods and[DataContract]types serialised byDataContractSerializer. The binding says how messages travel: transport, encoding and security. And the address is where the endpoint lives. One service can have several endpoints, say SOAP over HTTP for a partner and binary over TCP for an internal client, with no code change, just configuration.The bindings people meet most are
BasicHttpBinding, which is plain SOAP 1.1 and compatible with old ASMX clients;WSHttpBinding, which adds the WS-* standards like WS-Security message signing, reliable messaging and distributed transactions;NetTcpBinding, a fast binary protocol for Windows-to-Windows; andNetNamedPipeBindingfor same-machine calls. Enterprises loved it because they could talk to Java and SAP systems over WS-* with security and transactions configured rather than coded.The mistake I see is assuming WCF is gone from .NET 10. The client is still there as NuGet packages, so a .NET 10 app can call a SOAP service with
dotnet-svcutil. What's missing is the server. For that you choose: gRPC for internal service-to-service calls, because it's contract-first, HTTP/2 and fast; REST for anything public or called from a browser; or CoreWCF, which is a community port that Microsoft supports, when external partners depend on the exact SOAP contract and you can't make them change. My senior line: pick per service, based on who the clients are, not one answer for the whole estate."
| Binding | Transport / encoding | Use | Notes |
|---|---|---|---|
BasicHttpBinding |
HTTP, SOAP 1.1 text | Interop, ASMX clients | Transport security via HTTPS |
WSHttpBinding |
HTTP, SOAP 1.2 + WS-* | Enterprise interop | Message security, reliable sessions, transactions |
NetTcpBinding |
TCP, binary | Internal Windows services | Fast, Windows auth, duplex |
NetNamedPipeBinding |
Named pipes | Same machine | Fastest, local only |
NetMsmqBinding |
MSMQ queues | Offline / queued calls | MSMQ is not in modern .NET |
WebHttpBinding |
HTTP, JSON/XML | Early REST | Use ASP.NET Core instead |
| Need | Choose | Why |
|---|---|---|
| Internal service-to-service RPC | gRPC (Grpc.AspNetCore) |
Contract-first .proto, HTTP/2, streaming, fast binary |
| Public API, browsers, mobile | REST / HTTP APIs | Universal clients, OpenAPI tooling |
| Partners locked to SOAP/WSDL | CoreWCF | Keeps contracts and most bindings |
| Calling someone else's SOAP service | System.ServiceModel.* client + dotnet-svcutil |
Still supported on .NET 10 |
| Duplex callbacks | gRPC streaming or SignalR | Replace CallbackContract |
| MSMQ queued calls | Azure Service Bus or RabbitMQ | MSMQ not available |
CoreWCF's Microsoft support policy lists 1.9 (with 1.9.1 patch) targeting .NET 10, supported until November 2028 or six months after the next minor release. It supports BasicHttpBinding, WSHttpBinding, NetTcpBinding, NetNamedPipeBinding and more, but not every WS-* feature (no WS-AtomicTransaction distributed transactions, for example).
A payments team with 40 WCF operations typically splits them three ways: internal calls from other .NET services move to gRPC (with p99 latency often dropping from around 25 ms to under 10 ms thanks to HTTP/2 and Protobuf), the public mobile API moves to REST, and two operations used by a bank partner stay on CoreWCF with the same WSDL so the partner changes nothing.
Checks that the candidate understands WCF's model and can choose a migration target per service based on its clients.
Green flags
Red flags
A binding is really a recipe for a channel stack. Each message passes through channels in order:
Client proxy (ChannelFactory<IOrderService>)
│ Message (SOAP envelope)
▼
[Protocol channels] WS-Security → WS-ReliableMessaging → Transaction flow
▼
[Encoder] Text (SOAP XML) / Binary / MTOM
▼
[Transport] HTTP / TCP / Named pipe / MSMQ
▼ ... network ...
Service host: transport → encoder → protocol channels → dispatcher → your method
This flexibility is why WCF was powerful and why its configuration got huge: every behaviour (throttling, instance mode, concurrency, security mode, message size quotas) is a knob.
[ServiceContract] on an interface; [OperationContract] on each method; IsOneWay for fire-and-forget.[DataContract] / [DataMember] opt-in serialisation, versioned by adding members with IsRequired = false.[FaultContract] declares SOAP faults, the typed error model.svcutil, Add Service Reference, now dotnet-svcutil).InstanceContextMode (PerCall, PerSession, Single) and ConcurrencyMode (Single, Reentrant, Multiple) control how many service objects exist and how many threads use them. Many production bugs came from PerSession with wsHttpBinding (sessions on by default) plus ServiceThrottling limits, causing queued calls and timeouts under load.
WCF's server depended on Windows-specific pieces (IIS/WAS activation, System.Web hosting, Windows security, MSMQ) and its WS-* stack was huge. Microsoft chose gRPC as the recommended RPC framework and left SOAP servers to the community, which built CoreWCF on ASP.NET Core. Microsoft then started supporting CoreWCF in 2022.
| WCF | gRPC |
|---|---|
[ServiceContract] interface |
service in .proto |
[DataContract] |
message |
| Request/reply operation | Unary RPC |
| Duplex callback / streaming | Server, client or bidirectional streaming |
FaultException<T> |
RpcException with Status and rich error details |
| Message security (WS-Security) | TLS + JWT/mTLS |
NetTcpBinding speed |
HTTP/2 + Protobuf |
Caveats: gRPC needs HTTP/2 end to end (or gRPC-Web for browsers), and some proxies and load balancers handle long-lived HTTP/2 connections poorly.
dotnet tool install --global dotnet-svcutil and call it from a .NET 10 console app.BasicHttpBinding and NetTcpBinding, and call both..proto file and a gRPC service; compare payload sizes in Wireshark or Fiddler.[DataMember] to a contract and confirm an old client still works; then rename one and see it break.BasicHttpBinding versus gRPC with BenchmarkDotNet or a load tool such as bombardier.A WCF contract on .NET Framework, the same contract hosted with CoreWCF on .NET 10, and the gRPC equivalent.
// Before (.NET Framework 4.8): WCF service contract
using System.Runtime.Serialization;
using System.ServiceModel;
[ServiceContract(Namespace = "http://contoso.com.au/orders/2014")]
public interface IOrderService
{
[OperationContract]
[FaultContract(typeof(OrderFault))]
OrderDto GetOrder(int orderId);
}
[DataContract]
public class OrderDto
{
[DataMember] public int Id { get; set; }
[DataMember] public decimal Total { get; set; }
}
[DataContract] public class OrderFault { [DataMember] public string Reason { get; set; } }
// After option 1 (.NET 10): same contract hosted with CoreWCF, so SOAP clients don't change
// dotnet add package CoreWCF.Http ; dotnet add package CoreWCF.Primitives
using CoreWCF;
using CoreWCF.Configuration;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddServiceModelServices();
builder.Services.AddSingleton<OrderService>();
var app = builder.Build();
app.UseServiceModel(sm =>
{
sm.AddService<OrderService>();
sm.AddServiceEndpoint<OrderService, IOrderService>(
new BasicHttpBinding(BasicHttpSecurityMode.Transport), "/OrderService.svc");
});
app.Run();
// The contract types are the same shape, using CoreWCF's attributes
[ServiceContract(Namespace = "http://contoso.com.au/orders/2014")]
public interface IOrderService
{
[OperationContract] OrderDto GetOrder(int orderId);
}
[System.Runtime.Serialization.DataContract]
public sealed class OrderDto
{
[System.Runtime.Serialization.DataMember] public int Id { get; set; }
[System.Runtime.Serialization.DataMember] public decimal Total { get; set; }
}
public sealed class OrderService : IOrderService
{
public OrderDto GetOrder(int orderId) => new() { Id = orderId, Total = 129.95m };
}
// After option 2: gRPC contract for internal callers (orders.proto)
syntax = "proto3";
option csharp_namespace = "Orders.Grpc";
service OrderService {
rpc GetOrder (GetOrderRequest) returns (OrderReply);
}
message GetOrderRequest { int32 order_id = 1; }
message OrderReply { int32 id = 1; string total = 2; } // decimal sent as string to avoid precision loss
System.ServiceModel.Http, .NetTcp, .Primitives) are supported and dotnet-svcutil generates proxies. Instead: Separate client support (yes) from server support (CoreWCF or replace).decimal to a Protobuf double when moving to gRPC. Why it is wrong: Money loses precision. Instead: Use a string or a units-and-nanos message.int.MaxValue. Why it is wrong: It opens the service to memory exhaustion attacks. Instead: Set size limits to what the contract really needs.PerSession instancing and throttling when diagnosing timeouts. Why it is wrong: Sessions on wsHttpBinding plus default throttles queue calls under load. Instead: Check InstanceContextMode and ServiceThrottlingBehavior, and prefer PerCall.WCF migrations go wrong when they are treated as a technology swap rather than a contract change. The contract is what clients depend on: operations, data contracts, fault contracts and any message contracts that shape SOAP headers. If you own every client, moving to gRPC or REST is a normal refactoring. If a bank, a government agency or a vendor owns the client, their change cycle is your constraint, and CoreWCF (or leaving that one service on .NET Framework) is often the cheapest honest answer. Security needs separate thought: services that rely on WS-Security message-level signing must be checked against what CoreWCF supports, while gRPC and REST move you to transport security (TLS, mTLS) plus tokens. Before deciding, turn on WCF message logging and tracing on the old service for a representative period and read the traces in SvcTraceViewer: they show which operations, bindings and security modes are really used.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| CoreWCF | External SOAP clients you can't change | Low code change; stays on SOAP | You need features CoreWCF doesn't implement |
| gRPC | Internal .NET or polyglot service calls | Medium; new contracts, HTTP/2 infrastructure | Browser clients without gRPC-Web, old proxies |
| REST + OpenAPI | Public, browser, mobile clients | Medium; redesign around resources | Chatty internal RPC with streaming |
| Leave on .NET Framework | Rarely changed service, Windows hosting OK | Low now | Active development or Linux hosting required |
Pull the business logic out of the WCF service class into a plain application service. Host it on .NET 10 behind two front doors: a CoreWCF endpoint with the identical namespace, WSDL and binding for the partner, and a gRPC service for internal callers. Check first that CoreWCF supports the bindings and behaviours you use (some WS-* features and session settings need adjustment). Carry security across explicitly: the partner's transport or message security and credentials on the CoreWCF side, TLS plus JWT or mTLS for internal gRPC callers. If the service uses WCF sessions (PerSession), make it stateless or move state to a store first. Prove the SOAP contract unchanged by diffing the WSDL and replaying captured partner requests. Move internal callers to gRPC one at a time behind a feature flag, comparing results in Application Insights, and retire the old host when its traffic is zero.
Generate a proxy with dotnet-svcutil (or Connected Services in Visual Studio), which adds the System.ServiceModel.* packages. Gotchas: there is no app.config, so bindings and endpoints are set in code (or your own configuration); the generated operations are async (Task-returning), so call them with await rather than blocking; create and close clients properly (or reuse a ChannelFactory<T>) to avoid leaking connections; set message size limits and timeouts explicitly. Security needs checking up front: transport security (HTTPS, client certificates, Windows auth) is well supported, but WS- message security* on WSHttpBinding is only partly supported in the .NET client, so confirm the service's security mode and any WS-Security requirements. Test with recorded request/response pairs or a stub service so contract changes are caught in CI.
Last updated 23 Nov 2026.