xcaliber2222
Programmer
Hello,
I am importing a generic list into a class to test a webservice:
Here is my TESTList class:
Imports System.Collections.Generic
<Serializable()> _
Public Class TESTList
Inherits List(Of TEST)
End Class
Here is my class for the Getters and Setters:
<Serializable()> _
Public Class TEST
Private _TESTNum As String
Private _Description As String
Private _PCSList As New PCSList
Public Property TESTNum() As String
Get
Return _TESTNum
End Get
Set(ByVal value As String)
_TESTNum = value
End Set
End Property
Public Property Description() As String
Get
Return _Description
End Get
Set(ByVal value As String)
_Description = value
End Set
End Property
Public Property PCSList() As PCSList
Get
Return _PCSList
End Get
Set(ByVal value As PCSList)
_PCSList = value
End Set
End Property
End Class
Here is my main test class that will fire on Page_Load:
Public Partial Class WebServiceTest
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim userName As String
Dim password As String
Dim vendorId As String
Dim jobId As Integer
Dim dttm As DateTime
Dim bol As String
Dim pieces As Integer
Dim Weight As Integer
Dim TESTList As VendorStatusWs.localhost.TEST()
userName = "proco1"
password = "33915"
vendorId = "proco"
jobId = 13661619
dttm = "2009-11-09T17:34:00-07:00"
bol = ""
pieces = 1
Weight = 45
'TESTList = "test"
Dim localwebservice As New localhost.VendorStatusWs
localwebservice.SetStatusDrop(userName, password, vendorId, jobId, dttm, bol, pieces, Weight, waitTime, TESTList)
End Sub
End Class
Could someone please show me how I would assign values to the variable TESTList?
I have an xml file that will doing an http post for these values:
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsi=" xmlns:xsd=" xmlns:soap="<soap:Body>
<SetStatusTest xmlns="<UserName>testuser</UserName>
<Password>11111</Password>
<VendorID>test1</VendorID>
<JobID>12345678</JobID>
<Dttm>2009-11-09T17:34:00-07:00</Dttm>
<TESTList>
<TEST>
<TESTNum>4444-3333</TESTNum>
<Description>2 taped as 1</Description>
<PCSList>
<Weight>45</Weight>
</PCSList>
</TEST>
</TESTList>
<BOL></BOL>
<Pieces>1</Pieces>
<Weight>45</Weight>
</SetStatusTest>
</soap:Body>
</soap:Envelope>
I need to be able to step through my webservice class, and can do so now if the parms are all primitive types (string, integer, etc.)
The problem is when I try to add this generic list and it complains about it not being a 1-dimensional array. I need to be able to bring in this list because there may be more than one item in some cases and thought a generic list might be a good solution since I'm using VS2005.
Also, does it matter what order I'm reading in the parms? In my test class the TESTList is the last parm, but in the xml file it is in the middle somewhat.
Thank you very much to anyone who is taking the valuable time from your day to go through this. I would greatly appreciate any help on this, or even a better suggestion on reading in this list. It's for testing so it doesn't have to be perfect.
Thanks,
Alejandro
I am importing a generic list into a class to test a webservice:
Here is my TESTList class:
Imports System.Collections.Generic
<Serializable()> _
Public Class TESTList
Inherits List(Of TEST)
End Class
Here is my class for the Getters and Setters:
<Serializable()> _
Public Class TEST
Private _TESTNum As String
Private _Description As String
Private _PCSList As New PCSList
Public Property TESTNum() As String
Get
Return _TESTNum
End Get
Set(ByVal value As String)
_TESTNum = value
End Set
End Property
Public Property Description() As String
Get
Return _Description
End Get
Set(ByVal value As String)
_Description = value
End Set
End Property
Public Property PCSList() As PCSList
Get
Return _PCSList
End Get
Set(ByVal value As PCSList)
_PCSList = value
End Set
End Property
End Class
Here is my main test class that will fire on Page_Load:
Public Partial Class WebServiceTest
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim userName As String
Dim password As String
Dim vendorId As String
Dim jobId As Integer
Dim dttm As DateTime
Dim bol As String
Dim pieces As Integer
Dim Weight As Integer
Dim TESTList As VendorStatusWs.localhost.TEST()
userName = "proco1"
password = "33915"
vendorId = "proco"
jobId = 13661619
dttm = "2009-11-09T17:34:00-07:00"
bol = ""
pieces = 1
Weight = 45
'TESTList = "test"
Dim localwebservice As New localhost.VendorStatusWs
localwebservice.SetStatusDrop(userName, password, vendorId, jobId, dttm, bol, pieces, Weight, waitTime, TESTList)
End Sub
End Class
Could someone please show me how I would assign values to the variable TESTList?
I have an xml file that will doing an http post for these values:
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsi=" xmlns:xsd=" xmlns:soap="<soap:Body>
<SetStatusTest xmlns="<UserName>testuser</UserName>
<Password>11111</Password>
<VendorID>test1</VendorID>
<JobID>12345678</JobID>
<Dttm>2009-11-09T17:34:00-07:00</Dttm>
<TESTList>
<TEST>
<TESTNum>4444-3333</TESTNum>
<Description>2 taped as 1</Description>
<PCSList>
<Weight>45</Weight>
</PCSList>
</TEST>
</TESTList>
<BOL></BOL>
<Pieces>1</Pieces>
<Weight>45</Weight>
</SetStatusTest>
</soap:Body>
</soap:Envelope>
I need to be able to step through my webservice class, and can do so now if the parms are all primitive types (string, integer, etc.)
The problem is when I try to add this generic list and it complains about it not being a 1-dimensional array. I need to be able to bring in this list because there may be more than one item in some cases and thought a generic list might be a good solution since I'm using VS2005.
Also, does it matter what order I'm reading in the parms? In my test class the TESTList is the last parm, but in the xml file it is in the middle somewhat.
Thank you very much to anyone who is taking the valuable time from your day to go through this. I would greatly appreciate any help on this, or even a better suggestion on reading in this list. It's for testing so it doesn't have to be perfect.
Thanks,
Alejandro