Sending XML data via HTTP POST to IHttpHandler causes HttpRequestValidationException?

As far as I know, you just need to encode that XML with entities. I mean that & gt;, and so on. EDIT: I found that this is a duplicate of: How can Request Validation be disabled for HttpHandlers?

Try this! :).

And thank for your answer. Please note that I have no control on data that the handler will receive, the page I have posted is just an example for testing. I have to presume that xml data will come with no encoding, basing on the documentation of the system that will send the data in production environment.

– Claudio Valerio Jan 20 at 10:50 No prob. I see, let me think then... – Matías Fidemraizer Jan 20 at 10:53 Have you tried with an HTTP Module? Try if you receive the data and you can encode there if it's a raw XML, and then your handler will receive the encoded data.

– Matías Fidemraizer Jan 20 at 10:55 The problem is the request does not contain only raw XML (in this case all I need to do is to read xml from InputStream of Request object), but an entire form posted with one of its values containing an XML string. When I try to read this value ("input" in my semplified test, but the request will contain other non-xml values) I get the exception. I tried using an IHttpModule instead of an IHttpHandler, but when I try to access to the Request.

Form NameValueCollection the exception occurs. By the way, i'd prefer not to use too many layers over the request management, because the application... – Claudio Valerio Jan 20 at 11:33 ...puts its own logic over that (with an abstraction layer that dynamically creates the right handler when a request is made to a specific entry point). – Claudio Valerio Jan 20 at 11:39.

I'm writing an IHttpHandler implementation that will receive XML data sent through a regular HTTP POST from another website. The problem is that when I try to read the "input" value from the posted data, if it contains an xml string, all I get is a HttpRequestValidationException. Config, and putting the validate="false" attribute in handler declaration in the httpHandles section, without results.

How can I read posted xml in my handler? (please note that I HAVE to use an IHttpHandler for this task). EDIT: Framework version: 4.0, IIS 7.

Thank you all!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions