Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Test.ServiceModel
Imports Test.ServiceModel.Types
Namespace Global
Namespace Test.ServiceModel
Public Partial Class TestUploadWithDto
Implements IPost
Public Overridable Property Int As Integer
Public Overridable Property NullableId As Integer?
Public Overridable Property [Long] As Long
Public Overridable Property [Double] As Double
Public Overridable Property [String] As String
Public Overridable Property DateTime As Date
Public Overridable Property IntArray As Integer()
Public Overridable Property IntList As List(Of Integer)
Public Overridable Property StringArray As String()
Public Overridable Property StringList As List(Of String)
Public Overridable Property PocoArray As Poco()
Public Overridable Property PocoList As List(Of Poco)
Public Overridable Property NullableByteArray As Byte?()
Public Overridable Property NullableByteList As List(Of Nullable(Of Byte))
Public Overridable Property NullableDateTimeArray As Date?()
Public Overridable Property NullableDateTimeList As List(Of Nullable(Of DateTime))
Public Overridable Property PocoLookup As Dictionary(Of String, List(Of Poco))
Public Overridable Property PocoLookupMap As Dictionary(Of String, List(Of Dictionary(Of String,Poco)))
Public Overridable Property MapList As Dictionary(Of String, List(Of String))
End Class
End Namespace
Namespace Test.ServiceModel.Types
Public Partial Class Poco
Public Overridable Property Name As String
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=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 ] } }