-
Notifications
You must be signed in to change notification settings - Fork 10
Service Models
The com.aquaticinformatics:aquarius.sdk package 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 SdkServiceClient property from which to issue requests.
| Base URL |
SdkAquariusClient property |
Namespace |
|---|---|---|
/AQUARIUS/Publish/v2 |
client.Publish |
com.aquaticinformatics.aquarius.sdk.timeseries.servicemodels.Publish.* |
/AQUARIUS/Acquisition/v2 |
client.Acquisition |
com.aquaticinformatics.aquarius.sdk.timeseries.servicemodels.Acquisition.* |
/AQUARIUS/Provisioning/v1 |
client.Provisioning |
com.aquaticinformatics.aquarius.sdk.timeseries.servicemodels.Provisioning.* |
Each request DTO also has a @Route(Path="/path", Verbs="GET") attribute, which contains enough information for the underlying ServiceStack.Java library to route the HTTP request to the appropriate operation.
Usually, IntelliJ'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.
import com.aquaticinformatics.aquarius.sdk.timeseries.AquariusClient;
import com.aquaticinformatics.aquarius.sdk.timeseries.servicemodels.Provisioning.*;
import com.aquaticinformatics.aquarius.sdk.timeseries.servicemodels.Publish.*;
...
var response1 = client.ProvisioningClient.Get(new GetParameters()); // OK
var response2 = client.PublishClient.Get(new ParameterListServiceRequest()); // OK
var response3 = client.PublishClient.Get(new GetParameters()); // Fails with 404The 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.
Still have questions? Feel free to raise an issue or contact our Support Team
- SDK design philosophy (on the .NET SDK wiki)
- AQTS client concepts
- AQTS code examples
- Troubleshooting tips