简体   繁体   English

在 VS 2017 15.9.14 windows 窗体应用程序中添加服务引用

[英]Adding a service reference in VS 2017 15.9.14 windows forms application

I am trying to add a asmx web service to one windows forms app by following way -> Right click- > add service reference.我正在尝试通过以下方式将 asmx Web 服务添加到一个 Windows 窗体应用程序 -> 右键单击​​ -> 添加服务引用。 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?或者我们应该使用 web 引用而不是 windows 窗体应用程序的服务引用?

To answer this question you need to know the difference between Webservice and WCF web service and you'll find that Here.要回答这个问题,您需要了解Web 服务WCF Web 服务之间的区别,您会在此处找到

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.无论如何,我不是规范行为,让我们形成换句话说,服务引用将让您与基于 WCF 的服务进行通信,无论这些服务是什么,但是使用 Web 引用,您只能在某些条件下与 Web 服务进行通信. I would use service reference always because it gives more options including those in web service, and it's the new-easy way.我会一直使用服务引用,因为它提供了更多选项,包括 Web 服务中的选项,而且这是一种新的简单方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM