📎 Webclip
Two Models of Distributed Communication
In early .NET distributed development, developers often chose between .NET Remoting for intra-enterprise, .NET-only scenarios and ASMX web services for cross-platform or cross-organization communication. Beneath this guidance sat a deeper contrast between distributed objects that try to resemble local method calls and services that emphasize message-based contracts. Over time, .NET Remoting stayed in the framework but lost its role in modern .NET, while WCF emerged to unify multiple communication styles, even as simpler HTTP-based APIs grew in appeal.
Reading notes#
- Early 2000s .NET developers picked communication tech based on deployment: crossing the internet or strict firewalls favored web services, while intra-LAN .NET-to-.NET scenarios often used .NET Remoting.
- ASMX, SOAP, and WSDL gave a standardized way to expose operations, describe service contracts, and exchange messages that other platforms could understand.
- .NET Remoting targeted communication between managed applications using channels and formatters, acting as a managed alternative to DCOM for cross-domain, cross-process, and cross-machine calls.
- Microsoft’s guidance was to use web services across organizational and platform boundaries and Remoting for performant communication between .NET applications in controlled environments.
- This practical guidance hid a more fundamental question: whether distributed communication should be modeled as remote objects invoking methods or as services exchanging messages through contracts.
- In Remoting, channels determined how messages traveled: the TCP channel used sockets for direct .NET endpoint communication, while the HTTP channel relied on HTTP and fit better with HTTP-permitting infrastructure.
- Neither TCP nor HTTP was universally suitable: TCP could work through firewalls with proper rules, and HTTP could still be blocked by proxies or network policies.
- Formatters controlled message representation: the binary formatter targeted compact communication between .NET applications, while the SOAP formatter used SOAP/XML but did not turn Remoting into a standard web service.
- Remoting’s SOAP formatter still followed an object-oriented invocation model with remoting-specific expectations, limiting general cross-platform interoperability.
- Combining channels and formatters gave configuration flexibility; for intranet scenarios, TCP with binary formatting could avoid the overhead of HTTP and XML seen in many SOAP-based paths.
- Remoting’s programming model aligned with .NET objects, letting developers expose remotable objects either by reference or by value, with each choice defining a different client relationship.
- Marshal-by-reference kept the real object on the server and gave the client a transparent proxy that forwarded method calls back to the server-side instance.
- This model resembled ordinary object-oriented code: proxies made remote objects appear local, but the network boundary and its consequences still applied.
- Marshal-by-value serialized a serializable object and reconstructed it on the client, giving a local copy whose changes did not automatically propagate back to the server.
- The customer-details example illustrates marshal-by-value: the client can modify a local copy’s address, but the server’s original object stays unchanged unless updates are explicitly sent.
- Marshal-by-value behaved as designed; problems came when developers assumed objects crossing a boundary would behave like local references to a shared instance.
- The difference between local and remote calls was crucial: local calls avoid network latency and mid-operation connection failure, while remote calls can be delayed, interrupted, or fail after server work.
- Remoting improved convenience for remote interaction but did not erase the network seam; ignoring that seam often led to surprises in real deployments.
- ASMX web services adopted different trade-offs, centering on HTTP and XML-based messaging rather than pluggable channels and formatters.
- With ASMX, developers exposed operations at a web service endpoint and let the framework map method parameters and return values to SOAP messages.
- ASMX’s approach often simplified deployment and interoperability, as long as clients on other platforms supported the relevant SOAP protocols and data types.
- HTTP transport made ASMX friendlier to many enterprise networks than custom TCP endpoints, though HTTP still could be restricted by firewalls and proxies.
- ASMX did not aim to expose distributed objects with identity and lifecycle matching local objects; instead it exposed operations.
- The
[WebMethod]attribute marked methods as web service operations, and the framework handled serialization and deserialization of messages. - Client proxies could still present method-call syntax, but the true contract lay in service operations and exchanged data, not in remote objects behaving like local ones.
- Similar method syntax could hide two models: proxy-based interaction with a remote object, or sending a message requesting a service operation.
- The service-oriented approach emphasized explicit contracts and interoperable messages, supporting communication across organizational and technological boundaries.
- Problems arose when an internal Remoting-based service later needed to be consumed externally or by partners, turning the initial choice into a constraint.
- Switching between Remoting and ASMX was possible but could involve altering service interfaces, client proxies, serialization, deployment, and error handling, since they were not interchangeable implementations of one contract.
- Architecturally, Remoting extended the distributed-object lineage of COM/DCOM, while ASMX focused on service operations and message exchange, encouraging different ways of thinking about boundaries.
- Coexistence of both technologies reflected a period before the industry converged on a common model for distributed communication.
- For some time, .NET developers had both options available, and the real challenge was understanding what boundary the application needed and what assumptions the communication model imposed.
- .NET Remoting stayed in the .NET Framework for years, supporting existing applications that depended on it in environments running compatible framework versions.
- Modern .NET no longer treats Remoting as a supported general-purpose remoting solution, so new applications must use other cross-process and cross-machine communication mechanisms.
- WCF (Windows Communication Foundation) emerged as an alternative that covered many Remoting scenarios, with features like NetTcpBinding for TCP communication within a unified service model.
- WCF supported multiple transports and messaging styles through bindings and configurations, reducing the need for separate frameworks for each communication scenario.
- Despite this, WCF was not a drop-in replacement for every Remoting app; code relying on transparent remote references, specific activation, or particular serialization often needed substantial redesign.
- Some requirements formerly handled by Remoting are now better met by HTTP APIs, messaging systems, or custom protocols, depending on scenario.
- Remoting’s legacy faded gradually: some systems migrated, some were rewritten, and others continued on .NET Framework, but it ceased to be part of the modern supported communication model.
- WCF’s goal was to unify several connected-application approaches under one programming model, which could be daunting for developers already familiar with COM, DCOM, ASMX, and Remoting.
- New frameworks like WCF brought promises of simplification but also new concepts, configuration styles, and migration costs that varied with existing codebases.
- WCF introduced service contracts, operation contracts, endpoints, and configurable communication, covering SOAP services, TCP, named pipes, and message queuing under one umbrella.
- It also addressed enterprise concerns such as security, reliable messaging, and transactions, packaging them into the same framework.
- The ABC model (address, binding, contract) provided a way to separate where a service lived, how communication occurred, and what operations/data it exposed.
- In principle, ABC meant a binding change could alter transport or protocol without redesigning the service contract, if the new binding still met the same requirements.
- This unification came with complexity: supporting diverse transports, encodings, security modes, reliability options, and enterprise features created a substantial learning curve.
- Developers often had to understand bindings, behaviors, endpoints, and configuration details before addressing domain-specific problems.
- WCF responded to genuine enterprise needs and offered a powerful service-oriented architecture, with its complexity partly reflecting the breadth of problems it targeted.
- At the same time, simpler ideas for distributed communication gained popularity, such as web APIs and lightweight HTTP-based services.
- The discussion shifted from only remote objects versus web services to questions about how much built-in infrastructure a distributed app needed and which capabilities should remain optional.
- The article closes by signaling a following part that will examine WCF’s protocols, the enterprise integration challenges it tackled, and how its pursuit of completeness began to feel burdensome.
