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 8131251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:02:15+00:00 2026-06-06T09:02:15+00:00

I’m receiving an xml response and I now want to parse this. Currently what

  • 0

I’m receiving an xml response and I now want to parse this.

Currently what I have to receive the XML response is:

    Dim textReader = New IO.StreamReader(Request.InputStream)

    Request.InputStream.Seek(0, IO.SeekOrigin.Begin)
    textReader.DiscardBufferedData()

    Dim Xmlin = XDocument.Load(textReader)

How can I go ahead now a process this and pick out the element values?

<subscription>
<reference>abc123</reference>
<status>active</status>
<customer>
    <fname>Joe</fname>
    <lname>bloggs</lname>
    <company>Bloggs inc</company>
    <phone>1234567890</phone>
    <email>joebloggs@hotmail.com</email>
 </customer>
 </subscription>

If I have it in string format I can do this using

    Dim xmlE As XElement = XElement.Parse(strXML) ' strXML is string version of XML

    Dim strRef As String = xmlE.Element("reference")

Do I need to convert the request.inputstream to a strign format or is there another better way?

Thanks

  • 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-06T09:02:17+00:00Added an answer on June 6, 2026 at 9:02 am

    In the end after much testing I could only get this to work:

        Dim textReader = New IO.StreamReader(Request.InputStream)
    
        Request.InputStream.Seek(0, IO.SeekOrigin.Begin)
        textReader.DiscardBufferedData()
    
        Dim Xmlin = XDocument.Load(textReader)
    
        Dim strXml As String = Xmlin.ToString
    
        Dim xmlE As XElement = XElement.Parse(strXml)
        Dim strRef As String = xmlE.Element("reference")
        Dim strStatus As String = xmlE.Element("status")
        Dim strFname As String = xmlE.Element("customer").Element("fname").Value()
        Dim strLname As String = xmlE.Element("customer").Element("lname").Value()
        Dim strCompany As String = xmlE.Element("customer").Element("company").Value()
        Dim strPhone As String = xmlE.Element("customer").Element("phone").Value()
        Dim strEmail As String = xmlE.Element("customer").Element("email").Value()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I have a jquery bug and I've been looking for hours now, I can't
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
i want to parse a xhtml file and display in UITableView. what is the
I have some data like this: 1 2 3 4 5 9 2 6

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.