Basic Service Bus Programming Lifecycle
Updated: July 1, 2015
Service Bus enables web service applications to expose their functionality to clients through firewalls and on different application platforms. This topic outlines the tasks that are required to build an application that uses Service Bus to expose its functionality to clients. For a working sample application, see the Service Bus Relayed Messaging Tutorial.
The tasks required to create a Windows Communication Foundation (WCF) application that accesses Service Bus are as follows. If you are hosting in Microsoft Azure, see Azure and Service Bus Programming Lifecycle. If you want to use a REST-style application with Service Bus, see REST and Service Bus Relay Programming Lifecycle.
- Create a service namespace. This service namespace creates a named scope within which Service Bus creates resources to support Web services regardless of how or where they are originally hosted. For more information, see Managing Service Bus Service Namespaces.
- Define the service contract, whether using WCF or using HTTP programming directly in the .NET Framework. A contract specifies the signature of the service, the data it exchanges, and other required inputs, behavior specifications, and object invariants. For more information, see Designing a WCF Contract for Service Bus.
- Implement the contract. To implement a service contract, create a class that implements the interface and specify custom runtime behavior.
- Configure the service by specifying endpoint and other behavior information. For more information, see Configuring a WCF Service to Register with Service Bus.
- Build and run the service. For more information, see Building a Service for Service Bus.
- Build and run the client application. For more information, see Building a Service Bus Client Application.
As with any iterative, service-oriented software development, it may not always be appropriate to follow the previous steps sequentially, or even start from step 1. For example, if you want to build a client for a pre-existing service, start at step 5. Or, if you are building a host service that others will use, you can skip step 6.