All Verbs | /echo/types |
---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;
public class dtos
{
public static class EchoTypes
{
@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 Short getByte() { return Byte; }
public EchoTypes setByte(Short value) { this.Byte = value; return this; }
public Short getShort() { return Short; }
public EchoTypes setShort(Short value) { this.Short = value; return this; }
public Integer getInt() { return Int; }
public EchoTypes setInt(Integer value) { this.Int = value; return this; }
public Long getLong() { return Long; }
public EchoTypes setLong(Long value) { this.Long = value; return this; }
public Integer getUShort() { return uShort; }
public EchoTypes setUShort(Integer value) { this.uShort = value; return this; }
public Long getUInt() { return uInt; }
public EchoTypes setUInt(Long value) { this.uInt = value; return this; }
public BigInteger getULong() { return uLong; }
public EchoTypes setULong(BigInteger value) { this.uLong = value; return this; }
public Float getFloat() { return Float; }
public EchoTypes setFloat(Float value) { this.Float = value; return this; }
public Double getDouble() { return Double; }
public EchoTypes setDouble(Double value) { this.Double = value; return this; }
public BigDecimal getDecimal() { return decimal; }
public EchoTypes setDecimal(BigDecimal value) { this.decimal = value; return this; }
public String getString() { return string; }
public EchoTypes setString(String value) { this.string = value; return this; }
public Date getDateTime() { return dateTime; }
public EchoTypes setDateTime(Date value) { this.dateTime = value; return this; }
public TimeSpan getTimeSpan() { return timeSpan; }
public EchoTypes setTimeSpan(TimeSpan value) { this.timeSpan = value; return this; }
public Date getDateTimeOffset() { return dateTimeOffset; }
public EchoTypes setDateTimeOffset(Date value) { this.dateTimeOffset = value; return this; }
public UUID getGuid() { return guid; }
public EchoTypes setGuid(UUID value) { this.guid = value; return this; }
public String getChar() { return Char; }
public EchoTypes setChar(String value) { this.Char = 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 /echo/types HTTP/1.1
Host: test.servicestack.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<EchoTypes xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Test.ServiceInterface">
<Byte>0</Byte>
<Char>0</Char>
<DateTime>0001-01-01T00:00:00</DateTime>
<DateTimeOffset xmlns:d2p1="http://schemas.datacontract.org/2004/07/System">
<d2p1:DateTime>0001-01-01T00:00:00Z</d2p1:DateTime>
<d2p1:OffsetMinutes>0</d2p1:OffsetMinutes>
</DateTimeOffset>
<Decimal>0</Decimal>
<Double>0</Double>
<Float>0</Float>
<Guid>00000000-0000-0000-0000-000000000000</Guid>
<Int>0</Int>
<Long>0</Long>
<Short>0</Short>
<String>String</String>
<TimeSpan>PT0S</TimeSpan>
<UInt>0</UInt>
<ULong>0</ULong>
<UShort>0</UShort>
</EchoTypes>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <EchoTypes xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Test.ServiceInterface"> <Byte>0</Byte> <Char>0</Char> <DateTime>0001-01-01T00:00:00</DateTime> <DateTimeOffset xmlns:d2p1="http://schemas.datacontract.org/2004/07/System"> <d2p1:DateTime>0001-01-01T00:00:00Z</d2p1:DateTime> <d2p1:OffsetMinutes>0</d2p1:OffsetMinutes> </DateTimeOffset> <Decimal>0</Decimal> <Double>0</Double> <Float>0</Float> <Guid>00000000-0000-0000-0000-000000000000</Guid> <Int>0</Int> <Long>0</Long> <Short>0</Short> <String>String</String> <TimeSpan>PT0S</TimeSpan> <UInt>0</UInt> <ULong>0</ULong> <UShort>0</UShort> </EchoTypes>