views:

61

answers:

3

OK, this is impossible, but I will try to explain the situation here.

Let's say we have cases, that we need a fast setup of a web server in order to have a simple soap web service running (querying a db and so on).

In VS though, upon debugging a web project, it creates a quick ASP.NET development server without relying on the actuall IIS that might be installed on the PC.

Is there any project that does something like that? This would be ideal for small projects, where a simple executable would get a server ready to go and would allow web services to be executed right away.

I have looked at some stuff over the net like http://msdn.microsoft.com/en-us/magazine/cc163879.aspx and http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2004/05/24/4479.aspx but they seem to be quite outdated and i am not sure how well they work (havent tested them thoroughly)

EDIT: I have build an application like the one you suggest. However, how can i implement HTTP GET/POST requests to the service using this method? I tried using WebGet after my operationcontract but it didnt work. For example, my service is at http://localhost:8080/Service and i would like to use it such as http://localhost:8080/Service/getMethod?x=2.

+1  A: 

I believe that the development server used by Visual Studio is based off of the Cassini code base (of which there is a fork here). I also found this article on hosting the asp.net runtime. It was also created a while back (2004), but has been updated since (2008). I think a lot of the core concepts are probably still the same.

Another approach would be a roll-your-own web server using the HttpListener class. This could take some work if you want to use it for hosting asmx type services, but if you were doing RESTful services, it isn't too bad of an option (this is actually how RavenDB works if you are not hosting it under IIS).

ckramer
+1  A: 

A WCF service can be hosted in almost any kind of application, including a Windows Service or a console application. There is no need for a web server at all.

John Saunders
+1  A: 

Alright,

i've done it so im posting it here to help anyone who has issues with similar problems. Create your WCF Service file as usual and then by using ServiceHost (or WebServiceHost) you can easily create a WCF service. In order to use GET http requests to make it simple to communicate with mobile devices (such as iphone) you can use WebGet above your service methods and make sure you manually add a service endpoint using WebHttpBinding for WebServiceHost or WebHttpBinding with an WebHttpBehavior for ServiceHost. Then you can call your service methods such as http://localhost:port/webhttpendpointaddress/mymethod?x=2.

immuner