Unable to cast object of type 'System.Collections.Generic.List`1[System.String]' to type 'WindowsApplication1.ServiceReferenceVSAPI.ArrayOfString'.
What is going on here? I cannot find a simple viable solution on Google.
Here is my WCF class:
here is the client code:
And i get the error on the vsetorder.seats = seats line.
I have tried every single model change on the wcf service (i thing system.collection.generic list is the most proper?) i have added and remove xml serialization features
alover and nothing works?
Any help?
P.S. I could care less if i use a list of or an arraylist but nothing works
What is going on here? I cannot find a simple viable solution on Google.
Here is my WCF class:
Code:
Namespace MyTypes
<DataContract(), KnownType(GetType(List(Of String))), XmlSerializerFormat()>
<Serializable()>
Public Class setorder
<DataMember()>
Public Property LoyaltyUserName() As String
Get
Return m_LoyaltyUserName
End Get
Set(value As String)
m_LoyaltyUserName = value
End Set
End Property
<DataMember()>
Private m_LoyaltyUserName As String
<DataMember()>
Public Property LoyaltyPassword() As String
Get
Return m_LoyaltyPassword
End Get
Set(value As String)
m_LoyaltyPassword = value
End Set
End Property
<DataMember()>
Private m_LoyaltyPassword As String
<DataMember()>
Public Property seats As List(Of String)
Get
Return m_seats
End Get
Set(value As List(Of String))
m_seats = value
End Set
End Property
<DataMember()>
Private m_seats As List(Of String)
End Class
End Namespace
Code:
Dim vsetorder As New ServiceReferenceVSAPI.setorder
vsetorder.LoyaltyPassword = "asd"
vsetorder.LoyaltyUserName = "g"
Dim seats As New List(Of String)
seats.Add("3")
vsetorder.seats = seats
I have tried every single model change on the wcf service (i thing system.collection.generic list is the most proper?) i have added and remove xml serialization features
alover and nothing works?
Any help?
P.S. I could care less if i use a list of or an arraylist but nothing works