|
-
May 23rd, 2012, 07:00 AM
#1
Thread Starter
New Member
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?
-
May 23rd, 2012, 09:25 AM
#2
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|