Test

<back to all web services

HelloSubAllTypes

import java.math.*;
import java.util.*;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;

public class dtos
{

    public static class HelloSubAllTypes extends AllTypesBase
    {
        public Integer hierarchy = null;
        
        public Integer getHierarchy() { return hierarchy; }
        public HelloSubAllTypes setHierarchy(Integer value) { this.hierarchy = value; return this; }
    }

    public static class AllTypesBase
    {
        public Integer id = null;
        public Integer nullableId = null;
        @SerializedName("byte") public Short Byte = null;
        @SerializedName("short") public Short Short = null;
        @SerializedName("int") public Integer Int = null;
        @SerializedName("long") public Long Long = null;
        public Integer uShort = null;
        public Long uInt = null;
        public BigInteger uLong = null;
        @SerializedName("float") public Float Float = null;
        @SerializedName("double") public Double Double = null;
        public BigDecimal decimal = null;
        public String string = null;
        public Date dateTime = null;
        public TimeSpan timeSpan = null;
        public Date dateTimeOffset = null;
        public UUID guid = null;
        @SerializedName("char") public String Char = null;
        public KeyValuePair<String, String> keyValuePair = null;
        public Date nullableDateTime = null;
        public TimeSpan nullableTimeSpan = null;
        public ArrayList<String> stringList = null;
        public ArrayList<String> stringArray = null;
        public HashMap<String,String> stringMap = null;
        public HashMap<Integer,String> intStringMap = null;
        public SubType subType = null;
        
        public Integer getId() { return id; }
        public AllTypesBase setId(Integer value) { this.id = value; return this; }
        public Integer getNullableId() { return nullableId; }
        public AllTypesBase setNullableId(Integer value) { this.nullableId = value; return this; }
        public Short getByte() { return Byte; }
        public AllTypesBase setByte(Short value) { this.Byte = value; return this; }
        public Short getShort() { return Short; }
        public AllTypesBase setShort(Short value) { this.Short = value; return this; }
        public Integer getInt() { return Int; }
        public AllTypesBase setInt(Integer value) { this.Int = value; return this; }
        public Long getLong() { return Long; }
        public AllTypesBase setLong(Long value) { this.Long = value; return this; }
        public Integer getUShort() { return uShort; }
        public AllTypesBase setUShort(Integer value) { this.uShort = value; return this; }
        public Long getUInt() { return uInt; }
        public AllTypesBase setUInt(Long value) { this.uInt = value; return this; }
        public BigInteger getULong() { return uLong; }
        public AllTypesBase setULong(BigInteger value) { this.uLong = value; return this; }
        public Float getFloat() { return Float; }
        public AllTypesBase setFloat(Float value) { this.Float = value; return this; }
        public Double getDouble() { return Double; }
        public AllTypesBase setDouble(Double value) { this.Double = value; return this; }
        public BigDecimal getDecimal() { return decimal; }
        public AllTypesBase setDecimal(BigDecimal value) { this.decimal = value; return this; }
        public String getString() { return string; }
        public AllTypesBase setString(String value) { this.string = value; return this; }
        public Date getDateTime() { return dateTime; }
        public AllTypesBase setDateTime(Date value) { this.dateTime = value; return this; }
        public TimeSpan getTimeSpan() { return timeSpan; }
        public AllTypesBase setTimeSpan(TimeSpan value) { this.timeSpan = value; return this; }
        public Date getDateTimeOffset() { return dateTimeOffset; }
        public AllTypesBase setDateTimeOffset(Date value) { this.dateTimeOffset = value; return this; }
        public UUID getGuid() { return guid; }
        public AllTypesBase setGuid(UUID value) { this.guid = value; return this; }
        public String getChar() { return Char; }
        public AllTypesBase setChar(String value) { this.Char = value; return this; }
        public KeyValuePair<String, String> getKeyValuePair() { return keyValuePair; }
        public AllTypesBase setKeyValuePair(KeyValuePair<String, String> value) { this.keyValuePair = value; return this; }
        public Date getNullableDateTime() { return nullableDateTime; }
        public AllTypesBase setNullableDateTime(Date value) { this.nullableDateTime = value; return this; }
        public TimeSpan getNullableTimeSpan() { return nullableTimeSpan; }
        public AllTypesBase setNullableTimeSpan(TimeSpan value) { this.nullableTimeSpan = value; return this; }
        public ArrayList<String> getStringList() { return stringList; }
        public AllTypesBase setStringList(ArrayList<String> value) { this.stringList = value; return this; }
        public ArrayList<String> getStringArray() { return stringArray; }
        public AllTypesBase setStringArray(ArrayList<String> value) { this.stringArray = value; return this; }
        public HashMap<String,String> getStringMap() { return stringMap; }
        public AllTypesBase setStringMap(HashMap<String,String> value) { this.stringMap = value; return this; }
        public HashMap<Integer,String> getIntStringMap() { return intStringMap; }
        public AllTypesBase setIntStringMap(HashMap<Integer,String> value) { this.intStringMap = value; return this; }
        public SubType getSubType() { return subType; }
        public AllTypesBase setSubType(SubType value) { this.subType = value; return this; }
    }

    public static class SubType
    {
        public Integer id = null;
        public String name = null;
        
        public Integer getId() { return id; }
        public SubType setId(Integer value) { this.id = value; return this; }
        public String getName() { return name; }
        public SubType setName(String value) { this.name = value; return this; }
    }

    public static class SubAllTypes extends AllTypesBase
    {
        public Integer hierarchy = null;
        
        public Integer getHierarchy() { return hierarchy; }
        public SubAllTypes setHierarchy(Integer value) { this.hierarchy = value; return this; }
    }

}

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

{
	hierarchy: 0,
	id: 0,
	nullableId: 0,
	byte: 0,
	short: 0,
	int: 0,
	long: 0,
	uShort: 0,
	uInt: 0,
	uLong: 0,
	float: 0,
	double: 0,
	decimal: 0,
	string: String,
	dateTime: 0001-01-01,
	timeSpan: PT0S,
	dateTimeOffset: 0001-01-01T00:00:00.0000000+00:00,
	guid: 00000000000000000000000000000000,
	char: ,
	keyValuePair: 
	{
		key: String,
		value: String
	},
	nullableDateTime: 0001-01-01,
	nullableTimeSpan: PT0S,
	stringList: 
	[
		String
	],
	stringArray: 
	[
		String
	],
	stringMap: 
	{
		String: String
	},
	intStringMap: 
	{
		0: String
	},
	subType: 
	{
		id: 0,
		name: String
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	hierarchy: 0,
	id: 0,
	nullableId: 0,
	byte: 0,
	short: 0,
	int: 0,
	long: 0,
	uShort: 0,
	uInt: 0,
	uLong: 0,
	float: 0,
	double: 0,
	decimal: 0,
	string: String,
	dateTime: 0001-01-01,
	timeSpan: PT0S,
	dateTimeOffset: 0001-01-01T00:00:00.0000000+00:00,
	guid: 00000000000000000000000000000000,
	char: ,
	keyValuePair: 
	{
		key: String,
		value: String
	},
	nullableDateTime: 0001-01-01,
	nullableTimeSpan: PT0S,
	stringList: 
	[
		String
	],
	stringArray: 
	[
		String
	],
	stringMap: 
	{
		String: String
	},
	intStringMap: 
	{
		0: String
	},
	subType: 
	{
		id: 0,
		name: String
	}
}