Close

Host WCF service in Azure

It’s possible to host a WCF service in Azure.

  • Add a service reference to your WCF Service in a class library or another test project. Open the reference till you find file Reference.cs. Copy this file to a safe location
  • Create a class library for the data contracts. Copy the data contracts from the Reference.cs file.
  • Add an ASP.Net Web Application. Use the Empty Web App template (don’t select WebApi or MVC). Add a directory named ServiceContract. Next add two class file, for instance IDSPService and DSPService. Copy the interface definition from the Reference.cs file. Implement the interface in the service file named DSPService. To start off with, just add public to the method signatures and return an empty response.
  • Add a service (*.svc file) and reference the service contract just created. The .svc file has just one line:

<%@ ServiceHost Service=”DSPGateway.ServiceContract.DSPService” %>

That’s it!

Leave a Reply

Your email address will not be published. Required fields are marked *