views:

233

answers:

5

I'm implementing a server component that needs to expose a web-service interface, but there is no application need for it to run with ASP.NET on IIS. Is there a straightforward way to implement Web Services in .NET without ASP.NET/IIS? (I'm using .NET 3.5 / C# 3.0)

+3  A: 

Yes use ServiceHost.

sipwiz
Thanks! Now I'm embarrased that I didn't see that. :-)
dcw
+4  A: 

As long as you're using a verson of .Net that supports it, you should be looking at the Windows Communication Foundation (WCF). You'll need SOME process to host these services, so if you don't use IIS, you may end up writing your own EXE to host the service, but that's where you should start.

http://msdn.microsoft.com/en-us/library/ms731082.aspx

http://msdn.microsoft.com/en-us/netframework/aa663309.aspx

David Stratton
+4  A: 

If you use WCF (Windows Communication Foundation), which has pretty much superceded Web Services, you can host in a Windows Service or in IIS.

Mitch Wheat
+4  A: 

You can use the ServiceHost class to host a service. The WCF tutorial contains sample code.

Daniel Brückner
+5  A: 

Hosting and Consuming WCF Services

This is an older article but still relevant.

rick schott