Click here to Skip to main content
13,147,376 members (28,034 online)
Click here to Skip to main content
Add your own
alternative version


5 bookmarked
Posted 15 May 2009

Windows Azure, TDS, WCF, Silverlight and a Few Problems on the way Part III - The Azure Project, and Creating Our Web Service

, 17 May 2009
Rate this:
Please Sign up or sign in to vote.
The Azure project and creating our web service

So far, Parts I & II have not given us anything new – the code will work happily in an ASP.NET or a traditional client application. Now we get to a more interesting bit – creating our Azure Project.

Before we can create an Azure Project, you will eventually have to go to the Azure Website – and download the Azure tools from here.

Once you have installed these on your development PC, you can now create an Azure Project. You will notice that I have not suggested signing up even for a CTP account. The reason is that you can do your development locally – the Azure tools create a kind of mini-Azure on your development PC. This makes little difference now, but when the service is charged for, it will make a difference.

To create an Azure Project, look under your chosen language (C# or VB.NET) and select the ‘Cloud Service’ leaf. Then choose the required template. Normally, I picked the ‘Web And Worker Cloud Service’ – this is because I invariably need both a web and worker role. Indeed this project, we will have both. Below:


And that is it. We now have an Azure Project, that can be run locally to test it.

The Web Service

Now the Azure project will eventually have a Silverlight frontend and that creates a small problem. Silverlight is designed to be a lightweight download and for this reason it uses a subset of the full .NET runtime. This means many of the functions that one might take for granted. To allow us the use of the full .NET runtime, these are placed behind a WCF web service.

To create a web service, you can host it within your Web role. So right-click on the Web role project and select ‘Add’, then ‘New item’.


This will display the above window – select the WCF Service, and give it name, then click on the ‘Add’ button.

This creates your Web Service, but we are not finished. Silverlight requires that a Web Service use basic binding. So change the binding of the service double click on the Web.config of the Web Role. Finding the <services> tag. Make sure the ‘binding’ attribute is changed to basicHttpBinding. The following code shows what the section should look like:

    <service behaviorConfiguration="NewsMashup_WebRole.NewsMashupServiceBehavior"

        <endpoint address="" binding="basicHttpBinding" contract="NewsMashup_WebRole.INewsMashupService">
                <dns value="localhost" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

So this sets up our Azure project, and our web service.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Paul S. Chapman
Software Developer (Senior) Simplicita Online
United Kingdom United Kingdom
UK based IT Consultant. Started in 1985 selling home computers such as the Sinclair ZX Spectrum, BBC Model B and Commodore 64, and in 1987 moved into development, starting first with Torch Computers, developing software for the XXX UNIX Workstation.

Currently developing a new Azure/Silverlight based website/desktop applications for a new startup, hoping to launch in late 2009/early 2010

You may also be interested in...


Comments and Discussions

GeneralSome comments Pin
Hans Dietrich15-May-09 14:58
mvpHans Dietrich15-May-09 14:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.170915.1 | Last Updated 17 May 2009
Article Copyright 2009 by Paul S. Chapman
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid