I am getting this error on server error details is below
System.InvalidOperationException: Could not find default endpoint element that references contract 'SurveyService.ISurveyManagementService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName, Configuration configuration)
at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
at System.ServiceModel.ConfigurationEndpointTrait`1.CreateSimplexFactory()
at System.ServiceModel.ConfigurationEndpointTrait`1.CreateChannelFactory()
at System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)
at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
at System.ServiceModel.ClientBase`1..ctor()
at ResponseApp.UI.Controllers.HomeController.AuthenticationCheck(String Email, String Password)
What I have tried:
I have tried to create endpoint in code like below
BasicHttpBinding binding = new BasicHttpBinding(System.ServiceModel.BasicHttpSecurityMode.None);
EndpointAddress epa = new EndpointAddress("servicelink");
SurveyManagementServiceClient _SurveyService = new SurveyManagementServiceClient(binding, epa);
after trying this i am getting error like below
The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8)
Note: Locally project working fine but on server, I am getting this error.