Vb.net 使用Web服务填充时出错,填充数组时出现问题

Vb.net 使用Web服务填充时出错,填充数组时出现问题,vb.net,Vb.net,'使用Web服务填充数组时出现问题 Dim apkvrg = New rdc.opvoerenMeldingAfkeuringAPK apkvrg.VoertuigGebreken.VoertuigGebrek = "" 'error cannot conver 1-dimension apkvrg.VoertuigGebreken.VoertuigGebrek(0).GebrekAantal = 1 'An unhandled exception of type 'System.NullR

'使用Web服务填充数组时出现问题

Dim apkvrg = New rdc.opvoerenMeldingAfkeuringAPK

apkvrg.VoertuigGebreken.VoertuigGebrek = "" 'error cannot conver 1-dimension
apkvrg.VoertuigGebreken.VoertuigGebrek(0).GebrekAantal = 1  'An unhandled exception of type 'System.NullReferenceException' occurred in apksoap.exe

                                                             'Additional information: Object reference not set to an instance of an object     


        Private voertuigGebrekField() As VoertuigGebrekRaadplegen

        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute("VoertuigGebrek")>  _
        Public Property VoertuigGebrek() As VoertuigGebrekRaadplegen()
            Get
                Return Me.voertuigGebrekField
            End Get
            Set
                Me.voertuigGebrekField = value
            End Set
        End Property
       End Class

       Partial Public Class VoertuigGebrekRaadplegen

        Private gebrekIdentificatieField As String

        Private gebrekActieField As String

        Private gebrekAantalField As String

        Private gebrekToelichtingField As String

        Private gebrekOmschrijvingField As String

        '''<remarks/>
        Public Property GebrekIdentificatie() As String
            Get
                Return Me.gebrekIdentificatieField
            End Get
            Set
                Me.gebrekIdentificatieField = value
            End Set
        End Property
Dim apkvrg=New rdc.opvorenmeldingafkeuringapk
apkvrg.VoertuigGebreken.VoertuigGebrek=“”错误无法转换一维
apkvrg.VoertuigGebreken.VoertuigGebrek(0).GebrekAantal=1'apksoap.exe中发生类型为'System.NullReferenceException'的未处理异常
'其他信息:对象引用未设置为对象的实例
私人voertuigGebrekField()作为VoertuigGebrekRaadplegen
'''
_
公共财产VoertuigGebrek()作为VoertuigGebrekRaadplegen()
得到
给我回电话,沃图伊格·布雷克菲尔德
结束
设置
Me.voertuigGebrekField=值
端集
端属性
末级
部分公共类VoertuigGebrekRaadplegen
私有gebrekIdentificatieField作为字符串
私有gebrekActieField作为字符串
私人gebrekAantalField作为字符串
私有gebrektoelichingfield作为字符串
私有gebrekOmschrijvingField作为字符串
'''
公共属性GebrekIdentificatie()作为字符串
得到
返回我。gebrekIdentificatieField
结束
设置
Me.gebrekIdentificatieField=值
端集
端属性
XMLWebService

     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rdc="http://nsp.rdc.nl/RDC">
     <soapenv:Header/>
     <soapenv:Body>
      <rdc:opvoerenMeldingAfkeuringAPK IndicatieLichtZwaar="Licht" Referentie="MB">
         <rdc:Kenteken>40MRDC</rdc:Kenteken>
         <rdc:Meldcode>0140</rdc:Meldcode>
         <!--Optional:-->
         <rdc:SoortErkenningKeuringsinstantie>AL</rdc:SoortErkenningKeuringsinstantie>
         <!--Optional:-->
         <rdc:SoortMeldingKeuringsinstantie>PC</rdc:SoortMeldingKeuringsinstantie>
         <!--Optional:-->
         <rdc:KINummerMelding>RD17C21</rdc:KINummerMelding>
         <rdc:RDCNummer>307903</rdc:RDCNummer>
         <!--You have a CHOICE of the next 2 items at this level-->
         <!--Optional:-->
         <rdc:Tellerstand Eenheid="Kilometer">150000</rdc:Tellerstand>
         <!--Optional:-->

         <rdc:VoertuigGebreken>
            <!--1 to 20 repetitions:-->
            <rdc:VoertuigGebrek>
               <rdc:GebrekIdentificatie>B07</rdc:GebrekIdentificatie>
               <rdc:GebrekActie>AFK</rdc:GebrekActie>
               <rdc:GebrekAantal>1</rdc:GebrekAantal>
               <!--Optional:-->
               <rdc:GebrekToelichting>?</rdc:GebrekToelichting>
            </rdc:VoertuigGebrek>
             <rdc:VoertuigGebrek>
               <rdc:GebrekIdentificatie>B08</rdc:GebrekIdentificatie>
               <rdc:GebrekActie>AFK</rdc:GebrekActie>
               <rdc:GebrekAantal>1</rdc:GebrekAantal>
               <!--Optional:-->
               <rdc:GebrekToelichting>?</rdc:GebrekToelichting>
            </rdc:VoertuigGebrek>

         </rdc:VoertuigGebreken>
         <rdc:PasnummerKeurmeester>410032</rdc:PasnummerKeurmeester>
         <rdc:PincodeKeurmeester>test23</rdc:PincodeKeurmeester>
         <!--Optional:-->

        </rdc:opvoerenMeldingAfkeuringAPK>
        </soapenv:Body>
        </soapenv:Envelope>

40MRDC
0140
艾尔
个人计算机
RD17C21
307903
150000
B07
暂时离开键盘
1.
?
B08
暂时离开键盘
1.
?
410032
测试23

一点背景知识。。。事实上,寻求帮助是很好的……对不起,我当然是在寻求帮助,这是我在这里的第一个问题。问题是,如果您看到xml代码,我会尝试向dim apkvrg.voertuiggebreken提供与xml示例相同的信息。