In web.config of your service application, aspnetcompatibility needs to be enabled
<system.sewerviceModel>
<serviceHostingEnvironment aspNetCompatibiltyEnabled="true"/>
</system.serviceModel>
2. Add the following line to the class that implements your service interface
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
AspNetCompatibilityRequirementsMode enum has three values, Allowed NotAllowed and Required.