I have implemented a generic handler to work as a restful web service in ASP.Net. I have a problem receiving the XML file that is being posted to this web service. I cannot actually see anything being passed. I have gone through the form, querystring, and file properties of the request object. Everything is empty. I know that the file has been posted correctly because I can see it while using a port sniffer.
How can I access this file?
After hours of searching, of course I found the answer after posting my question here. I was able to access the file using a stream reader. The code looks like this.
Dim reader As New IO.StreamReader(context.Request.InputStream)
Dim xmlFile As String = reader.ReadToEnd()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With