Test

<back to all web services

AllCollectionTypes

using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Test.ServiceModel.Types;

namespace Test.ServiceModel.Types
{
    public partial class AllCollectionTypes
    {
        public AllCollectionTypes()
        {
            IntArray = new int[]{};
            IntList = new List<int>{};
            StringArray = new string[]{};
            StringList = new List<string>{};
            FloatArray = new float[]{};
            DoubleList = new List<double>{};
            ByteArray = new byte[]{};
            CharArray = new Char[]{};
            DecimalList = new List<decimal>{};
            PocoArray = new Poco[]{};
            PocoList = new List<Poco>{};
            PocoLookup = new Dictionary<string, List<Poco>>{};
            PocoLookupMap = new Dictionary<string, List<Dictionary<String,Poco>>>{};
        }

        public virtual int[] IntArray { get; set; }
        public virtual List<int> IntList { get; set; }
        public virtual string[] StringArray { get; set; }
        public virtual List<string> StringList { get; set; }
        public virtual float[] FloatArray { get; set; }
        public virtual List<double> DoubleList { get; set; }
        public virtual byte[] ByteArray { get; set; }
        public virtual Char[] CharArray { get; set; }
        public virtual List<decimal> DecimalList { get; set; }
        public virtual Poco[] PocoArray { get; set; }
        public virtual List<Poco> PocoList { get; set; }
        public virtual Dictionary<string, List<Poco>> PocoLookup { get; set; }
        public virtual Dictionary<string, List<Dictionary<String,Poco>>> PocoLookupMap { get; set; }
    }

    public partial class Poco
    {
        public virtual string Name { get; set; }
    }

}

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