.NET 6.0 ServiceStack 6.1.1 JsonServiceClient doesn't use /json/reply

Viewed 29

I have two application one is an API and is using SS v5.10.4 the other one is a service that was using SS v5.8.0 and was upgraded to v6.1.1

The service is referencing the API's DTOs using the ServiceStackVS plugin which creates a single *.dto file. Some of the DTOs in the API have custom routes others don't. Prior to upgrading the service to SS v.6.1.1 the calls using the DTOs without custom routes were going to /json/reply/{requestDTO} and the ones with custom routes were going to /{Route}. After the upgrade all calls are now going to /{requestDTO}. Any idea why that is and is there an easy way to default the JsonServiceClient to use the /json/reply/{requestDTO} if there isn't a custom route defined in the {myAPI}.dtos file for the specific DTOs ?

1 Answers

So seems like it's working as expected if I set the baseUri in the constructor of the JsonServiceClient instead of setting the BaseUri property.

Doesn't work:

        _client = new JsonServiceClient
        {
            BaseUri = _configuration.ClientUri,
            Timeout = TimeSpan.FromMinutes(_configuration.RequestTimeOut)
        };

Works:

        _client= new JsonServiceClient(_configuration.ClientUri)
        {
            Timeout = TimeSpan.FromMinutes(_configuration.RequestTimeOut)
        };
Related