Test

<back to all web services

PostObjectToChannel

The following routes are available for this service:
All Verbs/channels/{Channel}/object
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;

public class dtos
{

    public static class PostObjectToChannel
    {
        public String toUserId = null;
        public String channel = null;
        public String selector = null;
        public CustomType customType = null;
        public SetterType setterType = null;
        
        public String getToUserId() { return toUserId; }
        public PostObjectToChannel setToUserId(String value) { this.toUserId = value; return this; }
        public String getChannel() { return channel; }
        public PostObjectToChannel setChannel(String value) { this.channel = value; return this; }
        public String getSelector() { return selector; }
        public PostObjectToChannel setSelector(String value) { this.selector = value; return this; }
        public CustomType getCustomType() { return customType; }
        public PostObjectToChannel setCustomType(CustomType value) { this.customType = value; return this; }
        public SetterType getSetterType() { return setterType; }
        public PostObjectToChannel setSetterType(SetterType value) { this.setterType = value; return this; }
    }

    public static class CustomType
    {
        public Integer id = null;
        public String name = null;
        
        public Integer getId() { return id; }
        public CustomType setId(Integer value) { this.id = value; return this; }
        public String getName() { return name; }
        public CustomType setName(String value) { this.name = value; return this; }
    }

    public static class SetterType
    {
        public Integer id = null;
        public String name = null;
        
        public Integer getId() { return id; }
        public SetterType setId(Integer value) { this.id = value; return this; }
        public String getName() { return name; }
        public SetterType setName(String value) { this.name = value; return this; }
    }

}

Java PostObjectToChannel 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 /channels/{Channel}/object HTTP/1.1 
Host: test.servicestack.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<PostObjectToChannel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Test.ServiceInterface">
  <Channel>String</Channel>
  <CustomType>
    <Id>0</Id>
    <Name>String</Name>
  </CustomType>
  <Selector>String</Selector>
  <SetterType>
    <Id>0</Id>
    <Name>String</Name>
  </SetterType>
  <ToUserId>String</ToUserId>
</PostObjectToChannel>