Batched Requests not working

I downloaded the Web project from ServiceStack Start
I then went to postman and did a batched request. I did a post to https://localhost:5001/json/reply/Hello[] and passed in the following data into the body :

[
  {
    "Name" : "Andy"
  },
  {
    "Name" : "Koos"
  }
]

In the documentation for predefined routs for batched request here Pre-Defined Routes it shows the example of /json/reply/Hello

When I try and post to /json/reply to any service, I get the following error :

{
  "responseStatus": {
    "errorCode": "NotImplementedException",
    "message": "The operation does not exist for this service",
    "stackTrace": "System.NotImplementedException: The operation does not exist for this service\r\n   at ServiceStack.Host.Handlers.ServiceStackHandlerBase.AssertOperationExists(String operationName, Type type) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/Host/Handlers/ServiceStackHandlerBase.cs:line 275\r\n   at ServiceStack.Host.Handlers.GenericHandler.CreateRequestAsync(IRequest req, String operationName) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/Host/Handlers/GenericHandler.cs:line 30\r\n   at ServiceStack.Host.Handlers.GenericHandler.ProcessRequestAsync(IRequest httpReq, IResponse httpRes, String operationName) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/Host/Handlers/GenericHandler.cs:line 79\r\n",
    "errors": []
  }
}

If this is using ASP .NET Identity Auth with Endpoint Routing you’d need to use the /api pre-defined route

Using the

/api/json/reply/Hello[]

gives a 404 not found.

It’s just /api/{RequestDto} for the route, /api/{RequestDto}[] for auto batched requests.

As per Info message on the legacy routing page, you’ll instead want to refer to Endpoint Routing docs instead.

Still not working. Could it be the test project on the Servicestack website.

I downloaded this one without anything selected : Web App

Oh yeah endpoint routing only registers the primary HTTP Method, try changing it to POST with:

[Route("/hello/{Name}")]
public class Hello : IPost, IReturn<HelloResponse>
{
    public required string Name { get; set; }
}

Ok, working now for batched requests. I suggest updating the documentation, which is not clear.

For Sending to Message Queue (Testing batched and Message Queue requests

https://localhost:5001/api/json/oneway/Hello

Also does not work. I just get a 404 not found

That’s still using the legacy pre-defined routes which don’t exist in Endpoint Routing (e.g. /json/reply|oneway ). The only pre-defined routes are just /api/{RequestDto} for the route, /api/{RequestDto}[] for auto batched requests.

We’re not generating oneway routes in Endpoint Routing due to route pollution of a relatively unused feature. You’d instead need an explicit API for it that just drops the Request DTO in the registered MQ, e.g:

public object Any(QueueHello request)
{
    Request.PopulateRequestDtoIfAuthenticated(request);
    MessageProducer.Publish(request);
    return new EmptyResponse();
}