Pramod Thakur

Pramod Thakur

  • 274
  • 6.8k
  • 2.3m

Issue with implementing multiple service in wcf

Jul 24 2014 3:43 AM
Hi,

i have a issue with implementing multiple service in wcf.. i hv following code

[ServiceContract]
public interface IMultipleService
{
[OperationContract]
string DoWork();
}

[ServiceContract]
public interface IMultiplePublicService
{
[OperationContract]
string DoPublicWork();
}

[ServiceContract]
public interface IMultipleConfidentialService
{
[OperationContract]
string DoConfidentialWork();
}

// Service implementation

public class MultipleService : IMultipleService,IMultiplePublicService,IMultipleConfidentialService
{

public string DoWork()
{
return "Method1 : DoWork called !!";
}

public string DoPublicWork()
{
return "Method2: DoPublicWork called !!";
}

public string DoConfidentialWork()
{
return "Method3: DoConfidentialWork called !!";
}
}

If i write [ServiceBehaviorAttribute(InstanceContextMode = InstanceContextMode.PerCall)] so all service contract implement PerCall session mode. I want to impliment IMultipleService as PerCall sessionmode, IMultiplePublicService as PerSession and IMultipleConfidentialService as Single..

Please help..?

Answers (1)