0

Can we add webservice(.asmx) to window application.When i go through File->New Project-> i cant see webservice template for addind. But in File->New Web Site(for window application) we can easily add webservice

But when you go through this link codeproject.com/KB/webservices/… ,,there they are adding in window application side means File->New Project-> –

peter
  • 7,612
  • 20
  • 60
  • 107

2 Answers2

1

For a webservice to run, you need it to run under IIS, which your windows app isn't.

Do you want another app to be able to call a SOAP interface when your application is running? Then in that case I think you may want your app to start a windows service.

Neil N
  • 24,402
  • 16
  • 83
  • 143
  • But when you go through this link codeproject.com/KB/webservices/… ,,there they are adding in window application side means File->New Project-> – – peter Aug 05 '09 at 04:23
  • some thing... you should read the complete URL that you posted before assuming anything! – balexandre Aug 05 '09 at 06:05
0

Adding a Web Service in .NET...

You need to understand the wCF vs ASMX first, and for that I will point you to one of my answers regarding the subject.

What is the difference between an asp.net web method and a wcf service?

after knowing that, you will know that ASMX Web Services require IIS to live, and for that, you will only find the template of a ASMX Web Service in a Web site project.

You can off course create a WCF Service, and you can host it anywhere you want, in IIS, as a Windows Service, as a TCP/IP service, as ... everywhere :)

Witch I thing is what you are after.

There are plenty of Video Tutorials outthere regarding WCF Services so you can see how to make and consume one.

Community
  • 1
  • 1
balexandre
  • 71,373
  • 44
  • 228
  • 330
  • But when you go through this link http://www.codeproject.com/KB/webservices/myservice.aspx ,,there they are adding in window application side means File->New Project-> – peter Aug 05 '09 at 04:22
  • thats a "New Project", it will not be in your WinForm project!! and if you follow up, you will see that you need to set up IIS as I mention. – balexandre Aug 05 '09 at 06:05