
The Problem Statement
Imagine that you have just built a sophisticated application to work against a SQL Server database. You followed a best-practices approach and separated out your presentation, business logic and data access layer. Your application is service oriented – … Continue reading
This article assumes some familiarity with the Factory pattern. The factory concept is equally useful for creating products (ProductFactory) or for creating services (ServiceFactory). A good way to start is to look at what the client really needs from the … Continue reading
Now that all the pieces are in place, we are ready to run our client program. The first error I encountered was
AddressAccessDeniedException: HTTP could not register URL http://+:8080/
What I needed was to provide local access to the address on … Continue reading
The subscriber needs to know about the service. We will use svcutil.exe to generate the proxy class for the subscribers to use.
Step 1 : Ensure Service Loads Ok
Use CRL F5 to start the Magazine service – it should start running … Continue reading
The purpose of the Event Generator code is to publish events (New Magazine Issue Available) that subscribers will get notified about.
Add a new Console App (Add New Project) to the WCFPublishSubscribe solution. Call it EventGenerator.
Copy over the app.config and … Continue reading
Our implementation is based on .NET events. The idea of publishing goes hand-in-hand with ‘raising an event’ – and the idea of subscribers goes hand-in-hand with consuming an event.
Our event based implementation thus consists of:
Defining an event
Defining an event … Continue reading
The Service code contains of an Interface and its implementation
The Interface defines all the capabilities of the service. What do we really want from a Publisher service?
A Publish method (called PublishMagazine)
A Subscribe method (to allow clients to subscribe to the … Continue reading
Imagine that you are a magazine publishing company. Your revenue depends on subcribers – in particular, happy subscribers. To ensure that your subscribers stay happy, one of the foremost services you need to provide is timely noticification whenever a new … Continue reading