Test

<back to all web services

EchoComplexTypes

The following routes are available for this service:
All Verbs/echo/complex
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Test.ServiceInterface
Imports Test.ServiceModel.Types

Namespace Global

    Namespace Test.ServiceInterface

        Public Partial Class EchoComplexTypes
            Public Sub New()
                SubTypes = New List(Of SubType)
                SubTypeMap = New Dictionary(Of String, SubType)
                StringMap = New Dictionary(Of String, String)
                IntStringMap = New Dictionary(Of Integer, String)
            End Sub

            Public Overridable Property SubType As SubType
            Public Overridable Property SubTypes As List(Of SubType)
            Public Overridable Property SubTypeMap As Dictionary(Of String, SubType)
            Public Overridable Property StringMap As Dictionary(Of String, String)
            Public Overridable Property IntStringMap As Dictionary(Of Integer, String)
        End Class
    End Namespace

    Namespace Test.ServiceModel.Types

        Public Partial Class SubType
            Public Overridable Property Id As Integer
            Public Overridable Property Name As String
        End Class
    End Namespace
End Namespace

VB.NET EchoComplexTypes DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /echo/complex HTTP/1.1 
Host: test.servicestack.net 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"subType":{"id":0,"name":"String"},"subTypes":[{"id":0,"name":"String"}],"subTypeMap":{"String":{"id":0,"name":"String"}},"stringMap":{"String":"String"},"intStringMap":{"0":"String"}}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"subType":{"id":0,"name":"String"},"subTypes":[{"id":0,"name":"String"}],"subTypeMap":{"String":{"id":0,"name":"String"}},"stringMap":{"String":"String"},"intStringMap":{"0":"String"}}