473,498 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

assigning values to a web service array

I receive the following error when I attempt to assign values to a web
service array.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
Line 553: AppDTO.zip = sZip
Line 554: AppDTO.dob = sDOB
'** line 555 is the highlighted row with the problem.
Line 555: AppDTO.questionAnswer(0).id = 1
Line 556: AppDTO.questionAnswer(0).answer(0).id = 1
Line 557: AppDTO.questionAnswer(0).answer(0).value = ""
---

the code snippet that is running is:
AppDTO = New localhost.ApplicationDTO
AppDTO.firstName = sFirstName
AppDTO.middleName = sMiddleName
AppDTO.lastName = sLastName
AppDTO.address1 = sAddress1
AppDTO.address2 = sAddress2
AppDTO.city = sCity
AppDTO.state = sState
AppDTO.zip = sZip
AppDTO.dob = sDOB
AppDTO.questionAnswer(0).id = 1
AppDTO.questionAnswer(0).answer(0).id = 1
AppDTO.questionAnswer(0).answer(0).value = ""

the secion of the WSDL that show the question answer array is:
<xsd:element type="stns:ArrayOfQuestionDTO"
name="questionAnswer"
minOccurs="1"
nillable="true"
maxOccurs="1">
</xsd:element>

the snippet of the class' generated from the WSDL are:"
<System.Xml.Serialization.SoapTypeAttribute("Answe rDTO",
"java:com.client.bus.apply.ws")> _
Public Class AnswerDTO
Public answer As String
Public id As Integer
Public value As String
End Class

<System.Xml.Serialization.SoapTypeAttribute("Quest ionDTO",
"java:com.client.bus.apply.ws")> _
Public Class QuestionDTO
Public answer() As AnswerDTO
Public id As Integer
Public question As String
End Class

<System.Xml.Serialization.SoapTypeAttribute("Appli cationDTO",
"java:com.client.bus.apply.ws")> _
'this only show a piece of this code
Public Class ApplicationDTO
Public address1 As String
Public address2 As String
Public city As String
Public dob As String
Public firstName As String
Public lastName As String
Public middleName As String
Public questionAnswer() As QuestionDTO
Public state As String
Public zip As String
End Class
Any thoughts on what I am doing wrong assigning these array values.

Nov 23 '05 #1
0 694

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8258
by: Ben | last post by:
Hi all, This may sound easy but I'm having trouble assigning values to array element. My problem is as follows: m = for o in m: # Here first o is 'Peter'.. I want to do something like this:...
1
2164
by: Jenny | last post by:
Hi, Can I create an array of tags by assigning same name to these tags? For example, I have two <p> tags with the same name t1. But document.all.b.value=document.all.t.length does not...
14
74745
by: Eric Bantock | last post by:
Very basic question I'm afraid. Once an array has been declared, is there a less tedious way of assigning values to its members than the following: myarray=8; myarray=3; myarray=4; myarray=0;...
2
3255
by: ryoung | last post by:
I receive the following error when I attempt to assign values to a web service array. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. ...
28
2412
by: anonymous | last post by:
I have couple of questions related to array addresses. As they belong to the same block, I am putting them here in one single post. I hope nobody minds: char array; int address; Questions...
2
2517
by: Military Smurf | last post by:
I am interested in dumping some results from a collection I have into a group of variables. I have a counter that loops but I don't know how to use the counter to determine my variable names. ...
2
7033
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
1
2246
by: assgar | last post by:
Hi I need help solving a porblem. I have a form that displays a checkbox, service code, description and dropdown with fees on each row. The fee_money and unit array only returns a...
1
4760
by: Nightfarer | last post by:
Hello. I have a big trouble using System.Array class (it's the first time I use it) for a software I'm developing. I have a form with a textbox(numbers) and one button (done). Once the number...
37
2630
by: miken32 | last post by:
In PHP, if a function returns an array it's fairly common to capture its return values like this: <?php list($foo, $bar, $baz) = some_function_that_return_an_array(); ?> In Javascript, would...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7004
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7167
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5464
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.