tags:

views:

130

answers:

2

How to host multiple service contracts in IIS. example , I have 3 different service contracts in my project and implements in three different class's. First I host a service contract in IIS with SVC file, now i want o host the another service in the same service. is it possible?

or

How to expose multiple service contracts in a single service (svc file) , is it possible?Please give me some inputs for this solution.

+1  A: 

Yes. Your .svc file refers to the service class. This class can implement multiple service contracts, simply by listing them. Abbreviated example:

[ServiceContract]
public interface ICalculator // ...

[ServiceContract]
public interface IHelloWorld // ...

public MyMultiContractService : ICalculator, IHelloWorld // ...

<%@ServiceHost language=c# Debug="true" Service="MyMultiContractService"%>
John Saunders
A: 

If you are not aware already here is a nice screencast series on WCF.

http://msdn.microsoft.com/en-us/netframework/wcf-screencasts.aspx

Jeffrey Hines