Solved

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

Posted on 2014-10-15
5
232 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:BobCSD
  • 2
  • 2
5 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
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 1

Author Comment

by:BobCSD
Comment Utility
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
Comment Utility
(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
Comment Utility
(8, 2) means line 8, character 2.
The Exception should have an InnerException with the exact cause of the error.
0
 
LVL 1

Author Closing Comment

by:BobCSD
Comment Utility
Perfect!! Why do I always forget I can look there!!!?? thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now