Test

<back to all web services

AllCollectionTypes

Imports System
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 Sub New()
                IntArray = New Integer(){}
                IntList = New List(Of Integer)
                StringArray = New String(){}
                StringList = New List(Of String)
                FloatArray = New Single(){}
                DoubleList = New List(Of Double)
                ByteArray = New Byte(){}
                CharArray = New Char(){}
                DecimalList = New List(Of Decimal)
                PocoArray = New Poco(){}
                PocoList = New List(Of Poco)
                PocoLookup = New Dictionary(Of String, List(Of Poco))
                PocoLookupMap = New Dictionary(Of String, List(Of Dictionary(Of String,Poco)))
            End Sub

            Public Overridable Property IntArray As Integer()
            Public Overridable Property IntList As List(Of Integer)
            Public Overridable Property StringArray As String()
            Public Overridable Property StringList As List(Of String)
            Public Overridable Property FloatArray As Single()
            Public Overridable Property DoubleList As List(Of Double)
            Public Overridable Property ByteArray As Byte()
            Public Overridable Property CharArray As Char()
            Public Overridable Property DecimalList As List(Of Decimal)
            Public Overridable Property PocoArray As Poco()
            Public Overridable Property PocoList As List(Of Poco)
            Public Overridable Property PocoLookup As Dictionary(Of String, List(Of Poco))
            Public Overridable Property PocoLookupMap As 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 .jsv suffix or ?format=jsv

HTTP + JSV

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

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

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

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