So been a few days now learning about web references within my projects I have now came across a strange problem.
Using a simple console app I did this:
namespace Webservices09004961
{
class Program
{
static void Main(string[] args)
{
{
Convert.ConvertTemperatureSoapClient client =
new Convert.ConvertTemperatureSoapClient();
while (true)
{
Console.Write("Enter temperature in Celsius: ");
double tempC = double.Parse(Console.ReadLine());
double tempF = client.ConvertTemp(tempC, Convert.TemperatureUnit.degreeCelsius, Convert.TemperatureUnit.degreeFahrenheit);
Console.WriteLine("That is " + tempF + " degrees Farenheit");
}
}
}
}
}
I have added in the service reference “Convert” related to this link:
http://www.webservicex.net/ConvertTemperature.asmx?WSDL
However I get this error:
An endpoint configuration section for contract ‘Convert.ConvertTemperatureSoap’ could not be loaded because more than
one endpoint configuration for that contract was found. Please
indicate the preferred endpoint configuration section by name.
Is this because you can only have one service reference allocated at any one time? The reason I ask is because my local service reference within the same project build still works fine? Yet this one doesnt? (It did when I first created it)
Or is this a seperate problem?
Also what are the limitations on SOAP?
This errors are common when you try to remove a svc reference and add it again. Check your app/web.config file, you should have duplicate entries for Convert.ConvertTemperatureSoap. remove one of them and it will work fine.