Solved

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

Posted on 2014-10-15
5
236 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

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…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 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