.NET Tips: WCF
back to content
GENERAL:
-
In a typical Enterprise system only 1 percent of all clients make concurrent calls (a high-load Enterprise system has 3 percent of concurrent calls). If your system can concurrently sustain only 100 expensive service instances, this means it can typically serve as many as 10,000 outstanding clients
INFO:
-
The type visibility has no bearing on WCF, because visibility is a CLR concept.
-
WCF provides unique model regardless the location of the client.
WCF maintains the same programming model, remote programming model of instantiating and using a proxy, for the local and remote cases. This approach simplifies the application programming model, which allows to switch locations without affecting the client
On the client side the proxy serializes the call stack frame to the message and sends the message down a chain of channels. The last client channel is transport channel, which sends the message to the host
On the host side the first channel is the transport channel, which receives the message from the transport. The last channel is is the dispatcher channel, which convert the message to a stack frame and calls the service instance.
There are a several subsequent channels between the proxy/transport on client and between the transport/dispatcher on the host, number of which mostly depends on the binding.
- TransactionFlow property is not published in the service metadata, so you need to edit the client's config manually.
- When you have a hierarchy of the ServiceContracts here is no Is-A relationship between the proxies on the client, which can lead to the design issues.
To have the pure Is-A relation you need to refactor the client proxy that way, that only the proxy implements the top most base contract derives directly from ClientBase<T>, providing it as a type parameter with the bottom most subinterface. All the other proxies derive from the proxy immediately above them and the respective contract.
- Transport-level session is not maintained over BasicHttpBinding, you need to use WS binding
- TransactionOption.Disabled allows component to be activated in the caller's context TransactionOption.NotSupported creates component in separate contex.
- Extended admin attibutes for COM+ component are available via COMAdmin.dll
- new The maximum number of concurrent sessions, the overall number of outstanding clients that have a session at the transport level is 10.
- new Maximum number of concurrent calls, the total number of calls currently in progress across all service instances is 16
TIPS:
- A type marked only with the DataContract attribute cannot be serialized using the legacy formatters. If you want to serialize the type, you can apply both the DataContract attribute and the Serializable attribute.
- Using a config file to declare a known type is the only way to add a known type if that known type is internal to another assembly.
back to content
