Solved

How do I read this XML Error: There is an error in XML document (8, 2).

Posted on 2014-10-15
5
235 Views
Last Modified: 2014-10-16
I have an xml error during deserializing
Fail: There is an error in XML document (8, 2).

what does 8,2 mean? where is that?
<?xml version="1.0" encoding="UTF-8"?>
<XXXTraineeResult>
  <Processed>
    <Environment>TEST</Environment>
    <Trainees>
      <Trainee>
        <TrainingSessionNumber>0</TrainingSessionNumber>
        <SessionDateTime>2014-10-15T18:02:27.000</SessionDateTime>
        <ExamResult>P</ExamResult>
        <SocialSecurityLastFour>5555</SocialSecurityLastFour>
        <DateOfBirth>1997-11-03</DateOfBirth>
        <Name>
          <First>test</First>
          <MiddleInitial>K</MiddleInitial>
          <Last>test</Last>
        </Name>
      </Trainee>
    </Trainees>
  </Processed>
</XXXTraineeResult>

thanks!
0
Comment
Question by:Starr Duskk
  • 2
  • 2
5 Comments
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 40383796
Problem could be at your class definition, can we have a look in your class scripts?

in case this is useful:

XmlSerializer.Deserialize Method (XmlReader)
http://msdn.microsoft.com/en-us/library/tz8csy73(v=vs.110).aspx
0
 
LVL 2

Author Comment

by:Starr Duskk
ID: 40383830
attached is the vb from the schema.

Here is my deserialization method:

        Public Function GetOrderQueryReply(ByVal result As String) As RampTraineeResult.RAMPTraineeResult
            Dim oqr As RampTraineeResult.RAMPTraineeResult = New RampTraineeResult.RAMPTraineeResult()
            Dim serializer As New XmlSerializer(GetType(RampTraineeResult.RAMPTraineeResult))
            Dim reader As New StringReader(result)
            oqr = DirectCast(serializer.Deserialize(reader), RampTraineeResult.RAMPTraineeResult)
            Return oqr

        End Function

Open in new window

RampTraineeResult.vb
0
 
LVL 11

Accepted Solution

by:
louisfr earned 500 total points
ID: 40383945
(8, 2) means line 8, character 2.
The Exception should have an InnerException with the exact cause of the error.
0
 
LVL 11

Expert Comment

by:louisfr
ID: 40383946
(8, 2) means line 8, character 2.
The Exception should have an InnerException with the exact cause of the error.
0
 
LVL 2

Author Closing Comment

by:Starr Duskk
ID: 40384498
Perfect!! Why do I always forget I can look there!!!?? thanks!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question