SharePoint 2007 provided the capability to add custom ASMX web services. Web Services could be deployed to the LAYOUTS folder, or could be deployed to the ISAPI folder, and supported accessing site settings and list data under the SharePoint user context. Since SharePoint 2007 was built on the ASP.NET 2.0 model, it did not natively support web service enhancements that were introduced with Windows Communication Foundation (WCF) in .NET Framework 3.0 and 3.5 or the additional WCF-based service frameworks like ADO.NET Data Services (now WCF Data Services).
For those familiar with writing custom ASMX services for 2007, there were some pitfalls. Since SharePoint requires dynamic service endpoints (the ability to call the web service using any site-relative virtual path under the /_vti_bin/ folder), you had to hand-tool a special ASPX page file to generate the WSDL that included script to generate the dynamic endpoint. Not terribly complicated, but certainly tedious, and a potential source for errors. For more information on writing a custom SharePoint 2007 ASMX web service see: Walkthrough: Creating a Custom Web Service.
The good news is that SharePoint 2010 is based upon ASP.NET 3.5, and now supports WCF custom services including SOAP, REST, and WCF Data Services. The even better news is that is makes it easy to deploy custom WCF services with dynamic endpoints by providing a set of Service Host Factory implementations. This means it is not necessary to modify the SharePoint web.config to deploy your service endpoint configurations. In this article, I will walkthrough and highlight the important aspects of the SharePoint 2010 support for custom WCF services.