REST and Service Bus Relay Programming Lifecycle
Updated: January 7, 2015
This walkthrough illustrates how to use REST-style Web service applications that use Microsoft Azure Service Bus. The example uses the Windows Communication Foundation (WCF) Web programming model to create and register a REST-style Web service for use with Service Bus, and then creates a REST client that invokes the REST service through Service Bus.
The basic tasks required to create an application that accesses the Service Bus using the REST architecture model are as follows:
- Create the Service Bus project and the service namespace. The project and service namespace contain the resources to support your application. For more information, see Creating a .NET Services Account. REST applications must have a Service Bus project and namespace created by using the Azure management portal or the New-AzureSBNamespace PowerShell cmdlet.
- Define the Service Bus contract. For more information, see Designing a WCF Contract for Service Bus.
- If you are registering a REST-based service endpoint, you must implement the contract in the previous step. The important point here is that the information passed through the interface must be in a format that is transmittable by a REST-style service, for example, a stream.
- Configure the service by specifying endpoint information and other behavior information. For more information, see Configuring a WCF Service to Register with Service Bus. For a full Service Bus application that supports the REST protocol, the main difference is that the application must use a binding that supports the REST protocol, such as WebHttpRelayBinding. However, other than that restriction, the actual configuration is identical to any other WCF application that uses Service Bus.
- Build and run the service. For more information, see Building a Service for Service Bus. For more information about creating a Service Bus service that supports the REST protocol, see How to: Create a REST-based Service that Accesses Service Bus.
- Build a client application. For more information, see Building a Service Bus Client Application.