locked
There is an error in XML document (2, 2)

    Question

  • There were two topics on this, but the first didn't help me out and the second post the person didn't follow up with their XML. I am getting this error. Can anyone please help me understand whats going on here? Here is my code:
    Main Code:
        Private Sub btnProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProcess.Click
            Dim ds As New WindowsApplication1.NewDataSet
    
            Dim mydatabases As New NewDataSet()
            Dim myReader As TextReader = New StreamReader("../../listAllVideos.xml")
            Dim serializer As New XmlSerializer(GetType(NewDataSet))
            mydatabases = DirectCast(serializer.Deserialize(myReader), NewDataSet)
            myReader.Close()
        End Sub
    
    XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <xml>
    <results>
    	<array key="0">
    		<id>1916735</id>
    		<title><![CDATA[The TechCrunch Office live 8/2/09 04:50PM]]></title>
    		<protected>FALSE</protected>
    		<description><![CDATA[8/2/09 04:50PM PST]]></description>
    		<createdAt><![CDATA[2009-08-02 16:13:54]]></createdAt>
    		<rating>3.000</rating>
    		<lengthInSecond>2146.777</lengthInSecond>
    		<totalViews>1943</totalViews>
    		<codecIsForLiveHttp>0</codecIsForLiveHttp>
    		<serverId>992</serverId>
    		<videoName><![CDATA[1_170_1249254834012]]></videoName>
    		<url><![CDATA[http://www.ustream.tv/recorded/1916735]]></url>
    		<embedTag><![CDATA[<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="260" id="utv445187" name="utv_n_638715"><param name="flashvars" value="autoplay=false&vid=1916735" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.ustream.tv/flash/viewer.swf" /><embed flashvars="autoplay=false&vid=1916735" width="320" height="260" allowfullscreen="true" allowscriptaccess="always" id="utv445187" name="utv_n_638715" src="http://www.ustream.tv/flash/viewer.swf" type="application/x-shockwave-flash" /></object>]]></embedTag>
    		<liveHttpUrl><![CDATA[]]></liveHttpUrl>
    		<imageUrl>
    			<small><![CDATA[http://static-cdn2.ustream.tv/videopic/0/1/1/1916/1916735/1_170_1916735_120x90_b_1:1.jpg]]></small>
    			<medium><![CDATA[http://static-cdn2.ustream.tv/videopic/0/1/1/1916/1916735/1_170_1916735_320x240_b_1:1.jpg]]></medium>
    		</imageUrl>
    		<sourceChannel>
    			<id>170</id>
    			<url><![CDATA[http://www.ustream.tv/channel/170]]></url>
    		</sourceChannel>
    	</array>
    	<array key="1">
    		<id>1999849</id>
    		<title><![CDATA[The TechCrunch Office live 8/17/09 04:37AM]]></title>
    		<protected>FALSE</protected>
    		<description><![CDATA[8/17/09 04:37AM PST]]></description>
    		<createdAt><![CDATA[2009-08-17 03:37:27]]></createdAt>
    		<rating>0.000</rating>
    		<lengthInSecond>3598.909</lengthInSecond>
    		<totalViews>1447</totalViews>
    		<codecIsForLiveHttp>0</codecIsForLiveHttp>
    		<serverId>995</serverId>
    		<videoName><![CDATA[1_170_1250505446502]]></videoName>
    		<url><![CDATA[http://www.ustream.tv/recorded/1999849]]></url>
    		<embedTag><![CDATA[<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="260" id="utv166275" name="utv_n_26388"><param name="flashvars" value="autoplay=false&vid=1999849" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.ustream.tv/flash/viewer.swf" /><embed flashvars="autoplay=false&vid=1999849" width="320" height="260" allowfullscreen="true" allowscriptaccess="always" id="utv166275" name="utv_n_26388" src="http://www.ustream.tv/flash/viewer.swf" type="application/x-shockwave-flash" /></object>]]></embedTag>
    		<liveHttpUrl><![CDATA[]]></liveHttpUrl>
    		<imageUrl>
    			<small><![CDATA[http://static-cdn2.ustream.tv/videopic/0/1/1/1999/1999849/1_170_1999849_120x90_b_1:1.jpg]]></small>
    			<medium><![CDATA[http://static-cdn2.ustream.tv/videopic/0/1/1/1999/1999849/1_170_1999849_320x240_b_1:1.jpg]]></medium>
    		</imageUrl>
    		<sourceChannel>
    			<id>170</id>
    			<url><![CDATA[http://www.ustream.tv/channel/170]]></url>
    		</sourceChannel>
    	</array>
    </results>
    <msg><![CDATA[]]></msg>
    <error><![CDATA[]]></error>
    <processTime>TRUE</processTime>
    <version><![CDATA[mashery-r10]]></version>
    </xml>
    
    XSD Generated Class:
    Option Strict Off
    Option Explicit On
    
    Imports System.Xml.Serialization
    
    '
    'This source code was auto-generated by xsd, Version=4.0.30319.1.
    '
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"),  _
     System.SerializableAttribute(),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true),  _
     System.Xml.Serialization.XmlRootAttribute([Namespace]:="", IsNullable:=false)>  _
    Partial Public Class xml
        
        Private msgField As String
        
        Private errorField As String
        
        Private processTimeField As String
        
        Private versionField As String
        
        Private resultsField()() As xmlResultsArray
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property msg() As String
            Get
                Return Me.msgField
            End Get
            Set
                Me.msgField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property [error]() As String
            Get
                Return Me.errorField
            End Get
            Set
                Me.errorField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property processTime() As String
            Get
                Return Me.processTimeField
            End Get
            Set
                Me.processTimeField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property version() As String
            Get
                Return Me.versionField
            End Get
            Set
                Me.versionField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlArrayAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified),  _
         System.Xml.Serialization.XmlArrayItemAttribute("array", GetType(xmlResultsArray), Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=false)>  _
        Public Property results() As xmlResultsArray()()
            Get
                Return Me.resultsField
            End Get
            Set
                Me.resultsField = value
            End Set
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"),  _
     System.SerializableAttribute(),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true)>  _
    Partial Public Class xmlResultsArray
        
        Private idField As String
        
        Private titleField As String
        
        Private protectedField As String
        
        Private descriptionField As String
        
        Private createdAtField As String
        
        Private ratingField As String
        
        Private lengthInSecondField As String
        
        Private totalViewsField As String
        
        Private codecIsForLiveHttpField As String
        
        Private serverIdField As String
        
        Private videoNameField As String
        
        Private urlField As String
        
        Private embedTagField As String
        
        Private mp4UrlField As String
        
        Private liveHttpUrlField As String
        
        Private imageUrlField() As xmlResultsArrayImageUrl
        
        Private sourceChannelField() As xmlResultsArraySourceChannel
        
        Private keyField As String
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property id() As String
            Get
                Return Me.idField
            End Get
            Set
                Me.idField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property title() As String
            Get
                Return Me.titleField
            End Get
            Set
                Me.titleField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property [protected]() As String
            Get
                Return Me.protectedField
            End Get
            Set
                Me.protectedField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property description() As String
            Get
                Return Me.descriptionField
            End Get
            Set
                Me.descriptionField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property createdAt() As String
            Get
                Return Me.createdAtField
            End Get
            Set
                Me.createdAtField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property rating() As String
            Get
                Return Me.ratingField
            End Get
            Set
                Me.ratingField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property lengthInSecond() As String
            Get
                Return Me.lengthInSecondField
            End Get
            Set
                Me.lengthInSecondField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property totalViews() As String
            Get
                Return Me.totalViewsField
            End Get
            Set
                Me.totalViewsField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property codecIsForLiveHttp() As String
            Get
                Return Me.codecIsForLiveHttpField
            End Get
            Set
                Me.codecIsForLiveHttpField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property serverId() As String
            Get
                Return Me.serverIdField
            End Get
            Set
                Me.serverIdField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property videoName() As String
            Get
                Return Me.videoNameField
            End Get
            Set
                Me.videoNameField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property url() As String
            Get
                Return Me.urlField
            End Get
            Set
                Me.urlField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property embedTag() As String
            Get
                Return Me.embedTagField
            End Get
            Set
                Me.embedTagField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property mp4Url() As String
            Get
                Return Me.mp4UrlField
            End Get
            Set
                Me.mp4UrlField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property liveHttpUrl() As String
            Get
                Return Me.liveHttpUrlField
            End Get
            Set
                Me.liveHttpUrlField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute("imageUrl", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property imageUrl() As xmlResultsArrayImageUrl()
            Get
                Return Me.imageUrlField
            End Get
            Set
                Me.imageUrlField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute("sourceChannel", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property sourceChannel() As xmlResultsArraySourceChannel()
            Get
                Return Me.sourceChannelField
            End Get
            Set
                Me.sourceChannelField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlAttributeAttribute()>  _
        Public Property key() As String
            Get
                Return Me.keyField
            End Get
            Set
                Me.keyField = value
            End Set
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"),  _
     System.SerializableAttribute(),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true)>  _
    Partial Public Class xmlResultsArrayImageUrl
        
        Private smallField As String
        
        Private mediumField As String
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property small() As String
            Get
                Return Me.smallField
            End Get
            Set
                Me.smallField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property medium() As String
            Get
                Return Me.mediumField
            End Get
            Set
                Me.mediumField = value
            End Set
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"), _
     System.SerializableAttribute(), _
     System.Diagnostics.DebuggerStepThroughAttribute(), _
     System.ComponentModel.DesignerCategoryAttribute("code"), _
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)> _
    Partial Public Class xmlResultsArraySourceChannel
    
        Private idField As String
    
        Private urlField As String
    
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property id() As String
            Get
                Return Me.idField
            End Get
            Set(ByVal value As String)
                Me.idField = Value
            End Set
        End Property
    
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property url() As String
            Get
                Return Me.urlField
            End Get
            Set(ByVal value As String)
                Me.urlField = Value
            End Set
        End Property
    End Class
    
    
    Partial Public Class NewDataSet
    
        Private itemsField() As xml
    
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute("xml")> _
        Public Property Items() As xml()
            Get
                Return Me.itemsField
            End Get
            Set(ByVal value As xml())
                Me.itemsField = value
            End Set
        End Property
    End Class
    
    
     
    Wednesday, September 21, 2011 5:38 PM

Answers

  • This class can only deserialize XML that starts with <NewDataSet>.

    In order to see the XML this class is expecting, I recommend that you create an instance of the class, fill it with some data, then use the DataSet.WriteXml method to write that to a file. What it writes is what it can read.


    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects
    • Marked as answer by lagwagon504 Friday, October 14, 2011 3:16 PM
    Wednesday, October 12, 2011 6:31 PM
    Moderator

All replies

  • There is an error in XML document (2, 2) and the inner exception is:

    {"<xml xmlns=''> was not expected."}

     

    Friday, September 23, 2011 1:27 PM
  • Where's your NewDataSet class? That's what you created the serializer for, so that's what it's expecting at the start of your XML.
    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects
    Saturday, September 24, 2011 8:29 PM
    Moderator
  • '------------------------------------------------------------------------------
    ' <auto-generated>
    '     This code was generated by a tool.
    '     Runtime Version:4.0.30319.237
    '
    '     Changes to this file may cause incorrect behavior and will be lost if
    '     the code is regenerated.
    ' </auto-generated>
    '------------------------------------------------------------------------------
    
    Option Strict Off
    Option Explicit On
    
    Imports System.Xml.Serialization
    
    '
    'This source code was auto-generated by xsd, Version=4.0.30319.1.
    '
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"),  _
     System.SerializableAttribute(),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true),  _
     System.Xml.Serialization.XmlRootAttribute([Namespace]:="", IsNullable:=false)>  _
    Partial Public Class xml
        
        Private msgField As String
        
        Private errorField As String
        
        Private processTimeField As String
        
        Private versionField As String
        
        Private resultsField()() As xmlResultsArray
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property msg() As String
            Get
                Return Me.msgField
            End Get
            Set
                Me.msgField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property [error]() As String
            Get
                Return Me.errorField
            End Get
            Set
                Me.errorField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property processTime() As String
            Get
                Return Me.processTimeField
            End Get
            Set
                Me.processTimeField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property version() As String
            Get
                Return Me.versionField
            End Get
            Set
                Me.versionField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlArrayAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified),  _
         System.Xml.Serialization.XmlArrayItemAttribute("array", GetType(xmlResultsArray), Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=false)>  _
        Public Property results() As xmlResultsArray()()
            Get
                Return Me.resultsField
            End Get
            Set
                Me.resultsField = value
            End Set
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"),  _
     System.SerializableAttribute(),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true)>  _
    Partial Public Class xmlResultsArray
        
        Private idField As String
        
        Private titleField As String
        
        Private protectedField As String
        
        Private descriptionField As String
        
        Private createdAtField As String
        
        Private ratingField As String
        
        Private lengthInSecondField As String
        
        Private totalViewsField As String
        
        Private codecIsForLiveHttpField As String
        
        Private serverIdField As String
        
        Private videoNameField As String
        
        Private urlField As String
        
        Private embedTagField As String
        
        Private mp4UrlField As String
        
        Private liveHttpUrlField As String
        
        Private imageUrlField() As xmlResultsArrayImageUrl
        
        Private sourceChannelField() As xmlResultsArraySourceChannel
        
        Private keyField As String
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property id() As String
            Get
                Return Me.idField
            End Get
            Set
                Me.idField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property title() As String
            Get
                Return Me.titleField
            End Get
            Set
                Me.titleField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property [protected]() As String
            Get
                Return Me.protectedField
            End Get
            Set
                Me.protectedField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property description() As String
            Get
                Return Me.descriptionField
            End Get
            Set
                Me.descriptionField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property createdAt() As String
            Get
                Return Me.createdAtField
            End Get
            Set
                Me.createdAtField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property rating() As String
            Get
                Return Me.ratingField
            End Get
            Set
                Me.ratingField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property lengthInSecond() As String
            Get
                Return Me.lengthInSecondField
            End Get
            Set
                Me.lengthInSecondField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property totalViews() As String
            Get
                Return Me.totalViewsField
            End Get
            Set
                Me.totalViewsField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property codecIsForLiveHttp() As String
            Get
                Return Me.codecIsForLiveHttpField
            End Get
            Set
                Me.codecIsForLiveHttpField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property serverId() As String
            Get
                Return Me.serverIdField
            End Get
            Set
                Me.serverIdField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property videoName() As String
            Get
                Return Me.videoNameField
            End Get
            Set
                Me.videoNameField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property url() As String
            Get
                Return Me.urlField
            End Get
            Set
                Me.urlField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property embedTag() As String
            Get
                Return Me.embedTagField
            End Get
            Set
                Me.embedTagField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property mp4Url() As String
            Get
                Return Me.mp4UrlField
            End Get
            Set
                Me.mp4UrlField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property liveHttpUrl() As String
            Get
                Return Me.liveHttpUrlField
            End Get
            Set
                Me.liveHttpUrlField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute("imageUrl", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property imageUrl() As xmlResultsArrayImageUrl()
            Get
                Return Me.imageUrlField
            End Get
            Set
                Me.imageUrlField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute("sourceChannel", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property sourceChannel() As xmlResultsArraySourceChannel()
            Get
                Return Me.sourceChannelField
            End Get
            Set
                Me.sourceChannelField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlAttributeAttribute()>  _
        Public Property key() As String
            Get
                Return Me.keyField
            End Get
            Set
                Me.keyField = value
            End Set
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"),  _
     System.SerializableAttribute(),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true)>  _
    Partial Public Class xmlResultsArrayImageUrl
        
        Private smallField As String
        
        Private mediumField As String
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property small() As String
            Get
                Return Me.smallField
            End Get
            Set
                Me.smallField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property medium() As String
            Get
                Return Me.mediumField
            End Get
            Set
                Me.mediumField = value
            End Set
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"),  _
     System.SerializableAttribute(),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true)>  _
    Partial Public Class xmlResultsArraySourceChannel
        
        Private idField As String
        
        Private urlField As String
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property id() As String
            Get
                Return Me.idField
            End Get
            Set
                Me.idField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property url() As String
            Get
                Return Me.urlField
            End Get
            Set
                Me.urlField = value
            End Set
        End Property
    End Class
    
    Partial Public Class NewDataSet
    
        Private itemsField() As xml
    
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute("xml")> _
        Public Property Items() As xml()
            Get
                Return Me.itemsField
            End Get
            Set(ByVal value As xml())
                Me.itemsField = Value
            End Set
        End Property
    End Class
    
    

    Tuesday, September 27, 2011 3:50 PM
  • To give a little more info...

    I am trying to create an object from this XML:

    http://api.ustream.tv/xml/user/techcrunch/listAllVideos?key=devkey

     

    Thanks for your time.

    Tuesday, September 27, 2011 3:55 PM
  • I still don't see the word "NewDataSet". Where is that class? Don't post the whole thing, just the skeleton of the class.
    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects
    Thursday, September 29, 2011 4:08 PM
    Moderator
  • <Global.System.Serializable(),  _
     Global.System.ComponentModel.DesignerCategoryAttribute("code"),  _
     Global.System.ComponentModel.ToolboxItem(true),  _
     Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema"),  _
     Global.System.Xml.Serialization.XmlRootAttribute("NewDataSet"),  _
     Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")>  _
    Partial Public Class NewDataSet
        Inherits Global.System.Data.DataSet
        
        Private tablexml As xmlDataTable
        
        Private tableresults As resultsDataTable
        
        Private tablearray As arrayDataTable
        
        Private tableimageUrl As imageUrlDataTable
        
        Private tablesourceChannel As sourceChannelDataTable
        
        Private relationxml_results As Global.System.Data.DataRelation
        
        Private relationresults_array As Global.System.Data.DataRelation
        
        Private relationarray_imageUrl As Global.System.Data.DataRelation
        
        Private relationarray_sourceChannel As Global.System.Data.DataRelation
        
        Private _schemaSerializationMode As Global.System.Data.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema
        
        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")>  _
        Public Sub New()
            MyBase.New
            Me.BeginInit
            Me.InitClass
            Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged
            AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler
            AddHandler MyBase.Relations.CollectionChanged, schemaChangedHandler
            Me.EndInit
        End Sub
    

    Wednesday, October 12, 2011 6:12 PM
  • This class can only deserialize XML that starts with <NewDataSet>.

    In order to see the XML this class is expecting, I recommend that you create an instance of the class, fill it with some data, then use the DataSet.WriteXml method to write that to a file. What it writes is what it can read.


    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects
    • Marked as answer by lagwagon504 Friday, October 14, 2011 3:16 PM
    Wednesday, October 12, 2011 6:31 PM
    Moderator