please check the below example
namespace GServices
{
[ServiceKnownType(typeof(SearchType))]
[ServiceContract(SessionMode = SessionMode.Allowed)]
public interface ITest
{
[OperationContract]
int subtract(int x, int y);
}
[ServiceKnownType(typeof(SearchType))]
[ServiceContract(SessionMode = SessionMode.Allowed)]
public interface ITest2
{
[OperationContract]
int add(int x, int y);
}
public class G : ITest2, ITest
{
public int add(int x, int y)
{
return x + y;
}
public int subtract(int x, int y)
{
return x + y;
}
}
}
ITest has subtract() method and Itest2 has add() method.
Both are implemented by one concrete class called G.
If i just want to expose the ITest through WCF, I have following endpoint config
<service name="GQS1" behaviorConfiguration="GQwcfBehaviour">
<endpoint address="DP2Svcs" binding="wsHttpContextBinding" bindingConfiguration="wsHttpEndpointBindingConfig" contract="GServices.itest">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</service>
when i run this service and check the wsdl, I can see that the methods which are in itest2 also appeared in wsdl. in this example case , subtract() method should only be exposed. But add() method is also exposed.
My requirement is to have methods in ITest Interface should only exposed. in this case , i want to expose only subtract() method which is declared in ITest. But both of their implementation resides in Only one concrete class "G". What am I missing here?
Edit : I have given my Service.svc file content :
<%@ ServiceHost Language="C#" Debug="true" Service="GServices.G" %>
G
orITest
– MathieuGServices.ITest
notGServices.itest
? – Mathieu