Note that there are some explanatory texts on larger screens.

plurals
  1. POJavaScriptSerializer exceptions
    primarykey
    data
    text
    <p>I am new to this topic, basically I have this JSON string:</p> <pre><code>"{"payChannleResult":{"lastestPayChannel":"","supportedPayChannelList":{"supportTopPayChannel":[{"name":"FastPay","cashierCode":"CREDITCARD","supportSecPayChannelList":{"supportSecPayChannel":[{"name":"BankA","cashierCode":"CREDITCARD_A"},{"name":"BankB","cashierCode":"CREDITCARD_B"}, {"name":"BankE","cashierCode":"CREDITCARD_E"}, {"name":"More","cashierCode":"CREDITCARD"}]}}, {"name":"Credits","cashierCode":"DEBITCARD","supportSecPayChannelList":{"supportSecPayChannel":[{"name":"BankF","cashierCode":"DEBITCARD_F"}, {"name":"BankI","cashierCode":"DEBITCARD_I"}, {"name":"More","cashierCode":"DEBITCARD"}]}}]}}}" </code></pre> <p>And I have classes for this:</p> <pre><code>&lt;Serializable()&gt; Public Class RootObject Private _payChannelResult As PayChannleResult Public Property payChannleResult() As PayChannleResult Get Return _payChannelResult End Get Set(ByVal value As PayChannleResult) _payChannelResult = value End Set End Property End Class &lt;Serializable()&gt; Public Class PayChannleResult Private _lastestPayChannel As String 'LastestPayChannel Private _supportedPayChannelList As SupportedPayChannelList Public Property lastestPayChannel() As String Get Return _lastestPayChannel End Get Set(ByVal value As String) _lastestPayChannel = value End Set End Property Public Property supportedPayChannelList() As SupportedPayChannelList Get Return _supportedPayChannelList End Get Set(ByVal value As SupportedPayChannelList) _supportedPayChannelList = value End Set End Property End Class &lt;Serializable()&gt; Public Class SupportedPayChannelList Private _supportTopPayChannel As SupportTopPayChannel Public Property supportTopPayChannel() As SupportTopPayChannel Get Return _supportTopPayChannel End Get Set(ByVal value As SupportTopPayChannel) _supportTopPayChannel = value End Set End Property End Class &lt;Serializable()&gt; Public Class SupportTopPayChannel Private _name As String Private _cashierCode As String Private _supportSecPayChannelList As SupportSecPayChannelList Public Property name() As String Get Return _name End Get Set(ByVal value As String) _name = value End Set End Property Public Property cashierCode() As String Get Return _cashierCode End Get Set(ByVal value As String) _cashierCode = value End Set End Property Public Property supportSecPayChannelList() As SupportSecPayChannelList Get Return _supportSecPayChannelList End Get Set(ByVal value As SupportSecPayChannelList) _supportSecPayChannelList = value End Set End Property End Class &lt;Serializable()&gt; Public Class SupportSecPayChannelList Private _supportSecPayChannel As List(Of SupportSecPayChannel) Public Property supportSecPayChannel() As List(Of SupportSecPayChannel) Get Return _supportSecPayChannel End Get Set(ByVal value As List(Of SupportSecPayChannel)) _supportSecPayChannel = value End Set End Property End Class &lt;Serializable()&gt; Public Class SupportSecPayChannel Private _name As String Private _cashierCode As String Public Property name() As String Get Return _name End Get Set(ByVal value As String) _name = value End Set End Property Public Property cashierCode() As String Get Return _cashierCode End Get Set(ByVal value As String) _cashierCode = value End Set End Property End Class &lt;Serializable()&gt; Public Class LastestPayChannel Private _name As String Private _cashierCode As String Public Property name() As String Get Return _name End Get Set(ByVal value As String) _name = value End Set End Property Public Property cashierCode() As String Get Return _cashierCode End Get Set(ByVal value As String) _cashierCode = value End Set End Property End Class </code></pre> <p>And finally this is how I called the deserializer function:</p> <pre><code>Dim seriliazer As JavaScriptSerializer = New JavaScriptSerializer Dim p As RootObject = seriliazer.Deserialize(Of RootObject)(strJson) </code></pre> <p>But it gives error: Type 'SupportTopPayChannel' is not supported for deserialization of an array.</p> <p>Please help me out, thanks a lot!!!!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload