Service Models - AquaticInformatics/aquarius-sdk-net GitHub Wiki

The Aquarius.Client.dll assembly includes service model request and response DTOs for each operation listed on the public API endpoint's metadata operation page. Simply browse to the endpoint to see the current operation list.

Each endpoint has its own service model namespace and its own IServiceClient property from which to issue requests.

Base URL IAquariusClient property Namespace
/AQUARIUS/Publish/v2 client.Publish Aquarius.TimeSeries.Client.ServiceModels.Publish
/AQUARIUS/Acquisition/v2 client.Acquisition Aquarius.TimeSeries.Client.ServiceModels.Acquisition
/AQUARIUS/Provisioning/v1 client.Provisioning Aquarius.TimeSeries.Client.ServiceModels.Provisioning

Each request DTO also has a Route["/path"] attribute, which contains enough information for the underlying ServiceStack.Client library to route the HTTP request to the appropriate operation.

Make sure you send the request to the correct endpoint!

Usually, Visual Studio's Intellisense (and ReSharper's code-completion) is smart enough to automatically pull in the only the required namespaces for the DTOs used by your code.

But as your code becomes more complex and needs to integrate with multiple endpoints, you can sometimes write code that looks correct, but sends its request to the wrong endpoint, failing at runtime with a WebServiceException reporting 404 Not Found.

using Aquarius.TimeSeries.Client.ServiceModels.Provisioning;
using Aquarius.TimeSeries.Client.ServiceModels.Publish;
...
var response1 = client.Provisioning.Get(new GetParameters()); // OK
var response2 = client.Publish.Get(new ParameterListServiceRequest()); // OK
var response3 = client.Publish.Get(new GetParameters()); // Fails with 404

The above code fails because the GetParameters request DTO is part of the Provisioning namespace. Attempting to issue a GET /AQUARIUS/Publish/v2/parameters request will fail at runtime with a 404 status, since the "/parameters" route is not known to the Publish API.

Aquarius.TimeSeries.Client.ServiceModels.Legacy.*

Danger! Turn back! (These are not the DTOs you are looking for)

While the SDK was a private repository, used only by internal Aquatic Informatics products, we had a few AQTS releases which needed to introduce breaking changes to a set of request or response DTOs. Adding a new property to a DTO is not a breaking change, but deleting, renaming, or changing the datatype of a property will break API compatibility.

When a breaking change was introduced, the formerly-good-but-now-broken DTOs where moved into the "Legacy" namespace, so that our own products could adapt themselves "on the fly" to the detected version of AQTS.

The legacy DTOs are available as the separate Aquarius.SDK.Legacy NuGet package, since most integrations will not need to include them.

PM > Install-Package Aquarius.SDK.Legacy

This approach is very brittle, and not recommended for most integrations. Please contact the Aquarius Support team if your integration needs help adapting to future breaking changes (which, of course, we hope to minimize).