diff --git a/irs-api/src/main/java/org/eclipse/tractusx/irs/semanticshub/SemanticsHubClient.java b/irs-api/src/main/java/org/eclipse/tractusx/irs/semanticshub/SemanticsHubClient.java index 2265eea6e4..abf9281123 100644 --- a/irs-api/src/main/java/org/eclipse/tractusx/irs/semanticshub/SemanticsHubClient.java +++ b/irs-api/src/main/java/org/eclipse/tractusx/irs/semanticshub/SemanticsHubClient.java @@ -246,8 +246,8 @@ private Optional readFromSemanticHub(final String urn) { try { final UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString( config.getModelJsonSchemaEndpoint()); - final Map values = Map.of(PLACEHOLDER_URN, urn); - return Optional.ofNullable(restTemplate.getForObject(uriBuilder.build(values), String.class)); + uriBuilder.uriVariables(Map.of(PLACEHOLDER_URN, urn)); + return Optional.ofNullable(restTemplate.getForObject(uriBuilder.build().toUri(), String.class)); } catch (final RestClientException e) { log.error("Unable to retrieve schema from semantic hub for urn '{}'", urn, e); } diff --git a/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/central/DigitalTwinRegistryClientImpl.java b/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/central/DigitalTwinRegistryClientImpl.java index b7214e13f5..c49320adec 100644 --- a/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/central/DigitalTwinRegistryClientImpl.java +++ b/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/central/DigitalTwinRegistryClientImpl.java @@ -98,8 +98,8 @@ public AssetAdministrationShellDescriptor getAssetAdministrationShellDescriptor( public LookupShellsResponse getAllAssetAdministrationShellIdsByAssetLink( final List assetIds) { final UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString(shellLookupEndpoint); - final var values = Map.of(PLACEHOLDER_ASSET_IDS, StringMapper.mapToString(assetIds)); - return restTemplate.exchange(uriBuilder.build(values), HttpMethod.GET, null, LookupShellsResponse.class) + uriBuilder.uriVariables(Map.of(PLACEHOLDER_ASSET_IDS, StringMapper.mapToString(assetIds))); + return restTemplate.exchange(uriBuilder.build().toUri(), HttpMethod.GET, null, LookupShellsResponse.class) .getBody(); } diff --git a/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/decentral/DecentralDigitalTwinRegistryClient.java b/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/decentral/DecentralDigitalTwinRegistryClient.java index 29caca4ff3..3fdf9322af 100644 --- a/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/decentral/DecentralDigitalTwinRegistryClient.java +++ b/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/decentral/DecentralDigitalTwinRegistryClient.java @@ -80,8 +80,8 @@ public LookupShellsResponse getAllAssetAdministrationShellIdsByAssetLink( final EndpointDataReference endpointDataReference, final List assetIds) { final String shellLookupEndpoint = endpointDataReference.getEndpoint() + lookupShellsTemplate; final UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString(shellLookupEndpoint); - final var values = Map.of(PLACEHOLDER_ASSET_IDS, StringMapper.mapToString(assetIds)); - return edcRestTemplate.exchange(uriBuilder.build(values), HttpMethod.GET, + uriBuilder.uriVariables(Map.of(PLACEHOLDER_ASSET_IDS, StringMapper.mapToString(assetIds))); + return edcRestTemplate.exchange(uriBuilder.build().toUri(), HttpMethod.GET, new HttpEntity<>(null, headers(endpointDataReference)), LookupShellsResponse.class).getBody(); }