Thank you, Kumarbs. I am still receiving the error message with the following config and code:
My new
WebAPI config is:
<system.servicemodel>
<client>
<endpoint name="RCWindsSvc.Service1">
contract="RCWindsSvc.IService1"
binding="webHttpBinding"
address="http://localhost:15021/RCWinds.svc">
</endpoint>
</client></system.servicemodel>
Code snippet:
public class RCWindsExtSvcController : ApiController
{
public String[] GetStationNames()
{
ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();
fileMap.ExeConfigFilename = "web.config";
Configuration newConfiguration = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);
ConfigurationChannelFactory<rcwindssvc.iservice1> factory1 = new
ConfigurationChannelFactory<rcwindssvc.iservice1>("RCWindsSvc.Service1", newConfiguration, new EndpointAddress("http://localhost:15021/RCWinds.svc"));
RCWindsSvc.IService1 client1 = factory1.CreateChannel();
IEnumerable<string> stationNames = client1.GetStationNames();
return stationNames.ToArray();
}
}</string></rcwindssvc.iservice1></rcwindssvc.iservice1>
Thank you.