Last post Jul 16, 2015 09:54 AM by Siva Krishna Macha
Jul 16, 2015 08:35 AM|Sundar1987|LINK
i am new to WCF.i have a doubt like
Why do we need ServiceContract/Interface in WCF?
Can't we create WCF without ServiceContract/Interface?
Could you please explain in details.
becouse we have a requirment to upgarde webservices to WCF.
Jul 16, 2015 09:54 AM|Siva Krishna Macha|LINK
I believe, you can create WCF services without using interfaces as well but ServiceContract is mandatory.
See this excerpt from MSDN:
To create a service, write a class that implements a Windows Communication Foundation (WCF) contract. You can do this in one of two ways. You can define the contract separately as an interface and then create a class that implements that interface.
Alternatively, you can create the class and contract directly by placing the
ServiceContractAttribute attribute on the class itself and the
OperationContractAttribute attribute on the methods available to the clients of the service.
Implementing Service Contracts
Also for reasons using interface: