All Verbs | /all-types |
---|
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 HelloAllTypes
{
public String name = null;
public AllTypes allTypes = null;
public AllCollectionTypes allCollectionTypes = null;
public String getName() { return name; }
public HelloAllTypes setName(String value) { this.name = value; return this; }
public AllTypes getAllTypes() { return allTypes; }
public HelloAllTypes setAllTypes(AllTypes value) { this.allTypes = value; return this; }
public AllCollectionTypes getAllCollectionTypes() { return allCollectionTypes; }
public HelloAllTypes setAllCollectionTypes(AllCollectionTypes value) { this.allCollectionTypes = value; return this; }
}
public static class AllTypes
{
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 AllTypes setId(Integer value) { this.id = value; return this; }
public Integer getNullableId() { return nullableId; }
public AllTypes setNullableId(Integer value) { this.nullableId = value; return this; }
public Short getByte() { return Byte; }
public AllTypes setByte(Short value) { this.Byte = value; return this; }
public Short getShort() { return Short; }
public AllTypes setShort(Short value) { this.Short = value; return this; }
public Integer getInt() { return Int; }
public AllTypes setInt(Integer value) { this.Int = value; return this; }
public Long getLong() { return Long; }
public AllTypes setLong(Long value) { this.Long = value; return this; }
public Integer getUShort() { return uShort; }
public AllTypes setUShort(Integer value) { this.uShort = value; return this; }
public Long getUInt() { return uInt; }
public AllTypes setUInt(Long value) { this.uInt = value; return this; }
public BigInteger getULong() { return uLong; }
public AllTypes setULong(BigInteger value) { this.uLong = value; return this; }
public Float getFloat() { return Float; }
public AllTypes setFloat(Float value) { this.Float = value; return this; }
public Double getDouble() { return Double; }
public AllTypes setDouble(Double value) { this.Double = value; return this; }
public BigDecimal getDecimal() { return decimal; }
public AllTypes setDecimal(BigDecimal value) { this.decimal = value; return this; }
public String getString() { return string; }
public AllTypes setString(String value) { this.string = value; return this; }
public Date getDateTime() { return dateTime; }
public AllTypes setDateTime(Date value) { this.dateTime = value; return this; }
public TimeSpan getTimeSpan() { return timeSpan; }
public AllTypes setTimeSpan(TimeSpan value) { this.timeSpan = value; return this; }
public Date getDateTimeOffset() { return dateTimeOffset; }
public AllTypes setDateTimeOffset(Date value) { this.dateTimeOffset = value; return this; }
public UUID getGuid() { return guid; }
public AllTypes setGuid(UUID value) { this.guid = value; return this; }
public String getChar() { return Char; }
public AllTypes setChar(String value) { this.Char = value; return this; }
public KeyValuePair<String, String> getKeyValuePair() { return keyValuePair; }
public AllTypes setKeyValuePair(KeyValuePair<String, String> value) { this.keyValuePair = value; return this; }
public Date getNullableDateTime() { return nullableDateTime; }
public AllTypes setNullableDateTime(Date value) { this.nullableDateTime = value; return this; }
public TimeSpan getNullableTimeSpan() { return nullableTimeSpan; }
public AllTypes setNullableTimeSpan(TimeSpan value) { this.nullableTimeSpan = value; return this; }
public ArrayList<String> getStringList() { return stringList; }
public AllTypes setStringList(ArrayList<String> value) { this.stringList = value; return this; }
public ArrayList<String> getStringArray() { return stringArray; }
public AllTypes setStringArray(ArrayList<String> value) { this.stringArray = value; return this; }
public HashMap<String,String> getStringMap() { return stringMap; }
public AllTypes setStringMap(HashMap<String,String> value) { this.stringMap = value; return this; }
public HashMap<Integer,String> getIntStringMap() { return intStringMap; }
public AllTypes setIntStringMap(HashMap<Integer,String> value) { this.intStringMap = value; return this; }
public SubType getSubType() { return subType; }
public AllTypes 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 AllCollectionTypes
{
public ArrayList<Integer> intArray = null;
public ArrayList<Integer> intList = null;
public ArrayList<String> stringArray = null;
public ArrayList<String> stringList = null;
public ArrayList<Float> floatArray = null;
public ArrayList<Double> doubleList = null;
public byte[] byteArray = null;
public ArrayList<String> charArray = null;
public ArrayList<BigDecimal> decimalList = null;
public ArrayList<Poco> pocoArray = null;
public ArrayList<Poco> pocoList = null;
public HashMap<String,ArrayList<Poco>> pocoLookup = null;
public HashMap<String,ArrayList<HashMap<String,Poco>>> pocoLookupMap = null;
public ArrayList<Integer> getIntArray() { return intArray; }
public AllCollectionTypes setIntArray(ArrayList<Integer> value) { this.intArray = value; return this; }
public ArrayList<Integer> getIntList() { return intList; }
public AllCollectionTypes setIntList(ArrayList<Integer> value) { this.intList = value; return this; }
public ArrayList<String> getStringArray() { return stringArray; }
public AllCollectionTypes setStringArray(ArrayList<String> value) { this.stringArray = value; return this; }
public ArrayList<String> getStringList() { return stringList; }
public AllCollectionTypes setStringList(ArrayList<String> value) { this.stringList = value; return this; }
public ArrayList<Float> getFloatArray() { return floatArray; }
public AllCollectionTypes setFloatArray(ArrayList<Float> value) { this.floatArray = value; return this; }
public ArrayList<Double> getDoubleList() { return doubleList; }
public AllCollectionTypes setDoubleList(ArrayList<Double> value) { this.doubleList = value; return this; }
public byte[] getByteArray() { return byteArray; }
public AllCollectionTypes setByteArray(byte[] value) { this.byteArray = value; return this; }
public ArrayList<String> getCharArray() { return charArray; }
public AllCollectionTypes setCharArray(ArrayList<String> value) { this.charArray = value; return this; }
public ArrayList<BigDecimal> getDecimalList() { return decimalList; }
public AllCollectionTypes setDecimalList(ArrayList<BigDecimal> value) { this.decimalList = value; return this; }
public ArrayList<Poco> getPocoArray() { return pocoArray; }
public AllCollectionTypes setPocoArray(ArrayList<Poco> value) { this.pocoArray = value; return this; }
public ArrayList<Poco> getPocoList() { return pocoList; }
public AllCollectionTypes setPocoList(ArrayList<Poco> value) { this.pocoList = value; return this; }
public HashMap<String,ArrayList<Poco>> getPocoLookup() { return pocoLookup; }
public AllCollectionTypes setPocoLookup(HashMap<String,ArrayList<Poco>> value) { this.pocoLookup = value; return this; }
public HashMap<String,ArrayList<HashMap<String,Poco>>> getPocoLookupMap() { return pocoLookupMap; }
public AllCollectionTypes setPocoLookupMap(HashMap<String,ArrayList<HashMap<String,Poco>>> value) { this.pocoLookupMap = value; return this; }
}
public static class Poco
{
public String name = null;
public String getName() { return name; }
public Poco setName(String value) { this.name = value; return this; }
}
public static class HelloAllTypesResponse
{
public String result = null;
public AllTypes allTypes = null;
public AllCollectionTypes allCollectionTypes = null;
public String getResult() { return result; }
public HelloAllTypesResponse setResult(String value) { this.result = value; return this; }
public AllTypes getAllTypes() { return allTypes; }
public HelloAllTypesResponse setAllTypes(AllTypes value) { this.allTypes = value; return this; }
public AllCollectionTypes getAllCollectionTypes() { return allCollectionTypes; }
public HelloAllTypesResponse setAllCollectionTypes(AllCollectionTypes value) { this.allCollectionTypes = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /all-types HTTP/1.1
Host: test.servicestack.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<HelloAllTypes xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Test.ServiceModel">
<AllCollectionTypes xmlns:d2p1="http://schemas.datacontract.org/2004/07/Test.ServiceModel.Types">
<d2p1:ByteArray>AA==</d2p1:ByteArray>
<d2p1:CharArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:char>0</d3p1:char>
</d2p1:CharArray>
<d2p1:DecimalList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:decimal>0</d3p1:decimal>
</d2p1:DecimalList>
<d2p1:DoubleList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:double>0</d3p1:double>
</d2p1:DoubleList>
<d2p1:FloatArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:float>0</d3p1:float>
</d2p1:FloatArray>
<d2p1:IntArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:int>0</d3p1:int>
</d2p1:IntArray>
<d2p1:IntList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:int>0</d3p1:int>
</d2p1:IntList>
<d2p1:PocoArray>
<d2p1:Poco>
<d2p1:Name>String</d2p1:Name>
</d2p1:Poco>
</d2p1:PocoArray>
<d2p1:PocoList>
<d2p1:Poco>
<d2p1:Name>String</d2p1:Name>
</d2p1:Poco>
</d2p1:PocoList>
<d2p1:PocoLookup xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringArrayOfPocoSxVl28_Sd>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>
<d2p1:Poco>
<d2p1:Name>String</d2p1:Name>
</d2p1:Poco>
</d3p1:Value>
</d3p1:KeyValueOfstringArrayOfPocoSxVl28_Sd>
</d2p1:PocoLookup>
<d2p1:PocoLookupMap xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringArrayOfArrayOfKeyValueOfstringPocoSxVl28_Sdty7Ep6D1>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>
<d3p1:ArrayOfKeyValueOfstringPocoSxVl28_Sd>
<d3p1:KeyValueOfstringPocoSxVl28_Sd>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>
<d2p1:Name>String</d2p1:Name>
</d3p1:Value>
</d3p1:KeyValueOfstringPocoSxVl28_Sd>
</d3p1:ArrayOfKeyValueOfstringPocoSxVl28_Sd>
</d3p1:Value>
</d3p1:KeyValueOfstringArrayOfArrayOfKeyValueOfstringPocoSxVl28_Sdty7Ep6D1>
</d2p1:PocoLookupMap>
<d2p1:StringArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</d2p1:StringArray>
<d2p1:StringList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</d2p1:StringList>
</AllCollectionTypes>
<AllTypes xmlns:d2p1="http://schemas.datacontract.org/2004/07/Test.ServiceModel.Types">
<d2p1:Byte>0</d2p1:Byte>
<d2p1:Char>0</d2p1:Char>
<d2p1:DateTime>0001-01-01T00:00:00</d2p1:DateTime>
<d2p1:DateTimeOffset xmlns:d3p1="http://schemas.datacontract.org/2004/07/System">
<d3p1:DateTime>0001-01-01T00:00:00Z</d3p1:DateTime>
<d3p1:OffsetMinutes>0</d3p1:OffsetMinutes>
</d2p1:DateTimeOffset>
<d2p1:Decimal>0</d2p1:Decimal>
<d2p1:Double>0</d2p1:Double>
<d2p1:Float>0</d2p1:Float>
<d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
<d2p1:Id>0</d2p1:Id>
<d2p1:Int>0</d2p1:Int>
<d2p1:IntStringMap xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfintstring>
<d3p1:Key>0</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfintstring>
</d2p1:IntStringMap>
<d2p1:KeyValuePair xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<d3p1:key>String</d3p1:key>
<d3p1:value>String</d3p1:value>
</d2p1:KeyValuePair>
<d2p1:Long>0</d2p1:Long>
<d2p1:NullableDateTime>0001-01-01T00:00:00</d2p1:NullableDateTime>
<d2p1:NullableId>0</d2p1:NullableId>
<d2p1:NullableTimeSpan>PT0S</d2p1:NullableTimeSpan>
<d2p1:Short>0</d2p1:Short>
<d2p1:String>String</d2p1:String>
<d2p1:StringArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</d2p1:StringArray>
<d2p1:StringList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</d2p1:StringList>
<d2p1:StringMap xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:StringMap>
<d2p1:SubType>
<d2p1:Id>0</d2p1:Id>
<d2p1:Name>String</d2p1:Name>
</d2p1:SubType>
<d2p1:TimeSpan>PT0S</d2p1:TimeSpan>
<d2p1:UInt>0</d2p1:UInt>
<d2p1:ULong>0</d2p1:ULong>
<d2p1:UShort>0</d2p1:UShort>
</AllTypes>
<Name>String</Name>
</HelloAllTypes>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <HelloAllTypesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Test.ServiceModel"> <AllCollectionTypes xmlns:d2p1="http://schemas.datacontract.org/2004/07/Test.ServiceModel.Types"> <d2p1:ByteArray>AA==</d2p1:ByteArray> <d2p1:CharArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:char>0</d3p1:char> </d2p1:CharArray> <d2p1:DecimalList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:decimal>0</d3p1:decimal> </d2p1:DecimalList> <d2p1:DoubleList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:double>0</d3p1:double> </d2p1:DoubleList> <d2p1:FloatArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:float>0</d3p1:float> </d2p1:FloatArray> <d2p1:IntArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:int>0</d3p1:int> </d2p1:IntArray> <d2p1:IntList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:int>0</d3p1:int> </d2p1:IntList> <d2p1:PocoArray> <d2p1:Poco> <d2p1:Name>String</d2p1:Name> </d2p1:Poco> </d2p1:PocoArray> <d2p1:PocoList> <d2p1:Poco> <d2p1:Name>String</d2p1:Name> </d2p1:Poco> </d2p1:PocoList> <d2p1:PocoLookup xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringArrayOfPocoSxVl28_Sd> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <d2p1:Poco> <d2p1:Name>String</d2p1:Name> </d2p1:Poco> </d3p1:Value> </d3p1:KeyValueOfstringArrayOfPocoSxVl28_Sd> </d2p1:PocoLookup> <d2p1:PocoLookupMap xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringArrayOfArrayOfKeyValueOfstringPocoSxVl28_Sdty7Ep6D1> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <d3p1:ArrayOfKeyValueOfstringPocoSxVl28_Sd> <d3p1:KeyValueOfstringPocoSxVl28_Sd> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <d2p1:Name>String</d2p1:Name> </d3p1:Value> </d3p1:KeyValueOfstringPocoSxVl28_Sd> </d3p1:ArrayOfKeyValueOfstringPocoSxVl28_Sd> </d3p1:Value> </d3p1:KeyValueOfstringArrayOfArrayOfKeyValueOfstringPocoSxVl28_Sdty7Ep6D1> </d2p1:PocoLookupMap> <d2p1:StringArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:string>String</d3p1:string> </d2p1:StringArray> <d2p1:StringList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:string>String</d3p1:string> </d2p1:StringList> </AllCollectionTypes> <AllTypes xmlns:d2p1="http://schemas.datacontract.org/2004/07/Test.ServiceModel.Types"> <d2p1:Byte>0</d2p1:Byte> <d2p1:Char>0</d2p1:Char> <d2p1:DateTime>0001-01-01T00:00:00</d2p1:DateTime> <d2p1:DateTimeOffset xmlns:d3p1="http://schemas.datacontract.org/2004/07/System"> <d3p1:DateTime>0001-01-01T00:00:00Z</d3p1:DateTime> <d3p1:OffsetMinutes>0</d3p1:OffsetMinutes> </d2p1:DateTimeOffset> <d2p1:Decimal>0</d2p1:Decimal> <d2p1:Double>0</d2p1:Double> <d2p1:Float>0</d2p1:Float> <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid> <d2p1:Id>0</d2p1:Id> <d2p1:Int>0</d2p1:Int> <d2p1:IntStringMap xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfintstring> <d3p1:Key>0</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfintstring> </d2p1:IntStringMap> <d2p1:KeyValuePair xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic"> <d3p1:key>String</d3p1:key> <d3p1:value>String</d3p1:value> </d2p1:KeyValuePair> <d2p1:Long>0</d2p1:Long> <d2p1:NullableDateTime>0001-01-01T00:00:00</d2p1:NullableDateTime> <d2p1:NullableId>0</d2p1:NullableId> <d2p1:NullableTimeSpan>PT0S</d2p1:NullableTimeSpan> <d2p1:Short>0</d2p1:Short> <d2p1:String>String</d2p1:String> <d2p1:StringArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:string>String</d3p1:string> </d2p1:StringArray> <d2p1:StringList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:string>String</d3p1:string> </d2p1:StringList> <d2p1:StringMap xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringstring> <d3p1:Key>String</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfstringstring> </d2p1:StringMap> <d2p1:SubType> <d2p1:Id>0</d2p1:Id> <d2p1:Name>String</d2p1:Name> </d2p1:SubType> <d2p1:TimeSpan>PT0S</d2p1:TimeSpan> <d2p1:UInt>0</d2p1:UInt> <d2p1:ULong>0</d2p1:ULong> <d2p1:UShort>0</d2p1:UShort> </AllTypes> <Result>String</Result> </HelloAllTypesResponse>