Solved

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

Posted on 2014-10-15
5
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 52

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

705 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