Hello.
I have yet another JSON deserialisation problem, and it's frustrating me. I have had a previous deserialisation problem (
How do I deserialise "multi-level" JSON in VB.NET?[
^]), and that was solved quickly. But I followed the steps to repeat that with yet another JSON string, and it's throwing the same error. Here is the code I am trying to deserialise:
{"timestamp":1470270507172,"profileId":"e7cc8ec97b294d2484843d330f136bbd","profileName":"iProgramIt","textures":{"SKIN":{"url":"http://textures.minecraft.net/texture/f7f6f0e6a2a3d6db69a4afa9fef28ea4d56f37199277f95c1d2b5f0aaa4e2"}}}
It gets stuck on type SKIN.
Here is MY code in VB.NET.
Public Class SKIN
Public Property url As List(Of String)
End Class
Public Class CAPE
Public Property url As List(Of String)
End Class
Public Class PropertyX
Public Property name As String
Public Property value As String
Public Property signature As String
End Class
Public Class Skins_Base
Public Property id As String
Public Property name As String
Public Property properties As List(Of PropertyX)
End Class
Public Class Textures
Public Property SKIN As List(Of SKIN)
Public Property CAPE As List(Of CAPE)
End Class
Public Class Skins
Public Property timestamp As String
Public Property profileId As String
Public Property profileName As String
Public Property isPublic As String
Public Property textures As List(Of Textures)
End Class
Public Function GETX(ByVal Str As String) As String
Dim wc As New System.Net.WebClient
Return wc.DownloadString(Str)
End Function
Deserialisation (where the error occurs):
Dim SkinsBase As String = GETX("https://sessionserver.mojang.com/session/minecraft/profile/" & obj.id)
Dim xObj = JsonConvert.DeserializeObject(Of Skins_Base)(SkinsBase)
Dim b As Byte() = Convert.FromBase64String(xObj.properties(0).value)
Dim bString As String = System.Text.Encoding.UTF8.GetString(b)
Dim b64 = JsonConvert.DeserializeObject(Of Skins)(bString)
MsgBox(b64.textures(0).SKIN(0).url(0))
Thank you in advance.
-iProgramIt
What I have tried:
http://www.codeproject.com/Questions/1116304/How-do-I-deserialise-multi-level-JSON-in-VB-NET. Didn't solve this issue, now. Googled and nothing matches this circumstance.