Results 1 to 2 of 2

Thread: array based on wsdl schema

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    9

    Question array based on wsdl schema

    Hi,
    I'm building some web service application based on wsdl schema.
    I don't know how to create array based on this schema.

    Array should collect data from Form where textboxes are bound to db table where they are stored as:

    code1 with value1
    code2 with value2
    code3 with value3
    ....code 10 with value10


    code is decimal and value is decimal type

    part of WSDL schema concerning code:

    Partial Public Class importCodeValue

    Private codeField As Decimal

    Private valueField As Decimal


    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
    Public Property code() As Decimal
    Get
    Return Me.codeField
    End Get
    Set(ByVal value As Decimal)
    Me.codeField = value
    End Set
    End Property


    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
    Public Property value() As Decimal
    Get
    Return Me.valueField
    End Get
    Set(ByVal value As Decimal)
    Me.valueField = value
    End Set
    End Property
    End Class


    How do I write code:
    I've tried :
    Dim code(10) As importCodeValue
    code(10) = New importCodeValue ()

    code(0).code = Form1.textboxCode0code.text
    code(0).value = Form1.textboxCode0value.text

    code(1).code = Form1.textboxCode1code.text
    code(1).value = Form1.textboxCode1value.text
    ……
    code(10).code = Form1.textboxCode10code.text
    code(10).value = Form1.textboxCode10value.text


    but I receive error :
    System.NullReferenceException: Object reference not set to an instance of an object.
    I'm new in this and could not figure out how to solve this?

  2. #2
    New Member
    Join Date
    Mar 2012
    Posts
    9

    Re: array based on wsdl schema

    Hi,
    I found sollution by myself, it is very simple:

    Dim code(10) As importCodeValue


    code(0) = New importCodeValue ()
    code(0).code = Form1.textboxCode0code.text
    code(0).value = Form1.textboxCode0value.text

    code(1) = New importCodeValue ()
    code(1).code = Form1.textboxCode1code.text
    code(1).value = Form1.textboxCode1value.text
    ....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width