473,395 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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
2 3250
Most likely the questionAnswer array is empty. Check the length!

Regards,

Sigmund Jakhel
"ryoung" <ry****@livebridge.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
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 #2
Most likely the questionAnswer array is empty. Check the length!

Regards,

Sigmund Jakhel
"ryoung" <ry****@livebridge.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
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 #3

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

Similar topics

3
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
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
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;...
0
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
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
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
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
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...
37
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.