views:

154

answers:

3

Hi there,

My RESTful WCF Web service appears to break itself if I leave it alone for a while! I can leave my PC with everything working and when I return and test the service with a simple url request it'll offer me the .svc file for download instead of initiating the request on the server!

This WCF service sits in it's own IIS Application folder under the root. I can get the service going again by opening up the IIS sub-folder in Visual Studio, deleting the web.config file and then adding it in again.

My first thought was that HTTP handler mappings for .svc have been borked so I re-ran ServiceModelReg.exe -i, but that hasn't resolved the issue.

Looking at the Handler Mappings for this IIS Application they appear correct and are inherited from the the web root. It's worth mentioning that this site also has another Application folder running WCF services from a .svc fle and is still functioning fine!

Now that I've checked the obvious am a bit flumoxed about where to look next! Hoping someone has suggestions...

A: 

Check out this article on getting your extension mapped correctly:

IIS Hosted Service Fails

EDIT: Are you hosting the service in your application? Maybe your app pool getting hung?

rick schott
Thanks for the suggestion, using the article I can confirm that the extensions are mapped correctly.
Simon Needham
No, I'm hosting in IIS (v7.5)
Simon Needham
A: 

Try

Go to programs and features, then turn windows features on or off.

Microsoft.net Framework 3.5.1.

Ensure both options are checked

Windows Communication Foundation HTTP Activation

Windows Communication Foundation Non HTTP Activation

Hope this helps.

JL
Both those options were unchecked so I enabled them, however, it hasn't resolved the problem unfortunately.
Simon Needham
+2  A: 

Are you running IIS6 or IIS7? And what .NET-version?

IIS6: http://blog.stevensanderson.com/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/

IIS7: Test this: "%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r -y

Do you really need .svc-extension in the rest url?

This might solve the problem: http://west-wind.com/weblog/posts/570695.aspx

Tuomas Hietanen
Simon Needham