Thanks for the very complete response.
What I'm trying to do is a post like this (the same that you used in
your mail)
POST /dosomething
> ...
> Content-Type: application/json
{"Type":"AddSomething","Body":"{\"Arg1\":10,\"Arg2\":20}"}
and in the server side, get a variable with that string, for example:
var something = "{"Type":"AddSomething","Body":"{\"Arg1\":10,\"Arg2\":
20}"}";
If I get that, I could use XPath or Json.NET to check the content and
do whatever I need to do.
I will try to explain it in another way. If I use the DoSomething DTO,
I will have Type and Body properties, but I wont have any other
property that the json from the post could have. Let's say that I
change the client side so I always get a Type and a Body, so I could
use the Body property to have dynamic schema, but I would have to
create a copy of the DoSomething DTO for each resource I have in the
application (because I think I can't have different
Routes.Add<DoSomething>("/dosomething") with different paths but the
same DTO). A lot of DTO classes that all would have the properties
Type and Body
> However since we have only implemented *OnPost()* above you will need to
> POST to */dosomething* in order to call the service.
>
> POST /dosomething
>
> > ...
> > Content-Type: application/json
>
> {"Type":"AddSomething","Body":"{\"Arg1\":10,\"Arg2\":20}"}
>
> Otherwise should you prefer you can call the service with a standard HTML
> Form Post like:
>
> POST /dosomething
>
> > ...
> > Content-Type: application/x-www-form-urlencoded
>
> Type=AddSomething&Body={"Arg1":10,"Arg2":20}
>
> If for whatever reason you want to disable say JSON and SOAP
> endpoints/formats completely you just need to add this in your
> AppHost.Configure():
>
> var disableFeatures = Feature.Json | Feature.Soap;
>
> > SetConfig(new EndpointHostConfig
> > {
> > EnableFeatures = Feature.All.Remove(disableFeatures),
> > });
>
> Although I don't see much reason to do this since it just disables features
> others might like to use.
>
> Since it's potentially related to what you want to do, you can actually
> delegate to different web services using the *
> base.ResolveService<TService>()* method
> as seen in the CustomerDetailsService.cs in thehttp://
www.servicestack.net/ServiceStack.Northwind/example e.g:
>
> var ordersService = base.ResolveService<OrdersService>();
>
> > var ordersResponse = (OrdersResponse)ordersService.Get(new Orders {
> > CustomerId = customer.Id });
>
> Hopefully this helps in what you're trying to do.
>
> Cheers,
>
> 2011/7/27 Nicolás Granelli <
nicolasgrane...@sitio54.com.ar>
>
> > What do I have to do to have a rest service without aumatic json
> > deserialization? For example, I would like to have a url like
> >
http://domain.com/dosomethingthat accept only POST, and in the code