Search code examples
wcf

Can I serve up web pages from a WCF Service NOT hosted in IIS?


I have a WCF Service that will be used like a standard web service, but I also want to provide a configuration UI for various service settings. Is it possible to serve up standard HTML pages when the service is not being hosted in IIS? If so, what "gotchas" are there?


Solution

  • WCF is API used for creating services. Handling "configuration web pages" is out of scope of this API. If you really want to do something like that it means that you must create another REST (webHttp) service which will expose operations serving your web pages and accept HTTP POSTs from your web pages. It is possible but it is a lot of work to do because current WCF version doesn't like content type of POSTed HTML forms (application/x-www-form-urlencoded and multipart/form-data). You can in the same way implement your own self hosted "web server" by using HttpListener.