Click here to Skip to main content
15,881,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am getting this error on server error details is below

C#
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

C#
                    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
C#
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.
Posted
Updated 4-Mar-16 4:01am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900