You are asking two questions, how to do this and how to script what you want to do.
I don't know whether its possible out of the box, but one solution is to use the IIS UrlRewrite module, this is very handy for all kinds of things, so I think its a good idea to have it anyways.
Create a new rule that matches all the requests that you want to handle, in your case path/service.svc/whatever/path
, you can use regular expressions to match your requests. Use a custom response and send your own status code. In the web.config you should have a section like this:
<rewrite>
<rules>
<rule name="Json Redirect" stopProcessing="true">
<match url="path/service.svc/whatever/path" />
<action type="CustomResponse" statusCode="555" subStatusCode="0" statusReason="Nothing to see here" statusDescription="Temporary static json..." />
</rule>
</rules>
</rewrite>
If you just do that, you get the error code, but not your static json. Add a new entry under system.webServer-httpErrors in web.config:
<error statusCode="555" subStatusCode="0" path="temp.json" responseMode="File" />
The responseMode = file means that the static file location is relative to your web root, in the case above right in the root of your web site.
Now you have to fix the content type, add an entry under system.webServer-staticContent in your web.config:
<mimeMap fileExtension=".json" mimeType="text/json" />
When testing this locally, you may still get an IIS error page, but calling it remotely, it should work.
You can do all these changes in the IIS manager UI, but if you want to script them, look into the PowerShell IIS cmdlets.