1

I am trying to add a asmx web service to one windows forms app by following way -> Right click- > add service reference. But it seems the service is added under connected service folders only. not under service reference . Is this an expected behavior? or are we supposed to use web reference instead of service reference for windows forms application?

benz
  • 21
  • 4
  • It is a normal behavior, XML web service is also an implement of SOAP web service. In order to call this kind of web service, a client proxy class is generated in the reference.cs We can invoke the service as if it were a local method. ServiceReference1.WebService1SoapClient client = new WebService1SoapClient(); var result = client.HelloWorld(); Console.WriteLine(result); – Abraham Qian Feb 05 '20 at 10:08

1 Answers1

0

To answer this question you need to know the difference between Webservice and WCF web service and you'll find that Here.

Anyway, I'ts a noraml behavior, let's form that in another words, the Service reference will let you communicate with a WCF-based services whatever those services are, but with the web reference, you can only communicate with web services under some conditions. I would use service reference always because it gives more options including those in web service, and it's the new-easy way.

Warios
  • 189
  • 15