Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Test.ServiceModel
Namespace Global
Namespace Test.ServiceModel
Public Partial Class Channel
Public Overridable Property Name As String
Public Overridable Property Value As String
End Class
Public Partial Class Device
Public Overridable Property Id As Long
Public Overridable Property Type As String
Public Overridable Property TimeStamp As Long
Public Overridable Property Channels As List(Of Channel) = New List(Of Channel)
End Class
Public Partial Class Logger
Public Overridable Property Id As Long
Public Overridable Property Devices As List(Of Device) = New List(Of Device)
End Class
Public Partial Class StoreLogs
Public Overridable Property Loggers As List(Of Logger) = New List(Of Logger)
End Class
Public Partial Class StoreLogsResponse
Public Overridable Property ExistingLogs As List(Of Logger) = New List(Of Logger)
Public Overridable Property ResponseStatus As ResponseStatus
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /json/reply/StoreLogs HTTP/1.1
Host: test.servicestack.net
Accept: application/json
Content-Type: application/json
Content-Length: length
{"loggers":[{"id":0,"devices":[{"id":0,"type":"String","timeStamp":0,"channels":[{"name":"String","value":"String"}]}]}]}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"existingLogs":[{"id":0,"devices":[{"id":0,"type":"String","timeStamp":0,"channels":[{"name":"String","value":"String"}]}]}],"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}