Can you open XML web services from a Windows Forms application?

This may sound like a silly question, but when I look for web services, I don't get any information on how to create them in a Windows forms application.

The only result is to create and expose them by creating an .aspx page.

So my questions are: can you create and publish web services in a Windows forms application or are they somehow related to .asp pages?

Thanks!

edit later: Is there an example of creating a web service in a .cs file, not a .aspx file?

+4
source share
3 answers

I would like to say that WebService is the service interface in your application, and not the application itself.

To publish WebService in a hosting environment other than IIS (where your ASP.Net pages are located), you can use the following:

If you use Microsoft's WCF toolkit, that means; Create a "ServiceHost" (the actual class name) that can host your webservice implementation. This can be done in any application (ASP.Net, Winform, NT Service pages, and even a console application).

Hope this helps,

+2
source

Firstly, this is not a stupid question.

are they somehow related to the .asp page?

Web services are not tied to any other application. WebService is could like the application itself. You can create a WebService as part of a solution that any other type of application can have, such as Asp.Net WebApplication or another application.

You can use the Webservice form for any of the following, but not limited to

  • Console application
  • Asp.Net Web Application
  • Windows Forms Application

This article may help.

+1
source

Traditionally, .net Web Services have been implemented using asm.net asmx files hosted in iis. With .net 3, WCF appeared, which allows you to use a number of different types of services (and not just web services) in a number of .net applications and services, and not just for iis. WCF is a complex and powerful set of technologies that I found this book to be useful

+1
source

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


All Articles