Using Web Links

So, after a few days, learning about web links in my projects, I ran into some strange problem.

Using a simple console application, 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 added a link to this link in the "Convert" link: http://www.webservicex.net/ConvertTemperature.asmx?WSDL

However, I get this error:

The endpoint configuration section for the "Convert.ConvertTemperatureSoap" contract could not be loaded because more than one endpoint configuration was found for this contract. please indicate the preferred endpoint configuration section by name.

Is it because you can only have one service link allocated at any given time? The reason I'm asking for is that my local help desk within the same build of the project is still working fine? But is that not so? (That was when I first created it)

Or is this a separate issue?

Also what are the limitations on SOAP?

+6
source share
2 answers

These errors are common when you try to remove the svc link and add it again. Check the app / web.config file, you should have duplicate entries for Convert.ConvertTemperatureSoap. delete one of them and it will work fine.

+10
source
  <endpoint address="http://www.webservicex.net/ConvertTemperature.asmx" binding="basicHttpBinding" bindingConfiguration="ConvertTemperatureSoap" contract="Convert.ConvertTemperatureSoap" name="ConvertTemperatureSoap" /> <!--<endpoint address="http://www.webservicex.net/ConvertTemperature.asmx" binding="customBinding" bindingConfiguration="ConvertTemperatureSoap12" contract="Convert.ConvertTemperatureSoap" name="ConvertTemperatureSoap12" />--> 

Well, I found that the error is due to a double entry in my configuration file. Strange I do not know why this happened.

It works now.

0
source

Source: https://habr.com/ru/post/910192/


All Articles