I would like to intercept any request made to the server for XML files. I thought this was possible with the HttpHandler. It is encoded and works ... only on the local host (?!?!).
So why does it only work on the local host? Here is my web.config
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.web> <httpHandlers> <add verb="*" path="*.xml" type="FooBar.XmlHandler, FooBar" /> </httpHandlers> </system.web> </configuration>
Here is my C #:
namespace FooBar { public class XmlHandler : IHttpHandler { public bool IsReusable { get { return false; } } public void ProcessRequest(HttpContext context) { HttpResponse Response = context.Response; Response.Write(xmlString); } } }
As you can see, I write xmlString directly in the answer, this is only temporary, because I'm still wondering how I can give the file name instead (second question;))
The response should contain only the name of the xml file that will be retrieved using the flash application.
thanks
Details:
Use IIS 6.0 on Windows Server 2003.
Edit:
When you call the page from another computer, it looks like it does not get into the HttpHandler. However, the mapping for IIS is correct.
source share