Test

<back to all web services

TestUploadWithDto

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

namespace Test.ServiceModel
{
    public partial class TestUploadWithDto
        : IPost
    {
        public virtual int Int { get; set; }
        public virtual int? NullableId { get; set; }
        public virtual long Long { get; set; }
        public virtual double Double { get; set; }
        public virtual string String { get; set; }
        public virtual DateTime DateTime { get; set; }
        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 Poco[] PocoArray { get; set; }
        public virtual List<Poco> PocoList { get; set; }
        public virtual byte?[] NullableByteArray { get; set; }
        public virtual List<Nullable<Byte>> NullableByteList { get; set; }
        public virtual DateTime?[] NullableDateTimeArray { get; set; }
        public virtual List<Nullable<DateTime>> NullableDateTimeList { get; set; }
        public virtual Dictionary<string, List<Poco>> PocoLookup { get; set; }
        public virtual Dictionary<string, List<Dictionary<String,Poco>>> PocoLookupMap { get; set; }
        public virtual Dictionary<string, List<String>> MapList { get; set; }
    }

}

namespace Test.ServiceModel.Types
{
    public partial class Poco
    {
        public virtual string Name { get; set; }
    }

}

C# TestUploadWithDto 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/TestUploadWithDto HTTP/1.1 
Host: test.servicestack.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	int: 0,
	nullableId: 0,
	long: 0,
	double: 0,
	string: String,
	dateTime: 0001-01-01,
	intArray: 
	[
		0
	],
	intList: 
	[
		0
	],
	stringArray: 
	[
		String
	],
	stringList: 
	[
		String
	],
	pocoArray: 
	[
		{
			name: String
		}
	],
	pocoList: 
	[
		{
			name: String
		}
	],
	nullableByteArray: 
	[
		0
	],
	nullableByteList: 
	[
		0
	],
	nullableDateTimeArray: 
	[
		0001-01-01
	],
	nullableDateTimeList: 
	[
		0001-01-01
	],
	pocoLookup: 
	{
		String: 
		[
			{
				name: String
			}
		]
	},
	pocoLookupMap: 
	{
		String: 
		[
			{
				String: 
				{
					name: String
				}
			}
		]
	},
	mapList: 
	{
		String: 
		[
			String
		]
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	int: 0,
	nullableId: 0,
	long: 0,
	double: 0,
	string: String,
	dateTime: 0001-01-01,
	intArray: 
	[
		0
	],
	intList: 
	[
		0
	],
	stringArray: 
	[
		String
	],
	stringList: 
	[
		String
	],
	pocoArray: 
	[
		{
			name: String
		}
	],
	pocoList: 
	[
		{
			name: String
		}
	],
	nullableByteArray: 
	[
		0
	],
	nullableByteList: 
	[
		0
	],
	nullableDateTimeArray: 
	[
		0001-01-01
	],
	nullableDateTimeList: 
	[
		0001-01-01
	],
	pocoLookup: 
	{
		String: 
		[
			{
				name: String
			}
		]
	},
	pocoLookupMap: 
	{
		String: 
		[
			{
				String: 
				{
					name: String
				}
			}
		]
	},
	mapList: 
	{
		String: 
		[
			String
		]
	}
}