Test

<back to all web services

AllCollectionTypes

Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Test.ServiceModel.Types

Namespace Global

    Namespace Test.ServiceModel.Types

        Public Partial Class AllCollectionTypes
            Public Overridable Property IntArray As Integer() = New Integer(){}
            Public Overridable Property IntList As List(Of Integer) = New List(Of Integer)
            Public Overridable Property StringArray As String() = New String(){}
            Public Overridable Property StringList As List(Of String) = New List(Of String)
            Public Overridable Property FloatArray As Single() = New Single(){}
            Public Overridable Property DoubleList As List(Of Double) = New List(Of Double)
            Public Overridable Property ByteArray As Byte() = New Byte(){}
            Public Overridable Property CharArray As Char() = New Char(){}
            Public Overridable Property DecimalList As List(Of Decimal) = New List(Of Decimal)
            Public Overridable Property PocoArray As Poco() = New Poco(){}
            Public Overridable Property PocoList As List(Of Poco) = New List(Of Poco)
            Public Overridable Property PocoLookup As Dictionary(Of String, List(Of Poco)) = New Dictionary(Of String, List(Of Poco))
            Public Overridable Property PocoLookupMap As Dictionary(Of String, List(Of Dictionary(Of String,Poco))) = New Dictionary(Of String, List(Of Dictionary(Of String,Poco)))
        End Class

        Public Partial Class Poco
            Public Overridable Property Name As String
        End Class
    End Namespace
End Namespace

VB.NET AllCollectionTypes DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /json/reply/AllCollectionTypes HTTP/1.1 
Host: test.servicestack.net 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"intArray":[0],"intList":[0],"stringArray":["String"],"stringList":["String"],"floatArray":[0],"doubleList":[0],"byteArray":"AA==","charArray":["\u0000"],"decimalList":[0],"pocoArray":[{"name":"String"}],"pocoList":[{"name":"String"}],"pocoLookup":{"String":[{"name":"String"}]},"pocoLookupMap":{"String":[{"String":{"name":"String"}}]}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"intArray":[0],"intList":[0],"stringArray":["String"],"stringList":["String"],"floatArray":[0],"doubleList":[0],"byteArray":"AA==","charArray":["\u0000"],"decimalList":[0],"pocoArray":[{"name":"String"}],"pocoList":[{"name":"String"}],"pocoLookup":{"String":[{"name":"String"}]},"pocoLookupMap":{"String":[{"String":{"name":"String"}}]}}