Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In a standard team site, I have a document library that host a static website with html files as well json files loaded asynchronously with javascript.

This was working well in SharePoint 2007. unfortunately, since we migrated to SharePoint 2010, a http GET request on a JSON file fails with:

An error occured while processing resource /foo/bar.json. The page must have a <%@ webservice class="MyNamespace.MyClass" ... %> directive.

This just doesn't make sense. I want the json file to be served as a plain-text resource.

How can I fix this error?

share|improve this question
    
I translated the error message from French to English myself. Please edit the question if you know how the genuine message. –  rds Feb 11 '13 at 10:32
    
I am facing the same problem, which web.config file I should modify? I just want to modify only for one site not for the whole server. Thanks in advance. Raghu –  Raghu Jul 4 '13 at 6:56

1 Answer 1

up vote 1 down vote accepted

The default web.config contains in <system.webServer><handlers> this handler:

<add name="JSONHandlerFactory" path="*.json" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" resourceType="Unspecified" preCondition="integratedMode" />

As such, SharePoint thinks that URLs ending with .json are backed up by a web service.

I don't know whether native fonctionnalities rely on such services, hence I don't think it's a good idea to disable this handler. Apparently, Microsoft didn't think that the storage of JSON files in a document library is a valid use case.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.