Test

<back to all web services

AllCollectionTypes

namespace Test.ServiceModel.Types

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type Poco() = 
        member val Name:String = null with get,set

    [<AllowNullLiteral>]
    type AllCollectionTypes() = 
        member val IntArray:Int32[] = [||] with get,set
        member val IntList:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val StringArray:String[] = [||] with get,set
        member val StringList:ResizeArray<String> = new ResizeArray<String>() with get,set
        member val FloatArray:Single[] = [||] with get,set
        member val DoubleList:ResizeArray<Double> = new ResizeArray<Double>() with get,set
        member val ByteArray:Byte[] = [||] with get,set
        member val CharArray:Char[] = [||] with get,set
        member val DecimalList:ResizeArray<Decimal> = new ResizeArray<Decimal>() with get,set
        member val PocoArray:Poco[] = [||] with get,set
        member val PocoList:ResizeArray<Poco> = new ResizeArray<Poco>() with get,set
        member val PocoLookup:Dictionary<String, List<Poco>> = new Dictionary<String, List<Poco>>() with get,set
        member val PocoLookupMap:Dictionary<String, List<Dictionary<String,Poco>>> = new Dictionary<String, List<Dictionary<String,Poco>>>() with get,set

F# 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
				}
			}
		]
	}
}