WebSockets with WCF

Notification & “Duplex communication” are important scenario over the internet but firewalls and browser limitations makes them very hard to implement. In the browser world, tricks like long polling is commonly used to implement server-push requirements. For non-browser scenarios relay technologies like Azure Service Bus overcome the lack of inbound connectivity by creating a relay…


Pub/Sub with WCF (Part 2)

Source Code Download Service Bus May CTP has a small glitch when it comes to pub/sub messaging using the WCF programing model. The May CTP API out-of-box doesn’t pick up filter/promoted properties from the WCF data contracts and requires you to explicitly specify these properties on the BrokeredMessage object outside of core WCF programing model…


Pub/Sub with WCF (Part 1)

In yesterday’s post I have explored how to use Service Bus queues as a transport to communicate between a WCF client and a service. In today’s post I will show you WCF pub/sub messaging using the topics and subscriptions. A subscription behaves exactly like a queue for reads while a topic behaves exactly like a…


WCF with Service Bus V2: Queues

May CTP of Service Bus introduced tons of new messaging capabilities including Queuing and Topic based pub/sub messaging. Check out Clemens post for an overview. The usage of Service Bus messaging entities (Queues, Topics) is divided across two namespaces – a ‘Management Namespace’ and a ‘Runtime Namespace’. Management namespace is used to create/define messaging entities…


Initializing Auto-Start WCF/Workflow Services

AppFabric AutoStart feature is built on top of IIS 7.5 AutoStart feature. IIS 7.5 provides an extensibility point where you can specify your custom initialization providers which will be executed as part of application start-up and gives you the ability to perform costly initialization. For example, pre-populating an AppFabric cache. Windows Server AppFabric uses this…


WCF Reliable Messaging Retransmission Algorithm

  When configuring WS-Reliable messaging, you would notice that even though number of retries (MaxRetryCount) is configurable but the interval in which retries are attempted is NOT configurable.  This is because WCF uses an exponential back-off congestion control algorithm to calculate the retry timeout.  This algorithm is internal to WCF and is NOT configurable. The…


PasswordDigest authentication in WCF

WS-Security UsernameToken Profile describes how a client can authenticate to a web service using a “username” and a password. Two variations of the password are defined as part of the specification which includes “PasswordText” and “PasswordDigest”. Neither WCF nor WIF out of box support “PasswordDigest” however there are some interop scenarios which might require “PasswordDigest”….


Creating Objects Without Calling the Constructor

When you use the new operator to create an instance of a class, the class constructor is called before the reference to the newly created object is returned. This also applies to the reflection scenarios where you call Activator.CreateInstance, which finds the right constructor based on the number, order and type of the parameters provided….


Custom ServiceHostFactory for a XAMLX based Service

For IIS/WAS hosted services backed by a physical .SVC file (WCF 3.0/3.5) you can specify a custom ServiceHostFactory in the .svc file as part of service specification. There is no such declaration for XAMLX files and instead you can use config-based activation feature to achieve the same result. If my WCF service is deployed as…


Adding Dynamic methods to a WCF Service

Someone asked me if it’s possible to add a Ping method to every service contract without repeatedly defining it in each service contract?  The answer is yes & and it’s fairly simply too. Here I have a LoginService, which require that implicit Ping method (DateTime Ping(){})like all other service. [ServiceContract] class LoginService {     [OperationContract]…