All Verbs | /Stuff |
---|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Test.ServiceInterface;
namespace Test.ServiceInterface
{
[DataContract(Namespace="http://schemas.servicestack.net/types")]
public partial class GetStuff
{
[DataMember]
[ApiMember(DataType="DateTime", Name="Summary Date")]
public virtual DateTime? SummaryDate { get; set; }
[DataMember]
[ApiMember(DataType="DateTime", Name="Summary End Date")]
public virtual DateTime? SummaryEndDate { get; set; }
[DataMember]
[ApiMember(DataType="string", Name="Symbol")]
public virtual string Symbol { get; set; }
[DataMember]
[ApiMember(DataType="string", Name="Email")]
public virtual string Email { get; set; }
[DataMember]
[ApiMember(DataType="bool", Name="Is Enabled")]
public virtual bool? IsEnabled { get; set; }
}
[DataContract(Namespace="http://schemas.servicestack.net/types")]
public partial class GetStuffResponse
{
[DataMember]
public virtual DateTime? SummaryDate { get; set; }
[DataMember]
public virtual DateTime? SummaryEndDate { get; set; }
[DataMember]
public virtual string Symbol { get; set; }
[DataMember]
public virtual string Email { get; set; }
[DataMember]
public virtual bool? IsEnabled { get; set; }
}
}
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 /Stuff HTTP/1.1
Host: test.servicestack.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetStuff xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<Email>String</Email>
<IsEnabled>false</IsEnabled>
<SummaryDate>0001-01-01T00:00:00</SummaryDate>
<SummaryEndDate>0001-01-01T00:00:00</SummaryEndDate>
<Symbol>String</Symbol>
</GetStuff>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetStuffResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types"> <Email>String</Email> <IsEnabled>false</IsEnabled> <SummaryDate>0001-01-01T00:00:00</SummaryDate> <SummaryEndDate>0001-01-01T00:00:00</SummaryEndDate> <Symbol>String</Symbol> </GetStuffResponse>