MyApp

<back to all web services

HelloAllTypes

Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports MyApp.ServiceModel

Namespace Global

    Namespace MyApp.ServiceModel

        Public Partial Class AllCollectionTypes
            Public Sub New()
                IntArray = New Integer(){}
                IntList = New List(Of Integer)
                StringArray = New String(){}
                StringList = New List(Of String)
                PocoArray = New Poco(){}
                PocoList = New List(Of Poco)
                NullableByteArray = New Nullable(Of Byte){}
                NullableByteList = New List(Of Nullable(Of Byte))
                NullableDateTimeArray = New Nullable(Of Date){}
                NullableDateTimeList = New List(Of Nullable(Of DateTime))
                PocoLookup = New Dictionary(Of String, List(Of Poco))
                PocoLookupMap = New Dictionary(Of String, List(Of Dictionary(Of String,Poco)))
            End Sub

            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 Nullable(Of Byte)
            Public Overridable Property NullableByteList As List(Of Nullable(Of Byte))
            Public Overridable Property NullableDateTimeArray As Nullable(Of 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)))
        End Class

        Public Partial Class AllTypes
            Implements IGet
            Public Sub New()
                StringList = New List(Of String)
                StringArray = New String(){}
                StringMap = New Dictionary(Of String, String)
                IntStringMap = New Dictionary(Of Integer, String)
            End Sub

            Public Overridable Property Id As Integer
            Public Overridable Property NullableId As Nullable(Of Integer)
            Public Overridable Property [Byte] As Byte
            Public Overridable Property [Short] As Short
            Public Overridable Property Int As Integer
            Public Overridable Property [Long] As Long
            Public Overridable Property [UShort] As UInt16
            Public Overridable Property UInt As UInt32
            Public Overridable Property [ULong] As UInt64
            Public Overridable Property Float As Single
            Public Overridable Property [Double] As Double
            Public Overridable Property [Decimal] As Decimal
            Public Overridable Property [String] As String
            Public Overridable Property DateTime As Date
            Public Overridable Property TimeSpan As TimeSpan
            Public Overridable Property DateTimeOffset As DateTimeOffset
            Public Overridable Property Guid As Guid
            Public Overridable Property [Char] As Char
            Public Overridable Property KeyValuePair As KeyValuePair(Of String, String)
            Public Overridable Property NullableDateTime As Nullable(Of Date)
            Public Overridable Property NullableTimeSpan As Nullable(Of TimeSpan)
            Public Overridable Property StringList As List(Of String)
            Public Overridable Property StringArray As String()
            Public Overridable Property StringMap As Dictionary(Of String, String)
            Public Overridable Property IntStringMap As Dictionary(Of Integer, String)
            Public Overridable Property SubType As SubType
            Public Overridable Property Point As String
            <DataMember(Name:="aliasedName")>
            Public Overridable Property OriginalName As String
        End Class

        Public Partial Class HelloAllTypes
            Public Overridable Property Name As String
            Public Overridable Property AllTypes As AllTypes
            Public Overridable Property AllCollectionTypes As AllCollectionTypes
        End Class

        Public Partial Class HelloAllTypesResponse
            Public Overridable Property Result As String
            Public Overridable Property AllTypes As AllTypes
            Public Overridable Property AllCollectionTypes As AllCollectionTypes
        End Class

        Public Partial Class Poco
            Public Overridable Property Name As String
        End Class

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

VB.NET HelloAllTypes DTOs

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

HTTP + XML

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

