Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8200151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:20:30+00:00 2026-06-07T06:20:30+00:00

I am writing the c# component of a .aspx page which an external site

  • 0

I am writing the c# component of a .aspx page which an external site will be sending XML to. My page needs to be able to receive the XML and parse it, but I am getting hung up on receiving the XML.

My page is getting hit with the XML page, but Request.Files.Count==0 and Request.InputStream.Length==0, even though I know that both of these statements should be false because the page is logging the reception of the file and HttpContext.Current != null. I am using the following code:

    Stream stream = HttpContext.Current.Request.InputStream;
    stream.Position = 0;
    XmlTextReader reader = new XmlTextReader(stream);

    log("" + Request.Files.Count, tw);
    log("Does the current request exist?",tw);
    log(HttpContext.Current != null ? "Yes" : "No",tw);
    log("XML Retrieved!", tw);
    log("Byte Length of " + stream.Length, tw);

My log.txt file has the following output:

    0
    Does the current request exist?
    Yes
    XML Retrieved!
    Byte Length of 0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:20:31+00:00Added an answer on June 7, 2026 at 6:20 am

    Issue Solved, in this case I needed to reference Page.Request.InputStream instead of HttpContext.Current.Request.InputStream.

    My code for receiving the XML and reading it into a String:

        Page.Response.ContentType = "text/xml";
        StreamReader sr = new StreamReader(Page.Request.InputStream);
        String main = Server.UrlDecode(sr.ReadToEnd());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a component for a web app which will display some html,
I am writing a component in C which will be used by several different
I'm writing and testing a ClassLoader component, which can be instantiated many times, with
I am writing a custom component (derived from a relative layout) which has to
Im writing a C# class library component which is going to act as a
I'm writing a rack middleware component for a rails app that will need to
I am writing a component to parse data collected from various devices. Basic purpose
I'm writing a component that needs to walk large object graphs, sometimes 20-30 levels
I'm writing a software component which can be consumed by various .net applications. Is
I'm writing a TCustomDBGrid descendent component which need to access the protected property Options(

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.