0

I'm new to this but I have a web page that is setup to receive a post with XML in the body. It's working correctly but a new request was made to add XML content to the HttpResponeseMessage 200,OK. I need to include "TRUE" in the body of the 200,OK response going back. I have tried to find an example that works but my inexperience is getting in the way. I was able to create a new POST and send the XML while playing around but I can't find anything that will work in the original POST. I hope I'm making sense in asking this question. Thank you in advance for any help you can lend.

    public partial class WFRTPB : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var memstream = new MemoryStream();
            Request.InputStream.Position = 0;
            Request.InputStream.CopyTo(memstream);
            memstream.Position = 0;
            using (StreamReader reader = new StreamReader(memstream))
            {
            var text = reader.ReadToEnd();
            // I do some processing here and then I need to send an
            // XML "<TRANSUCCESS>TRUE</TRANSUCCESS>" in the body of the 
            // HttpResponseMessage 200,OK
  • Do you need to display the XML inside an HTML page? What does your page actually do? – Shai Aharoni Oct 08 '18 at 16:32
  • I'm receiving notifications of payment from a check clearing house in real time. The POST they are sending is letting me know a customer is attempting to pay by check. The problem is since I'm not sending the the require TRANSUCCESS xml in the body of the 200,OK they think it has fail and then resend (which I see as duplicates). Nothing need to display in the page it just needs to go back to indicate success. – Robert Messina Oct 08 '18 at 16:40
  • Possible duplicate of [How to create a response message and add content string to it in ASP.NET](https://stackoverflow.com/questions/33178983/how-to-create-a-response-message-and-add-content-string-to-it-in-asp-net-5-mvc) – stuartd Oct 08 '18 at 16:46
  • I saw that example but I get compile errors and I don't know how to convert it to XML. I was hoping for a simple example to build on. – Robert Messina Oct 08 '18 at 17:07

0 Answers0