POST /xml/reply/HelloAllTypes HTTP/1.1 
Host: blazor-gallery.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/MyApp.ServiceModel">
  <AllCollectionTypes>
    <IntArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </IntArray>
    <IntList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </IntList>
    <NullableByteArray xmlns:d3p1="http://schemas.datacontract.org/2004/07/System">
      <d3p1:unsignedByte>0</d3p1:unsignedByte>
    </NullableByteArray>
    <NullableByteList xmlns:d3p1="http://schemas.datacontract.org/2004/07/System">
      <d3p1:unsignedByte>0</d3p1:unsignedByte>
    </NullableByteList>
    <NullableDateTimeArray xmlns:d3p1="http://schemas.datacontract.org/2004/07/System">
      <d3p1:dateTime>0001-01-01T00:00:00</d3p1:dateTime>
    </NullableDateTimeArray>
    <NullableDateTimeList xmlns:d3p1="http://schemas.datacontract.org/2004/07/System">
      <d3p1:dateTime>0001-01-01T00:00:00</d3p1:dateTime>
    </NullableDateTimeList>
    <PocoArray>
      <Poco>
        <Name>String</Name>
      </Poco>
    </PocoArray>
    <PocoList>
      <Poco>
        <Name>String</Name>
      </Poco>
    </PocoList>
    <PocoLookup xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringArrayOfPocoB8fmgb81>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>
          <Poco>
            <Name>String</Name>
          </Poco>
        </d3p1:Value>
      </d3p1:KeyValueOfstringArrayOfPocoB8fmgb81>
    </PocoLookup>
    <PocoLookupMap xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringArrayOfArrayOfKeyValueOfstringPocoB8fmgb81ty7Ep6D1>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>
          <d3p1:ArrayOfKeyValueOfstringPocoB8fmgb81>
            <d3p1:KeyValueOfstringPocoB8fmgb81>
              <d3p1:Key>String</d3p1:Key>
              <d3p1:Value>
                <Name>String</Name>
              </d3p1:Value>
            </d3p1:KeyValueOfstringPocoB8fmgb81>
          </d3p1:ArrayOfKeyValueOfstringPocoB8fmgb81>
        </d3p1:Value>
      </d3p1:KeyValueOfstringArrayOfArrayOfKeyValueOfstringPocoB8fmgb81ty7Ep6D1>
    </PocoLookupMap>
    <StringArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </StringArray>
    <StringList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </StringList>
  </AllCollectionTypes>
  <AllTypes>
    <Byte>0</Byte>
    <Char>0</Char>
    <DateTime>0001-01-01T00:00:00</DateTime>
    <DateTimeOffset xmlns:d3p1="http://schemas.datacontract.org/2004/07/System">
      <d3p1:DateTime>0001-01-01T00:00:00Z</d3p1:DateTime>
      <d3p1:OffsetMinutes>0</d3p1:OffsetMinutes>
    </DateTimeOffset>
    <Decimal>0</Decimal>
    <Double>0</Double>
    <Float>0</Float>
    <Guid>00000000-0000-0000-0000-000000000000</Guid>
    <Id>0</Id>
    <Int>0</Int>
    <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>
    </IntStringMap>
    <KeyValuePair xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
      <d3p1:key>String</d3p1:key>
      <d3p1:value>String</d3p1:value>
    </KeyValuePair>
    <Long>0</Long>
    <NullableDateTime>0001-01-01T00:00:00</NullableDateTime>
    <NullableId>0</NullableId>
    <NullableTimeSpan>PT0S</NullableTimeSpan>
    <OriginalName>String</OriginalName>
    <Point>
      <X>0</X>
      <Y>0</Y>
    </Point>
    <Short>0</Short>
    <String>String</String>
    <StringArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </StringArray>
    <StringList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </StringList>
    <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>
    </StringMap>
    <SubType>
      <Id>0</Id>
      <Name>String</Name>
    </SubType>
    <TimeSpan>PT0S</TimeSpan>
    <UInt>0</UInt>
    <ULong>0</ULong>
    <UShort>0</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/MyApp.ServiceModel">
  <AllCollectionTypes>
    <IntArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </IntArray>
    <IntList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </IntList>
    <NullableByteArray xmlns:d3p1="http://schemas.datacontract.org/2004/07/System">
      <d3p1:unsignedByte>0</d3p1:unsignedByte>
    </NullableByteArray>
    <NullableByteList xmlns:d3p1="http://schemas.datacontract.org/2004/07/System">
      <d3p1:unsignedByte>0</d3p1:unsignedByte>
    </NullableByteList>
    <NullableDateTimeArray xmlns:d3p1="http://schemas.datacontract.org/2004/07/System">
      <d3p1:dateTime>0001-01-01T00:00:00</d3p1:dateTime>
    </NullableDateTimeArray>
    <NullableDateTimeList xmlns:d3p1="http://schemas.datacontract.org/2004/07/System">
      <d3p1:dateTime>0001-01-01T00:00:00</d3p1:dateTime>
    </NullableDateTimeList>
    <PocoArray>
      <Poco>
        <Name>String</Name>
      </Poco>
    </PocoArray>
    <PocoList>
      <Poco>
        <Name>String</Name>
      </Poco>
    </PocoList>
    <PocoLookup xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringArrayOfPocoB8fmgb81>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>
          <Poco>
            <Name>String</Name>
          </Poco>
        </d3p1:Value>
      </d3p1:KeyValueOfstringArrayOfPocoB8fmgb81>
    </PocoLookup>
    <PocoLookupMap xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringArrayOfArrayOfKeyValueOfstringPocoB8fmgb81ty7Ep6D1>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>
          <d3p1:ArrayOfKeyValueOfstringPocoB8fmgb81>
            <d3p1:KeyValueOfstringPocoB8fmgb81>
              <d3p1:Key>String</d3p1:Key>
              <d3p1:Value>
                <Name>String</Name>
              </d3p1:Value>
            </d3p1:KeyValueOfstringPocoB8fmgb81>
          </d3p1:ArrayOfKeyValueOfstringPocoB8fmgb81>
        </d3p1:Value>
      </d3p1:KeyValueOfstringArrayOfArrayOfKeyValueOfstringPocoB8fmgb81ty7Ep6D1>
    </PocoLookupMap>
    <StringArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </StringArray>
    <StringList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </StringList>
  </AllCollectionTypes>
  <AllTypes>
    <Byte>0</Byte>
    <Char>0</Char>
    <DateTime>0001-01-01T00:00:00</DateTime>
    <DateTimeOffset xmlns:d3p1="http://schemas.datacontract.org/2004/07/System">
      <d3p1:DateTime>0001-01-01T00:00:00Z</d3p1:DateTime>
      <d3p1:OffsetMinutes>0</d3p1:OffsetMinutes>
    </DateTimeOffset>
    <Decimal>0</Decimal>
    <Double>0</Double>
    <Float>0</Float>
    <Guid>00000000-0000-0000-0000-000000000000</Guid>
    <Id>0</Id>
    <Int>0</Int>
    <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>
    </IntStringMap>
    <KeyValuePair xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
      <d3p1:key>String</d3p1:key>
      <d3p1:value>String</d3p1:value>
    </KeyValuePair>
    <Long>0</Long>
    <NullableDateTime>0001-01-01T00:00:00</NullableDateTime>
    <NullableId>0</NullableId>
    <NullableTimeSpan>PT0S</NullableTimeSpan>
    <OriginalName>String</OriginalName>
    <Point>
      <X>0</X>
      <Y>0</Y>
    </Point>
    <Short>0</Short>
    <String>String</String>
    <StringArray xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </StringArray>
    <StringList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </StringList>
    <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>
    </StringMap>
    <SubType>
      <Id>0</Id>
      <Name>String</Name>
    </SubType>
    <TimeSpan>PT0S</TimeSpan>
    <UInt>0</UInt>
    <ULong>0</ULong>
    <UShort>0</UShort>
  </AllTypes>
  <Result>String</Result>
</HelloAllTypesResponse>