xml response http post - convert request.inputstream to string - asp.net

rickman

New Member
I'm receiving an xml response and I now want to parse this.Currently what I have to receive the XML response is:\[code\] Dim textReader = New IO.StreamReader(Request.InputStream) Request.InputStream.Seek(0, IO.SeekOrigin.Begin) textReader.DiscardBufferedData() Dim Xmlin = XDocument.Load(textReader)\[/code\]How can I go ahead now a process this and pick out the element values?\[code\]<subscription><reference>abc123</reference><status>active</status><customer> <fname>Joe</fname> <lname>bloggs</lname> <company>Bloggs inc</company> <phone>1234567890</phone> <email>[email protected]</email> </customer> </subscription>\[/code\]If I have it in string format I can do this using \[code\] Dim xmlE As XElement = XElement.Parse(strXML) ' strXML is string version of XML Dim strRef As String = xmlE.Element("reference")\[/code\]Do I need to convert the request.inputstream to a strign format or is there another better way?Thanks
 
Back
Top