Minor bugfixes
diff --git a/sdks/dotnet/basyx-components/BaSyx.AAS.Client.Http/AssetAdministrationShellHttpClient.cs b/sdks/dotnet/basyx-components/BaSyx.AAS.Client.Http/AssetAdministrationShellHttpClient.cs
index 13b1946..511bf95 100644
--- a/sdks/dotnet/basyx-components/BaSyx.AAS.Client.Http/AssetAdministrationShellHttpClient.cs
+++ b/sdks/dotnet/basyx-components/BaSyx.AAS.Client.Http/AssetAdministrationShellHttpClient.cs
@@ -9,12 +9,10 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
using BaSyx.API.Clients;
-using BaSyx.API.Components;
using BaSyx.Models.Core.AssetAdministrationShell.Generics;
using BaSyx.Utils.Client.Http;
using BaSyx.Utils.ResultHandling;
using System;
-using System.Collections.Generic;
using System.Net.Http;
using BaSyx.Utils.PathHandling;
using BaSyx.Models.Core.Common;
@@ -24,57 +22,72 @@
using NLog;
using BaSyx.Models.Communication;
using BaSyx.Utils.DependencyInjection;
+using System.Collections.Generic;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations;
+using Newtonsoft.Json;
+using System.Text;
namespace BaSyx.AAS.Client.Http
{
- public class AssetAdministrationShellHttpClient : SimpleHttpClient, IAssetAdministrationShellClient, ISubmodelServiceProviderRegistry
+ public class AssetAdministrationShellHttpClient : SimpleHttpClient,
+ IAssetAdministrationShellClient,
+ IAssetAdministrationShellSubmodelClient,
+ ISubmodelRepositoryClient
{
private static readonly ILogger logger = LogManager.GetCurrentClassLogger();
+
+ public static bool USE_HTTPS = true;
private const string SEPARATOR = "/";
private const string AAS = "aas";
private const string SUBMODELS = "submodels";
private const string SUBMODEL = "submodel";
private const string SUBMODEL_ELEMENTS = "submodelElements";
- private const string PROPERTIES = "properties";
- private const string OPERATIONS = "operations";
- private const string EVENTS = "events";
private const string VALUE = "value";
- private const string ASYNC = "async";
+ private const string INVOKE = "invoke";
+ private const string SYNCHRONOUS = "?async=false";
+ private const string ASYNCHRONOUS = "?async=true";
private const string INVOCATION_LIST = "invocationList";
- private const string BINDING = "binding";
- private const string BINDINGS = "bindings";
-
- private const int REQUEST_TIMEOUT = 30000;
-
public Uri Endpoint { get; }
+ public int RequestTimeout = DEFAULT_REQUEST_TIMEOUT;
- private AssetAdministrationShellHttpClient()
+ private AssetAdministrationShellHttpClient(HttpClientHandler clientHandler) : base(clientHandler)
{
JsonSerializerSettings = new DependencyInjectionJsonSerializerSettings();
}
- public AssetAdministrationShellHttpClient(Uri endpoint) : this()
+ public AssetAdministrationShellHttpClient(Uri endpoint) : this(endpoint, DEFAULT_HTTP_CLIENT_HANDLER)
+ { }
+ public AssetAdministrationShellHttpClient(Uri endpoint, HttpClientHandler clientHandler) : this (clientHandler)
{
endpoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint));
Endpoint = endpoint;
}
+ public AssetAdministrationShellHttpClient(IAssetAdministrationShellDescriptor aasDescriptor) : this(aasDescriptor, DEFAULT_HTTP_CLIENT_HANDLER)
+ { }
- public AssetAdministrationShellHttpClient(IAssetAdministrationShellDescriptor aasDescriptor) : this()
+ public AssetAdministrationShellHttpClient(IAssetAdministrationShellDescriptor aasDescriptor, HttpClientHandler clientHandler) : this(clientHandler)
{
aasDescriptor = aasDescriptor ?? throw new ArgumentNullException(nameof(aasDescriptor));
- HttpEndpoint httpEndpoint = aasDescriptor.Endpoints?.OfType<HttpEndpoint>()?.FirstOrDefault();
+ IEnumerable<HttpEndpoint> httpEndpoints = aasDescriptor.Endpoints?.OfType<HttpEndpoint>();
+ HttpEndpoint httpEndpoint = null;
+ if (USE_HTTPS)
+ httpEndpoint = httpEndpoints?.FirstOrDefault(p => p.Type == Uri.UriSchemeHttps);
+ if (httpEndpoint == null)
+ httpEndpoint = httpEndpoints?.FirstOrDefault(p => p.Type == Uri.UriSchemeHttp);
+
if (httpEndpoint == null || string.IsNullOrEmpty(httpEndpoint.Address))
throw new Exception("There is no http endpoint for instantiating a client");
else
{
- if (!httpEndpoint.Address.EndsWith(SEPARATOR + AAS) || !httpEndpoint.Address.EndsWith(SEPARATOR + AAS + SEPARATOR))
+ if (!httpEndpoint.Address.EndsWith(SEPARATOR + AAS) && !httpEndpoint.Address.EndsWith(SEPARATOR + AAS + SEPARATOR))
Endpoint = new Uri(httpEndpoint.Address + SEPARATOR + AAS);
else
Endpoint = new Uri(httpEndpoint.Address);
}
}
+
public Uri GetUri(params string[] pathElements)
@@ -87,218 +100,113 @@
public IResult<IAssetAdministrationShellDescriptor> RetrieveAssetAdministrationShellDescriptor()
{
var request = base.CreateRequest(GetUri(), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IAssetAdministrationShellDescriptor>(response, response.Entity);
}
public IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell()
{
var request = base.CreateRequest(GetUri(), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IAssetAdministrationShell>(response, response.Entity);
}
- public IResult<ISubmodel> CreateSubmodel(ISubmodel submodel)
+ public IResult<ISubmodel> CreateOrUpdateSubmodel(ISubmodel submodel)
{
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS), HttpMethod.Put, submodel);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodel.IdShort), HttpMethod.Put, submodel);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<ISubmodel>(response, response.Entity);
}
public IResult<IElementContainer<ISubmodel>> RetrieveSubmodels()
{
var request = base.CreateRequest(GetUri(SUBMODELS), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<ElementContainer<ISubmodel>>(response, response.Entity);
}
public IResult<ISubmodel> RetrieveSubmodel(string submodelId)
{
var request = base.CreateRequest(GetUri(SUBMODELS, submodelId), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<ISubmodel>(response, response.Entity);
}
public IResult DeleteSubmodel(string submodelId)
{
var request = base.CreateRequest(GetUri(SUBMODELS, submodelId), HttpMethod.Delete);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse(response, response.Entity);
}
-
- public IResult<IOperation> CreateOperation(string submodelId, IOperation operation)
- {
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, OPERATIONS), HttpMethod.Put, operation);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<IOperation>(response, response.Entity);
- }
-
+
public IResult<IElementContainer<ISubmodelElement>> RetrieveSubmodelElements(string submodelId)
{
var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, SUBMODEL_ELEMENTS), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<ElementContainer<ISubmodelElement>>(response, response.Entity);
}
- public IResult<IElementContainer<IOperation>> RetrieveOperations(string submodelId)
+ public IResult<ISubmodelElement> RetrieveSubmodelElement(string submodelId, string seIdShortPath)
{
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, OPERATIONS), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<ElementContainer<IOperation>>(response, response.Entity);
+ var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, SUBMODEL_ELEMENTS, seIdShortPath), HttpMethod.Get);
+ var response = base.SendRequest(request, RequestTimeout);
+ return base.EvaluateResponse<ISubmodelElement>(response, response.Entity);
}
- public IResult<IOperation> RetrieveOperation(string submodelId, string operationId)
+ public IResult<ISubmodelElement> CreateOrUpdateSubmodelElement(string submodelId, string rootSeIdShortPath, ISubmodelElement submodelElement)
{
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, OPERATIONS, operationId), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<IOperation>(response, response.Entity);
+ var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, SUBMODEL_ELEMENTS, rootSeIdShortPath), HttpMethod.Put, submodelElement);
+ var response = base.SendRequest(request, RequestTimeout);
+ return base.EvaluateResponse<ISubmodelElement>(response, response.Entity);
}
- public IResult DeleteOperation(string submodelId, string operationId)
+ public IResult UpdateSubmodelElementValue(string submodelId, string seIdShortPath, IValue value)
{
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, OPERATIONS, operationId), HttpMethod.Delete);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, SUBMODEL_ELEMENTS, seIdShortPath, VALUE), HttpMethod.Put, value.Value);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse(response, response.Entity);
}
- public IResult<InvocationResponse> InvokeOperation(string submodelId, string operationId, InvocationRequest invocationRequest)
+ public IResult<IValue> RetrieveSubmodelElementValue(string submodelId, string seIdShortPath)
{
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, OPERATIONS, operationId), HttpMethod.Post, invocationRequest);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, SUBMODEL_ELEMENTS, seIdShortPath, VALUE), HttpMethod.Get);
+ var response = base.SendRequest(request, RequestTimeout);
+ IResult result = base.EvaluateResponse(response, response.Entity);
+ if (result.Success && result.Entity != null)
+ {
+ string sValue = Encoding.UTF8.GetString((byte[])result.Entity);
+ object deserializedValue = JsonConvert.DeserializeObject(sValue);
+ return new Result<IValue>(result.Success, new ElementValue(deserializedValue, deserializedValue.GetType()), result.Messages);
+ }
+ else
+ return new Result<IValue>(result);
+ }
+
+ public IResult DeleteSubmodelElement(string submodelId, string seIdShortPath)
+ {
+ var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, SUBMODEL_ELEMENTS, seIdShortPath), HttpMethod.Delete);
+ var response = base.SendRequest(request, RequestTimeout);
+ return base.EvaluateResponse(response, response.Entity);
+ }
+
+ public IResult<InvocationResponse> InvokeOperation(string submodelId, string operationIdShortPath, InvocationRequest invocationRequest)
+ {
+ var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, SUBMODEL_ELEMENTS, operationIdShortPath, INVOKE + SYNCHRONOUS), HttpMethod.Post, invocationRequest);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<InvocationResponse>(response, response.Entity);
}
-
- public IResult<IProperty> CreateProperty(string submodelId, IProperty property)
+ public IResult<CallbackResponse> InvokeOperationAsync(string submodelId, string operationIdShortPath, InvocationRequest invocationRequest)
{
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, PROPERTIES), HttpMethod.Put, property);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<IProperty>(response, response.Entity);
- }
-
- public IResult<ISubmodelElement> CreateSubmodelElement(string submodelId, ISubmodelElement submodelElement)
- {
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, SUBMODEL_ELEMENTS), HttpMethod.Put, submodelElement);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<ISubmodelElement>(response, response.Entity);
- }
-
- public IResult<IElementContainer<IProperty>> RetrieveProperties(string submodelId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, PROPERTIES), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<ElementContainer<IProperty>>(response, response.Entity);
- }
-
- public IResult<IProperty> RetrieveProperty(string submodelId, string propertyId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, PROPERTIES, propertyId), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<IProperty>(response, response.Entity);
- }
-
- public IResult<ISubmodelElement> RetrieveSubmodelElement(string submodelId, string submodelElementId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, SUBMODEL_ELEMENTS, submodelElementId), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<ISubmodelElement>(response, response.Entity);
- }
-
- public IResult UpdatePropertyValue(string submodelId, string propertyId, IValue value)
- {
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, PROPERTIES, propertyId, VALUE), HttpMethod.Put, value);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse(response, response.Entity);
- }
-
- public IResult<IValue> RetrievePropertyValue(string submodelId, string propertyId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, PROPERTIES, propertyId, VALUE), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<IValue>(response, response.Entity);
- }
-
- public IResult DeleteSubmodelElement(string submodelId, string submodelElementId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, SUBMODEL_ELEMENTS, submodelElementId), HttpMethod.Delete);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse(response, response.Entity);
- }
-
- public IResult DeleteProperty(string submodelId, string propertyId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, PROPERTIES, propertyId), HttpMethod.Delete);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse(response, response.Entity);
- }
-
- public IResult<IEvent> CreateEvent(string submodelId, IEvent eventable)
- {
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, EVENTS), HttpMethod.Put, eventable);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<IEvent>(response, response.Entity);
- }
-
- public IResult<IElementContainer<IEvent>> RetrieveEvents(string submodelId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, EVENTS), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<ElementContainer<IEvent>>(response, response.Entity);
- }
-
- public IResult<IEvent> RetrieveEvent(string submodelId, string eventId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, EVENTS, eventId), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<IEvent>(response, response.Entity);
- }
-
- public IResult DeleteEvent(string submodelId, string eventId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, EVENTS, eventId), HttpMethod.Delete);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse(response, response.Entity);
- }
-
- public IResult<ISubmodelDescriptor> RegisterSubmodelServiceProvider(string id, ISubmodelServiceProvider submodelServiceProvider)
- {
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, id, BINDING), HttpMethod.Post, submodelServiceProvider.ServiceDescriptor);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<ISubmodelDescriptor>(response, response.Entity);
- }
-
- public IResult UnregisterSubmodelServiceProvider(string id)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, id, BINDING), HttpMethod.Delete);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse(response, response.Entity);
- }
-
- public IResult<ISubmodelServiceProvider> GetSubmodelServiceProvider(string id)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, id, BINDING), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<ISubmodelServiceProvider>(response, response.Entity);
- }
-
- public IResult<IEnumerable<ISubmodelServiceProvider>> GetSubmodelServiceProviders()
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, BINDINGS), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
- return base.EvaluateResponse<IEnumerable<ISubmodelServiceProvider>>(response, response.Entity);
- }
- public IResult<CallbackResponse> InvokeOperationAsync(string submodelId, string operationId, InvocationRequest invocationRequest)
- {
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, OPERATIONS, operationId, ASYNC), HttpMethod.Post, invocationRequest);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, SUBMODEL_ELEMENTS, operationIdShortPath, INVOKE + ASYNCHRONOUS), HttpMethod.Post, invocationRequest);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<CallbackResponse>(response, response.Entity);
}
- public IResult<InvocationResponse> GetInvocationResult(string submodelId, string operationId, string requestId)
+ public IResult<InvocationResponse> GetInvocationResult(string submodelId, string operationIdShortPath, string requestId)
{
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, OPERATIONS, operationId, INVOCATION_LIST, requestId), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, SUBMODEL, SUBMODEL_ELEMENTS, operationIdShortPath, INVOCATION_LIST, requestId), HttpMethod.Get);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<InvocationResponse>(response, response.Entity);
- }
-
+ }
}
}
diff --git a/sdks/dotnet/basyx-components/BaSyx.AAS.Server.Http/AssetAdministrationShellRepositoryHttpServer.cs b/sdks/dotnet/basyx-components/BaSyx.AAS.Server.Http/AssetAdministrationShellRepositoryHttpServer.cs
index 25b972b..72e24b3 100644
--- a/sdks/dotnet/basyx-components/BaSyx.AAS.Server.Http/AssetAdministrationShellRepositoryHttpServer.cs
+++ b/sdks/dotnet/basyx-components/BaSyx.AAS.Server.Http/AssetAdministrationShellRepositoryHttpServer.cs
@@ -11,20 +11,14 @@
using BaSyx.API.Components;
using BaSyx.Components.Common;
using BaSyx.Utils.Settings.Types;
-using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
-using System;
using System.Reflection;
namespace BaSyx.AAS.Server.Http
{
public class AssetAdministrationShellRepositoryHttpServer : ServerApplication
{
- private string submodelId = string.Empty;
- private string aasId = string.Empty;
-
public AssetAdministrationShellRepositoryHttpServer() : this(null, null)
{ }
@@ -44,77 +38,6 @@
{
services.AddSingleton<IAssetAdministrationShellRepositoryServiceProvider>(repositoryServiceProvider);
});
- }
-
- protected override void ConfigureServices(IServiceCollection services)
- {
- base.ConfigureServices(services);
-
- //Check whether Asset Administration Shell Service Provider exists and bind it to the AssetAdministrationShell-Services-Controller
- services.AddTransient<IAssetAdministrationShellServiceProvider>(ctx =>
- {
- IAssetAdministrationShellServiceProvider aasServiceProvider = ctx
- .GetRequiredService<IAssetAdministrationShellRepositoryServiceProvider>()
- .GetAssetAdministrationShellServiceProvider(aasId);
-
- return aasServiceProvider;
- });
-
- //Check whether Submodel Service Provider exists and bind it to the Submodel-Services-Controller
- services.AddTransient<ISubmodelServiceProvider>(ctx =>
- {
- IAssetAdministrationShellServiceProvider aasServiceProvider = ctx
- .GetRequiredService<IAssetAdministrationShellRepositoryServiceProvider>()
- .GetAssetAdministrationShellServiceProvider(aasId);
-
- var submodelServiceProvider = aasServiceProvider.SubmodelRegistry.GetSubmodelServiceProvider(submodelId);
- if (!submodelServiceProvider.Success || submodelServiceProvider.Entity == null)
- {
- SubmodelServiceProvider cssp = new SubmodelServiceProvider();
- return cssp;
- }
- else
- return submodelServiceProvider.Entity;
- });
- }
-
- protected override void Configure(IApplicationBuilder app)
- {
- base.Configure(app);
- app.Use((context, next) =>
- {
- string[] pathElements = context.Request.Path.ToUriComponent()?.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
- if (pathElements.Length >= 2)
- {
- aasId = pathElements[1];
- if (pathElements.Length == 2)
- {
- context.Request.Path = new PathString("/shells/" + aasId);
- }
- else if (pathElements.Length == 3 && pathElements[2] == "aas")
- {
- context.Request.Path = new PathString("/aas");
- }
- else if (pathElements.Length == 4 && pathElements[3] == "submodels")
- {
- context.Request.Path = new PathString("/aas/submodels");
- }
- else if (pathElements.Length == 5)
- {
- submodelId = pathElements[4];
- context.Request.Path = new PathString("/aas/submodels/" + submodelId);
- }
- else if (pathElements.Length > 5)
- {
- submodelId = pathElements[4];
- string[] restOfPathArray = new string[pathElements.Length - 5];
- Array.Copy(pathElements, 5, restOfPathArray, 0, pathElements.Length - 5);
- string restOfPath = string.Join("/", restOfPathArray);
- context.Request.Path = new PathString("/" + restOfPath);
- }
- }
- return next();
- });
- }
+ }
}
}
diff --git a/sdks/dotnet/basyx-components/BaSyx.API.Http.Controllers.AASX/BaSyx.API.Http.Controllers.AASX.xml b/sdks/dotnet/basyx-components/BaSyx.API.Http.Controllers.AASX/BaSyx.API.Http.Controllers.AASX.xml
index e4acb5e..14c3414 100644
--- a/sdks/dotnet/basyx-components/BaSyx.API.Http.Controllers.AASX/BaSyx.API.Http.Controllers.AASX.xml
+++ b/sdks/dotnet/basyx-components/BaSyx.API.Http.Controllers.AASX/BaSyx.API.Http.Controllers.AASX.xml
@@ -9,7 +9,7 @@
The AASX Package Service
</summary>
</member>
- <member name="M:BaSyx.API.Http.Controllers.PackageService.PackageService.#ctor(BaSyx.API.Components.IAssetAdministrationShellServiceProvider,Microsoft.AspNetCore.Hosting.IHostingEnvironment)">
+ <member name="M:BaSyx.API.Http.Controllers.PackageService.PackageService.#ctor(BaSyx.API.Components.IAssetAdministrationShellServiceProvider,Microsoft.AspNetCore.Hosting.IWebHostEnvironment)">
<summary>
Constructor for the AASX-Package Services Controller
</summary>
diff --git a/sdks/dotnet/basyx-components/BaSyx.API.Http.Controllers/AssetAdministrationShell/SubmodelController.cs b/sdks/dotnet/basyx-components/BaSyx.API.Http.Controllers/AssetAdministrationShell/SubmodelController.cs
index 76fabff..547301e 100644
--- a/sdks/dotnet/basyx-components/BaSyx.API.Http.Controllers/AssetAdministrationShell/SubmodelController.cs
+++ b/sdks/dotnet/basyx-components/BaSyx.API.Http.Controllers/AssetAdministrationShell/SubmodelController.cs
@@ -142,7 +142,7 @@
seIdShortPath = HttpUtility.UrlDecode(seIdShortPath);
- var result = serviceProvider.CreateSubmodelElement(seIdShortPath, submodelElement);
+ var result = serviceProvider.CreateOrUpdateSubmodelElement(seIdShortPath, submodelElement);
return result.CreateActionResult(CrudOperation.Create, "submodel/submodelElements/" + seIdShortPath);
}
diff --git a/sdks/dotnet/basyx-components/BaSyx.Common.UI.Swagger/SwaggerExtensions.cs b/sdks/dotnet/basyx-components/BaSyx.Common.UI.Swagger/SwaggerExtensions.cs
index 6915f09..c28fb73 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Common.UI.Swagger/SwaggerExtensions.cs
+++ b/sdks/dotnet/basyx-components/BaSyx.Common.UI.Swagger/SwaggerExtensions.cs
@@ -21,7 +21,7 @@
namespace BaSyx.Common.UI.Swagger
{
- public static class OpenApiInfos
+ internal static class OpenApiInfos
{
#region Static OpenApi-Infos
internal static readonly OpenApiInfo AssetAdministrationShell_OpenApiInfo = new OpenApiInfo
@@ -98,9 +98,9 @@
All,
AssetAdministrationShell,
AssetAdministrationShellRepository,
+ AssetAdministrationShellRegistry,
Submodel,
- SubmodelRepository,
- AssetAdministrationShellRegistry
+ SubmodelRepository,
}
public static class SwaggerExtensions
{
@@ -114,12 +114,13 @@
c.SwaggerDoc("v1", info);
// Set the comments path for the Swagger JSON and UI.
- var xmlFile = $"{serverApp.ControllerAssembly.GetName().Name}.xml";
- var xmlPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), xmlFile);
+ string xmlFile = $"{serverApp.ControllerAssembly.GetName().Name}.xml";
+ string xmlPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), xmlFile);
if (EmbeddedResource.CheckOrWriteRessourceToFile(serverApp.ControllerAssembly, xmlPath))
c.IncludeXmlComments(xmlPath, true);
- c.DocumentFilter<ControllerSelector>(interfaceType);
+ if(interfaceType != Interface.All)
+ c.DocumentFilter<ControllerSelector>(interfaceType);
});
services.AddSwaggerGenNewtonsoftSupport();
});
@@ -141,10 +142,12 @@
{
private readonly Interface _interfaceType;
private readonly string _interfaceName;
+ private readonly string _controllerName;
public ControllerSelector(Interface interfaceType)
{
_interfaceType = interfaceType;
_interfaceName = Enum.GetName(typeof(Interface), _interfaceType);
+ _controllerName = _interfaceName + "Controller";
}
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
@@ -152,7 +155,7 @@
foreach (var apiDescription in context.ApiDescriptions)
{
string name = apiDescription.ActionDescriptor.DisplayName;
- if(!name.Contains(_interfaceName + "Controller"))
+ if(!name.Contains(_controllerName))
{
string route = "/" + apiDescription.ActionDescriptor.AttributeRouteInfo.Template;
swaggerDoc.Paths.Remove(route);
@@ -160,7 +163,7 @@
}
foreach (var tag in swaggerDoc.Tags.ToList())
{
- if(tag.Name != (_interfaceName + "Controller"))
+ if(tag.Name != _controllerName)
{
swaggerDoc.Tags.Remove(tag);
}
diff --git a/sdks/dotnet/basyx-components/BaSyx.Common.UI/Pages/Shared/_Layout.cshtml b/sdks/dotnet/basyx-components/BaSyx.Common.UI/Pages/Shared/_Layout.cshtml
index a1c9b3a..1be785a 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Common.UI/Pages/Shared/_Layout.cshtml
+++ b/sdks/dotnet/basyx-components/BaSyx.Common.UI/Pages/Shared/_Layout.cshtml
@@ -36,7 +36,7 @@
<div class="navbar-right">
@if (!string.IsNullOrEmpty((string)ViewData["CompanyLogo"]))
{
- <img src="@ViewData["CompanyLogo"]" width="160" height="36" />
+ <img src="@ViewData["CompanyLogo"]" width="160" />
}
</div>
</div>
diff --git a/sdks/dotnet/basyx-components/BaSyx.Common.UI/Pages/Shared/_ModelElementSpecific.cshtml b/sdks/dotnet/basyx-components/BaSyx.Common.UI/Pages/Shared/_ModelElementSpecific.cshtml
index 33e4a54..67edca4 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Common.UI/Pages/Shared/_ModelElementSpecific.cshtml
+++ b/sdks/dotnet/basyx-components/BaSyx.Common.UI/Pages/Shared/_ModelElementSpecific.cshtml
@@ -58,7 +58,15 @@
{
<li class="list-group-item">
<div class="row align-items-center">
- <object data="@path" style="height:500px; width:100%"></object>
+ @if (file.MimeType.StartsWith("image"))
+ {
+ <img src="@path" style="display:block; max-width:100%; height:auto" />
+ }
+ else
+ {
+ <object data="@path" style="min-height:500px; width:100%"></object>
+ }
+
</div>
</li>
}
diff --git a/sdks/dotnet/basyx-components/BaSyx.Components.Common/DefaultWebHostBuilder.cs b/sdks/dotnet/basyx-components/BaSyx.Components.Common/DefaultWebHostBuilder.cs
index 0e254e5..2eecd84 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Components.Common/DefaultWebHostBuilder.cs
+++ b/sdks/dotnet/basyx-components/BaSyx.Components.Common/DefaultWebHostBuilder.cs
@@ -24,7 +24,7 @@
if (settings?.ServerConfig.Hosting?.Environment != null)
webHostBuilder.UseEnvironment(settings.ServerConfig.Hosting.Environment);
else
- webHostBuilder.UseEnvironment(Environments.Production);
+ webHostBuilder.UseEnvironment(Environments.Development);
if (settings?.ServerConfig?.Hosting?.Urls?.Count > 0)
webHostBuilder.UseUrls(settings.ServerConfig.Hosting.Urls.ToArray());
diff --git a/sdks/dotnet/basyx-components/BaSyx.Components.Common/ServerApplication.cs b/sdks/dotnet/basyx-components/BaSyx.Components.Common/ServerApplication.cs
index 8e0702b..51941b3 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Components.Common/ServerApplication.cs
+++ b/sdks/dotnet/basyx-components/BaSyx.Components.Common/ServerApplication.cs
@@ -15,7 +15,6 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Rewrite;
-using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;
@@ -44,8 +43,8 @@
private string _webRoot;
private bool _secure = false;
- private List<Action<IApplicationBuilder>> AppBuilderPipeline;
- private List<Action<IServiceCollection>> ServiceBuilderPipeline;
+ private readonly List<Action<IApplicationBuilder>> AppBuilderPipeline;
+ private readonly List<Action<IServiceCollection>> ServiceBuilderPipeline;
public const string DEFAULT_CONTENT_ROOT = "Content";
public const string DEFAULT_WEB_ROOT = "wwwroot";
@@ -87,9 +86,9 @@
AppBuilderPipeline = new List<Action<IApplicationBuilder>>();
ServiceBuilderPipeline = new List<Action<IServiceCollection>>();
- WebHostBuilder.ConfigureServices(services =>
+ WebHostBuilder.ConfigureServices( (context, services) =>
{
- ConfigureServices(services);
+ ConfigureServices(context, services);
});
WebHostBuilder.Configure(app =>
@@ -276,14 +275,15 @@
});
}
- protected virtual void ConfigureServices(IServiceCollection services)
+ protected virtual void ConfigureServices(WebHostBuilderContext context, IServiceCollection services)
{
services.AddSingleton(typeof(ServerSettings), Settings);
services.AddSingleton<IServerApplicationLifetime>(this);
+
var urls = Settings.ServerConfig.Hosting.Urls;
var secureUrl = urls.Find(s => s.StartsWith("https"));
- if (!string.IsNullOrEmpty(secureUrl))
+ if (!string.IsNullOrEmpty(secureUrl) && !context.HostingEnvironment.IsDevelopment())
{
secureUrl = secureUrl.Replace("+", "0.0.0.0");
Uri secureUri = new Uri(secureUrl);
@@ -330,7 +330,7 @@
app.UseHsts();
}
- if(_secure)
+ if(_secure && !env.IsDevelopment())
app.UseHttpsRedirection();
app.UseStaticFiles();
diff --git a/sdks/dotnet/basyx-components/BaSyx.Components.Tests/AssetAdministrationShellClientServerTest.cs b/sdks/dotnet/basyx-components/BaSyx.Components.Tests/AssetAdministrationShellClientServerTest.cs
new file mode 100644
index 0000000..35a2429
--- /dev/null
+++ b/sdks/dotnet/basyx-components/BaSyx.Components.Tests/AssetAdministrationShellClientServerTest.cs
@@ -0,0 +1,188 @@
+using BaSyx.AAS.Client.Http;
+using BaSyx.AAS.Server.Http;
+using BaSyx.API.AssetAdministrationShell.Extensions;
+using BaSyx.API.Clients;
+using BaSyx.API.Components;
+using BaSyx.Models.Communication;
+using BaSyx.Models.Connectivity;
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.AssetAdministrationShell;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Extensions;
+using BaSyx.Registry.Client.Http;
+using BaSyx.Registry.ReferenceImpl.FileBased;
+using BaSyx.Registry.Server.Http;
+using BaSyx.Utils.ResultHandling;
+using BaSyx.Utils.Settings.Types;
+using FluentAssertions;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+
+namespace BaSyx.Components.Tests
+{
+ [TestClass]
+ public class AssetAdministrationShellClientServerTest : IAssetAdministrationShellClient, IAssetAdministrationShellSubmodelClient
+ {
+ private static AssetAdministrationShellHttpServer server;
+ private static AssetAdministrationShellHttpClient client;
+
+ private static IAssetAdministrationShell aas;
+ private static ISubmodel submodel;
+ private static IAssetAdministrationShellDescriptor aasDescriptor;
+
+ static AssetAdministrationShellClientServerTest()
+ {
+ ServerSettings aasServerSettings = ServerSettings.CreateSettings();
+ aasServerSettings.ServerConfig.Hosting.ContentPath = "Content";
+ aasServerSettings.ServerConfig.Hosting.Environment = "Development";
+ aasServerSettings.ServerConfig.Hosting.Urls.Add("http://localhost:5080");
+ aasServerSettings.ServerConfig.Hosting.Urls.Add("https://localhost:5443");
+
+ aas = TestAssetAdministrationShell.GetAssetAdministrationShell();
+ submodel = TestAssetAdministrationShell.GetTestSubmodel();
+ var serviceProvider = aas.CreateServiceProvider(true);
+ serviceProvider.UseAutoEndpointRegistration(aasServerSettings.ServerConfig);
+ aasDescriptor = serviceProvider.ServiceDescriptor;
+
+ server = new AssetAdministrationShellHttpServer(aasServerSettings);
+ server.SetServiceProvider(serviceProvider);
+ _ = server.RunAsync();
+
+ client = new AssetAdministrationShellHttpClient(aasDescriptor);
+ }
+
+ [TestMethod]
+ public void Test1_RetrieveAssetAdministrationShell()
+ {
+ var retrieved = RetrieveAssetAdministrationShell();
+ retrieved.Success.Should().BeTrue();
+ }
+
+ public IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell()
+ {
+ return client.RetrieveAssetAdministrationShell();
+ }
+
+ [TestMethod]
+ public void Test2_RetrieveSubmodel()
+ {
+ var retrieved = RetrieveSubmodel(submodel.IdShort);
+ retrieved.Success.Should().BeTrue();
+ }
+ public IResult<ISubmodel> RetrieveSubmodel(string submodelId)
+ {
+ return client.RetrieveSubmodel(submodelId);
+ }
+
+ [TestMethod]
+ public void Test31_CreateOrUpdateSubmodelElement_FirstLevelHierarchy()
+ {
+ Property testProperty = new Property("TestIntegerProperty", typeof(int), 8);
+ var created = CreateOrUpdateSubmodelElement(submodel.IdShort, testProperty.IdShort, testProperty);
+ created.Success.Should().BeTrue();
+ created.Entity.Should().BeEquivalentTo(testProperty, opts => opts
+ .Excluding(p => p.Get)
+ .Excluding(p => p.Set)
+ .Excluding(p => p.EmbeddedDataSpecifications)
+ .Excluding(p => p.Parent));
+
+ submodel.SubmodelElements.Add(testProperty);
+ }
+ public IResult<ISubmodelElement> CreateOrUpdateSubmodelElement(string submodelId, string rootSeIdShortPath, ISubmodelElement submodelElement)
+ {
+ return client.CreateOrUpdateSubmodelElement(submodelId, rootSeIdShortPath, submodelElement);
+ }
+
+ [TestMethod]
+ public void Test41_RetrieveSubmodelElements()
+ {
+ var retrieved = RetrieveSubmodelElements(submodel.IdShort);
+ retrieved.Success.Should().BeTrue();
+ retrieved.Entity.Count.Should().Be(submodel.SubmodelElements.Count);
+ }
+ public IResult<IElementContainer<ISubmodelElement>> RetrieveSubmodelElements(string submodelId)
+ {
+ return client.RetrieveSubmodelElements(submodelId);
+ }
+
+ [TestMethod]
+ public void Test51_RetrieveSubmodelElement_FirstLevelHierarchy()
+ {
+ var retrieved = RetrieveSubmodelElement(submodel.IdShort, "TestIntegerProperty");
+ retrieved.Success.Should().BeTrue();
+ retrieved.Entity.Should().BeEquivalentTo(submodel.SubmodelElements["TestIntegerProperty"].Cast<Property>(), opts => opts
+ .Excluding(p => p.Get)
+ .Excluding(p => p.Set)
+ .Excluding(p => p.EmbeddedDataSpecifications)
+ .Excluding(p => p.Parent));
+ }
+ public IResult<ISubmodelElement> RetrieveSubmodelElement(string submodelId, string seIdShortPath)
+ {
+ return client.RetrieveSubmodelElement(submodelId, seIdShortPath);
+ }
+
+ [TestMethod]
+ public void Test61_RetrieveSubmodelElementValue_FirstLevelHierarchy()
+ {
+ var retrieved = RetrieveSubmodelElementValue(submodel.IdShort, "TestIntegerProperty");
+ retrieved.Success.Should().BeTrue();
+ retrieved.Entity.Value.Should().BeEquivalentTo(8);
+ }
+ public IResult<IValue> RetrieveSubmodelElementValue(string submodelId, string seIdShortPath)
+ {
+ return client.RetrieveSubmodelElementValue(submodelId, seIdShortPath);
+ }
+
+ [TestMethod]
+ public void Test71_UpdateSubmodelElementValue_FirstLevelHierarchy()
+ {
+ var updated = UpdateSubmodelElementValue(submodel.IdShort, "TestIntegerProperty", new ElementValue(5, typeof(int)));
+ updated.Success.Should().BeTrue();
+ }
+ [TestMethod]
+ public void Test72_RetrieveSubmodelElementValue_FirstLevelHierarchy_AfterUpdate()
+ {
+ var retrieved = RetrieveSubmodelElementValue(submodel.IdShort, "TestIntegerProperty");
+ retrieved.Success.Should().BeTrue();
+ retrieved.Entity.Value.Should().BeEquivalentTo(5);
+ }
+
+ public IResult UpdateSubmodelElementValue(string submodelId, string seIdShortPath, IValue value)
+ {
+ return client.UpdateSubmodelElementValue(submodelId, seIdShortPath, value);
+ }
+
+ [TestMethod]
+ public void Test81_DeleteSubmodelElement_FirstLevelHierarchy()
+ {
+ var deleted = DeleteSubmodelElement(submodel.IdShort, "TestIntegerProperty");
+ deleted.Success.Should().BeTrue();
+ }
+
+ public IResult DeleteSubmodelElement(string submodelId, string seIdShortPath)
+ {
+ return client.DeleteSubmodelElement(submodelId, seIdShortPath);
+ }
+
+ public IResult<InvocationResponse> InvokeOperation(string submodelId, string operationIdShortPath, InvocationRequest invocationRequest)
+ {
+ return client.InvokeOperation(submodelId, operationIdShortPath, invocationRequest);
+ }
+
+ public IResult<CallbackResponse> InvokeOperationAsync(string submodelId, string operationIdShortPath, InvocationRequest invocationRequest)
+ {
+ return client.InvokeOperationAsync(submodelId, operationIdShortPath, invocationRequest);
+ }
+
+ public IResult<InvocationResponse> GetInvocationResult(string submodelId, string operationIdShortPath, string requestId)
+ {
+ return client.GetInvocationResult(submodelId, operationIdShortPath, requestId);
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-components/BaSyx.Components.Tests/BaSyx.Components.Tests.csproj b/sdks/dotnet/basyx-components/BaSyx.Components.Tests/BaSyx.Components.Tests.csproj
index 3778999..b81cfe2 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Components.Tests/BaSyx.Components.Tests.csproj
+++ b/sdks/dotnet/basyx-components/BaSyx.Components.Tests/BaSyx.Components.Tests.csproj
@@ -30,6 +30,8 @@
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\BaSyx.AAS.Client.Http\BaSyx.AAS.Client.Http.csproj" />
+ <ProjectReference Include="..\BaSyx.AAS.Server.Http\BaSyx.AAS.Server.Http.csproj" />
<ProjectReference Include="..\BaSyx.Registry.Client.Http\BaSyx.Registry.Client.Http.csproj" />
<ProjectReference Include="..\BaSyx.Registry.ReferenceImpl.FileBased\BaSyx.Registry.ReferenceImpl.FileBased.csproj" />
<ProjectReference Include="..\BaSyx.Registry.Server.Http\BaSyx.Registry.Server.Http.csproj" />
diff --git a/sdks/dotnet/basyx-components/BaSyx.Components.Tests/RegistryTest.cs b/sdks/dotnet/basyx-components/BaSyx.Components.Tests/RegistryTest.cs
index f9ce150..424beef 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Components.Tests/RegistryTest.cs
+++ b/sdks/dotnet/basyx-components/BaSyx.Components.Tests/RegistryTest.cs
@@ -11,6 +11,8 @@
using BaSyx.Registry.ReferenceImpl.FileBased;
using BaSyx.Registry.Server.Http;
using BaSyx.Utils.ResultHandling;
+using BaSyx.Utils.Settings.Sections;
+using BaSyx.Utils.Settings.Types;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
@@ -27,7 +29,19 @@
static RegistryTest()
{
- registryHttpServer = new RegistryHttpServer();
+ ServerSettings registrySettings = ServerSettings.CreateSettings();
+ registrySettings.ServerConfig.Hosting = new HostingConfiguration()
+ {
+ Urls = new List<string>()
+ {
+ "http://localhost:4999",
+ "https://localhost:4499"
+ },
+ Environment = "Development",
+ ContentPath = "Content"
+ };
+
+ registryHttpServer = new RegistryHttpServer(registrySettings);
registryHttpServer.SetRegistryProvider(new FileBasedRegistry());
_ = registryHttpServer.RunAsync();
diff --git a/sdks/dotnet/basyx-components/BaSyx.Components.Tests/TestAssetAdministrationShell.cs b/sdks/dotnet/basyx-components/BaSyx.Components.Tests/TestAssetAdministrationShell.cs
new file mode 100644
index 0000000..7e9c517
--- /dev/null
+++ b/sdks/dotnet/basyx-components/BaSyx.Components.Tests/TestAssetAdministrationShell.cs
@@ -0,0 +1,195 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Distribution License 1.0 which is available at
+* https://www.eclipse.org/org/documents/edl-v10.html
+*
+*
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Extensions;
+using BaSyx.Utils.ResultHandling;
+using System;
+using System.Threading.Tasks;
+
+namespace BaSyx.Components.Tests
+{
+ public static class TestAssetAdministrationShell
+ {
+ public static AssetAdministrationShell GetAssetAdministrationShell()
+ {
+ AssetAdministrationShell aas = new AssetAdministrationShell("TestAAS", new Identifier("http://basys40.de/shells/SimpleAAS/" + Guid.NewGuid().ToString(), KeyType.IRI))
+ {
+ Description = new LangStringSet()
+ {
+ new LangString("de-DE", "Einfache VWS"),
+ new LangString("en-US", "Simple AAS")
+ },
+ Administration = new AdministrativeInformation()
+ {
+ Version = "1.0",
+ Revision = "120"
+ },
+ Asset = new Asset("TestAsset", new Identifier("http://basys40.de/assets/SimpleAsset/" + Guid.NewGuid().ToString(), KeyType.IRI))
+ {
+ Kind = AssetKind.Instance,
+ Description = new LangStringSet()
+ {
+ new LangString("de-DE", "Einfaches Asset"),
+ new LangString("en-US", "Simple Asset")
+ }
+ }
+ };
+
+ Submodel testSubmodel = GetTestSubmodel();
+
+ aas.Submodels.Add(testSubmodel);
+
+ return aas;
+ }
+
+ public static Submodel GetTestSubmodel()
+ {
+ string propertyValue = "TestFromInside";
+ int i = 0;
+ double y = 2.0;
+
+ Submodel testSubmodel = new Submodel("TestSubmodel", new Identifier(Guid.NewGuid().ToString(), KeyType.Custom))
+ {
+ SubmodelElements =
+ {
+ new Property<string>("TestProperty1")
+ {
+ Set = (prop, val) => propertyValue = val,
+ Get = prop => { return propertyValue + "_" + i++; }
+ },
+ new Property<string>("TestProperty2")
+ {
+ Set = (prop, val) => propertyValue = val,
+ Get = prop => { return propertyValue + "_" + i++; }
+ },
+ new Property<int>("TestProperty3")
+ {
+ Set = (prop, val) => i = val,
+ Get = prop => { return i++; }
+ },
+ new Property<double>("TestProperty4")
+ {
+ Set = (prop, val) => y = val,
+ Get = prop => { return Math.Pow(y, i); }
+ },
+ new SubmodelElementCollection("TestSubmodelElementCollection")
+ {
+ Value =
+ {
+ new Property<string>("TestSubProperty1")
+ {
+ Set = (prop, val) => propertyValue = val,
+ Get = prop => { return propertyValue + "_" + i--; }
+ },
+ new Property<string>("TestSubProperty2")
+ {
+ Set = (prop, val) => propertyValue = val,
+ Get = prop => { return propertyValue + "_" + i--; }
+ },
+ new Property<int>("TestSubProperty3")
+ {
+ Set = (prop, val) => i = val,
+ Get = prop => { return i--; }
+ },
+ new Property<double>("TestSubProperty4")
+ {
+ Set = (prop, val) => y = val,
+ Get = prop => { return Math.Pow(y, i); }
+ }
+ }
+ },
+ new Operation("GetTime")
+ {
+ OutputVariables = new OperationVariableSet()
+ {
+ new Property<string>("Date"),
+ new Property<string>("Time"),
+ new Property<string>("Ticks")
+ },
+ OnMethodCalled = (op, inArgs, inOutArgs, outArgs, cancellationToken) =>
+ {
+ outArgs.Add(new Property<string>("Date") { Value = "Heute ist der " + DateTime.Now.Date.ToString() });
+ outArgs.Add(new Property<string>("Time") { Value = "Es ist " + DateTime.Now.TimeOfDay.ToString() + " Uhr" });
+ outArgs.Add(new Property<string>("Ticks") { Value = "Ticks: " + DateTime.Now.Ticks.ToString() });
+ return new OperationResult(true);
+ }
+ },
+ new Operation("Calculate")
+ {
+ Description = new LangStringSet()
+ {
+ new LangString("DE", "Taschenrechner mit simulierter langer Rechenzeit zum Testen von asynchronen Aufrufen"),
+ new LangString("EN", "Calculator with simulated long-running computing time for testing asynchronous calls")
+ },
+ InputVariables = new OperationVariableSet()
+ {
+ new Property<string>("Expression")
+ {
+ Description = new LangStringSet()
+ {
+ new LangString("DE", "Ein mathematischer Ausdruck (z.B. 5*9)"),
+ new LangString("EN", "A mathematical expression (e.g. 5*9)")
+ }
+ },
+ new Property<int>("ComputingTime")
+ {
+ Description = new LangStringSet()
+ {
+ new LangString("DE", "Die Bearbeitungszeit in Millisekunden"),
+ new LangString("EN", "The computation time in milliseconds")
+ }
+ }
+ },
+ OutputVariables = new OperationVariableSet()
+ {
+ new Property<double>("Result")
+ },
+ OnMethodCalled = async (op, inArgs, inOutArgs, outArgs, cancellationToken) =>
+ {
+ string expression = inArgs["Expression"]?.GetValue<string>();
+ int? computingTime = inArgs["ComputingTime"]?.GetValue<int>();
+
+ inOutArgs["HierRein"]?.SetValue("DaWiederRaus");
+
+ if(computingTime.HasValue)
+ await Task.Delay(computingTime.Value, cancellationToken);
+
+ if(cancellationToken.IsCancellationRequested)
+ return new OperationResult(false, new Message(MessageType.Information, "Cancellation was requested"));
+
+ double value = CalulcateExpression(expression);
+
+ outArgs.Add(new Property<double>("Result", value));
+ return new OperationResult(true);
+ }
+ }
+
+ }
+ };
+ return testSubmodel;
+ }
+
+ public static double CalulcateExpression(string expression)
+ {
+ string columnName = "Evaluation";
+ System.Data.DataTable dataTable = new System.Data.DataTable();
+ System.Data.DataColumn dataColumn = new System.Data.DataColumn(columnName, typeof(double), expression);
+ dataTable.Columns.Add(dataColumn);
+ dataTable.Rows.Add(0);
+ return (double)(dataTable.Rows[0][columnName]);
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-components/BaSyx.Discovery.mDNS/BaSyx.Discovery.mDNS.csproj b/sdks/dotnet/basyx-components/BaSyx.Discovery.mDNS/BaSyx.Discovery.mDNS.csproj
index 2e0eaf4..5d87197 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Discovery.mDNS/BaSyx.Discovery.mDNS.csproj
+++ b/sdks/dotnet/basyx-components/BaSyx.Discovery.mDNS/BaSyx.Discovery.mDNS.csproj
@@ -16,7 +16,6 @@
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="BaSyx.AAS.Client.Http" Version="1.0.0" />
<PackageReference Include="BaSyx.API" Version="1.0.0" />
<PackageReference Include="Makaretu.Dns" Version="2.0.1" />
<PackageReference Include="Makaretu.Dns.Multicast" Version="0.27.0" />
@@ -30,6 +29,10 @@
</None>
</ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\BaSyx.AAS.Client.Http\BaSyx.AAS.Client.Http.csproj" />
+ </ItemGroup>
+
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="IF EXIST %25BASYX_REPO%25 ( dotnet pack "$(ProjectPath)" --no-build --include-source --include-symbols --output "%25BASYX_REPO%25" ) ELSE ( ECHO BASYX_REPO Environment Variable not found)" />
</Target>
diff --git a/sdks/dotnet/basyx-components/BaSyx.Discovery.mDNS/DiscoveryExtensions.cs b/sdks/dotnet/basyx-components/BaSyx.Discovery.mDNS/DiscoveryExtensions.cs
index 06d1ebb..a5c0aa9 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Discovery.mDNS/DiscoveryExtensions.cs
+++ b/sdks/dotnet/basyx-components/BaSyx.Discovery.mDNS/DiscoveryExtensions.cs
@@ -19,6 +19,8 @@
using System.Linq;
using System.Net;
using BaSyx.Utils.Logging;
+using System.Net.Http;
+using BaSyx.Utils.Client.Http;
namespace BaSyx.Discovery.mDNS
{
@@ -108,8 +110,10 @@
private static void AssemblyDescriptor(ref IAssetAdministrationShellDescriptor aasDescriptor, Uri aasEndpoint)
{
- AssetAdministrationShellHttpClient client = new AssetAdministrationShellHttpClient(aasEndpoint);
- IResult<IAssetAdministrationShellDescriptor> retrieveDescriptor = client.RetrieveAssetAdministrationShellDescriptor();
+ IResult<IAssetAdministrationShellDescriptor> retrieveDescriptor;
+ using (var client = new AssetAdministrationShellHttpClient(aasEndpoint, SimpleHttpClient.DEFAULT_HTTP_CLIENT_HANDLER))
+ retrieveDescriptor = client.RetrieveAssetAdministrationShellDescriptor();
+
if (retrieveDescriptor.Success && retrieveDescriptor.Entity != null)
{
retrieveDescriptor.LogResult(logger, LogLevel.Info, "Successfully retrieved AAS descriptor");
diff --git a/sdks/dotnet/basyx-components/BaSyx.Registry.Client.Http/RegistryHttpClient.cs b/sdks/dotnet/basyx-components/BaSyx.Registry.Client.Http/RegistryHttpClient.cs
index 050c4be..61f5097 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Registry.Client.Http/RegistryHttpClient.cs
+++ b/sdks/dotnet/basyx-components/BaSyx.Registry.Client.Http/RegistryHttpClient.cs
@@ -36,9 +36,9 @@
private int RepeatRegistrationInterval = -1;
private string baseUrl = null;
- private int Timeout = -1;
- private CancellationTokenSource RepeatRegistrationCancellationToken = null;
+ private CancellationTokenSource RepeatRegistrationCancellationToken = null;
+ public int RequestTimeout = DEFAULT_REQUEST_TIMEOUT;
public void LoadSettings(RegistryClientSettings settings)
{
@@ -48,25 +48,30 @@
RepeatRegistrationInterval = settings.RegistryConfig.RepeatRegistration.Value;
if (settings.ClientConfig.RequestConfig.RequestTimeout.HasValue)
- Timeout = settings.ClientConfig.RequestConfig.RequestTimeout.Value;
+ RequestTimeout = settings.ClientConfig.RequestConfig.RequestTimeout.Value;
else
- Timeout = DEFAULT_REQUEST_TIMEOUT;
+ RequestTimeout = DEFAULT_REQUEST_TIMEOUT;
baseUrl = settings.RegistryConfig.RegistryUrl.TrimEnd('/') + PATH_SEPERATOR + REGISTRY_BASE_PATH;
}
- public RegistryHttpClient() : this(null)
- { }
-
- public RegistryHttpClient(RegistryClientSettings registryClientSettings)
+ private RegistryHttpClient(HttpClientHandler clientHandler, RegistryClientSettings registryClientSettings) : base(clientHandler)
{
+ JsonSerializerSettings = new DependencyInjectionJsonSerializerSettings();
+
Settings = registryClientSettings ?? RegistryClientSettings.LoadSettings();
Settings = Settings ?? throw new NullReferenceException("Settings is null");
LoadSettings(Settings);
- JsonSerializerSettings = new DependencyInjectionJsonSerializerSettings();
}
+ public RegistryHttpClient() : this (DEFAULT_HTTP_CLIENT_HANDLER, null)
+ { }
+ public RegistryHttpClient(RegistryClientSettings registryClientSettings) : this(DEFAULT_HTTP_CLIENT_HANDLER, registryClientSettings)
+ { }
+ public RegistryHttpClient(RegistryClientSettings registryClientSettings, HttpClientHandler clientHandler) : this(clientHandler, registryClientSettings)
+ { }
+
public Uri GetUri(params string[] pathElements)
{
string path = baseUrl;
@@ -107,7 +112,7 @@
return new Result<IAssetAdministrationShellDescriptor>(new ArgumentNullException(nameof(aasDescriptor)));
var request = base.CreateJsonContentRequest(GetUri(aasId), HttpMethod.Put, aasDescriptor);
- var response = base.SendRequest(request, Timeout);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IAssetAdministrationShellDescriptor>(response, response.Entity);
}
@@ -117,7 +122,7 @@
return new Result<IAssetAdministrationShellDescriptor>(new ArgumentNullException(nameof(aasId)));
var request = base.CreateRequest(GetUri(aasId), HttpMethod.Get);
- var response = base.SendRequest(request, Timeout);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IAssetAdministrationShellDescriptor>(response, response.Entity);
}
@@ -127,7 +132,7 @@
return new Result<IQueryableElementContainer<IAssetAdministrationShellDescriptor>>(new ArgumentNullException(nameof(predicate)));
var request = base.CreateRequest(GetUri(), HttpMethod.Get);
- var response = base.SendRequest(request, Timeout);
+ var response = base.SendRequest(request, RequestTimeout);
var result = base.EvaluateResponse<IEnumerable<IAssetAdministrationShellDescriptor>>(response, response.Entity);
if (!result.Success || result.Entity == null)
@@ -142,7 +147,7 @@
public IResult<IQueryableElementContainer<IAssetAdministrationShellDescriptor>> RetrieveAllAssetAdministrationShellRegistrations()
{
var request = base.CreateRequest(GetUri(), HttpMethod.Get);
- var response = base.SendRequest(request, Timeout);
+ var response = base.SendRequest(request, RequestTimeout);
var result = base.EvaluateResponse<IEnumerable<IAssetAdministrationShellDescriptor>>(response, response.Entity);
return new Result<IQueryableElementContainer<IAssetAdministrationShellDescriptor>>(result.Success, result.Entity?.AsQueryableElementContainer(), result.Messages);
}
@@ -156,7 +161,7 @@
RepeatRegistrationCancellationToken?.Cancel();
var request = base.CreateRequest(GetUri(aasId), HttpMethod.Delete);
- var response = base.SendRequest(request, Timeout);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse(response, response.Entity);
}
@@ -170,7 +175,7 @@
return new Result<ISubmodelDescriptor>(new ArgumentNullException(nameof(submodelDescriptor)));
var request = base.CreateJsonContentRequest(GetUri(aasId, SUBMODEL_PATH, submodelId), HttpMethod.Put, submodelDescriptor);
- var response = base.SendRequest(request, Timeout);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<ISubmodelDescriptor>(response, response.Entity);
}
@@ -182,7 +187,7 @@
return new Result<IQueryableElementContainer<ISubmodelDescriptor>>(new ArgumentNullException(nameof(predicate)));
var request = base.CreateRequest(GetUri(aasId, SUBMODEL_PATH), HttpMethod.Get);
- var response = base.SendRequest(request, Timeout);
+ var response = base.SendRequest(request, RequestTimeout);
var result = base.EvaluateResponse<IEnumerable<ISubmodelDescriptor>>(response, response.Entity);
if (!result.Success || result.Entity == null)
@@ -200,7 +205,7 @@
return new Result<IQueryableElementContainer<ISubmodelDescriptor>>(new ArgumentNullException(nameof(aasId)));
var request = base.CreateRequest(GetUri(aasId, SUBMODEL_PATH), HttpMethod.Get);
- var response = base.SendRequest(request, Timeout);
+ var response = base.SendRequest(request, RequestTimeout);
var result = base.EvaluateResponse<IEnumerable<ISubmodelDescriptor>>(response, response.Entity);
return new Result<IQueryableElementContainer<ISubmodelDescriptor>>(result.Success, result.Entity?.AsQueryableElementContainer(), result.Messages);
@@ -214,7 +219,7 @@
return new Result<ISubmodelDescriptor>(new ArgumentNullException(nameof(submodelId)));
var request = base.CreateRequest(GetUri(aasId, SUBMODEL_PATH, submodelId), HttpMethod.Get);
- var response = base.SendRequest(request, Timeout);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<ISubmodelDescriptor>(response, response.Entity);
}
@@ -226,7 +231,7 @@
return new Result(new ArgumentNullException(nameof(submodelId)));
var request = base.CreateRequest(GetUri(aasId, SUBMODEL_PATH, submodelId), HttpMethod.Delete);
- var response = base.SendRequest(request, Timeout);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse(response, response.Entity);
}
}
diff --git a/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http.Component/BaSyx.Registry.Server.Http.Component.csproj b/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http.Component/BaSyx.Registry.Server.Http.Component.csproj
index a72643d..1592552 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http.Component/BaSyx.Registry.Server.Http.Component.csproj
+++ b/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http.Component/BaSyx.Registry.Server.Http.Component.csproj
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
- <OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Configurations>Debug;Release</Configurations>
<Authors>Constantin Ziesche</Authors>
diff --git a/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http.Component/DependencySettings.xml b/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http.Component/DependencySettings.xml
new file mode 100644
index 0000000..972139d
--- /dev/null
+++ b/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http.Component/DependencySettings.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<DependencySettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <DependencyCollection>
+ <Dependencies>
+ <Dependency>
+ <DllPath>BaSyx.Registry.ReferenceImpl.FileBased.dll</DllPath>
+ <InterfaceType>BaSyx.API.Platform.IAssetAdministrationShellRegistry</InterfaceType>
+ <ImplementationType>BaSyx.Registry.ReferenceImpl.FileBased.FileBasedRegistry</ImplementationType>
+ <ServiceLifetime>Singleton</ServiceLifetime>
+ </Dependency>
+ </Dependencies>
+ </DependencyCollection>
+ <Miscellaneous/>
+</DependencySettings>
diff --git a/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http.Component/FileBasedRegistrySettings.xml b/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http.Component/FileBasedRegistrySettings.xml
new file mode 100644
index 0000000..ded4bda
--- /dev/null
+++ b/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http.Component/FileBasedRegistrySettings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FileBasedRegistrySettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <Miscellaneous>
+ <FolderPath>RegistryDatabase</FolderPath>
+ </Miscellaneous>
+</FileBasedRegistrySettings>
diff --git a/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http/ServerSettings.xml b/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http/ServerSettings.xml
index 2327275..a7ef657 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http/ServerSettings.xml
+++ b/sdks/dotnet/basyx-components/BaSyx.Registry.Server.Http/ServerSettings.xml
@@ -6,8 +6,12 @@
<ContentPath>Content</ContentPath>
<Urls>
<Url>http://+:4999</Url>
+ <Url>https://+:4499</Url>
</Urls>
</Hosting>
<DefaultRoute/>
</ServerConfig>
+ <Miscellaneous>
+ <CompanyLogo>/images/Bosch.gif</CompanyLogo>
+ </Miscellaneous>
</ServerSettings>
diff --git a/sdks/dotnet/basyx-components/BaSyx.Submodel.Client.Http/SubmodelHttpClient.cs b/sdks/dotnet/basyx-components/BaSyx.Submodel.Client.Http/SubmodelHttpClient.cs
index 533407f..150d2fd 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Submodel.Client.Http/SubmodelHttpClient.cs
+++ b/sdks/dotnet/basyx-components/BaSyx.Submodel.Client.Http/SubmodelHttpClient.cs
@@ -21,11 +21,17 @@
using BaSyx.Models.Connectivity;
using System.Linq;
using BaSyx.Utils.DependencyInjection;
+using NLog;
+using System.Collections.Generic;
namespace BaSyx.Submodel.Client.Http
{
public class SubmodelHttpClient : SimpleHttpClient, ISubmodelClient
{
+ private static readonly ILogger logger = LogManager.GetCurrentClassLogger();
+
+ public static bool USE_HTTPS = true;
+
private const string SEPARATOR = "/";
private const string SUBMODEL = "submodel";
private const string PROPERTIES = "properties";
@@ -36,35 +42,43 @@
private const string ASYNC = "async";
private const string INVOCATION_LIST = "invocationList";
- private const int REQUEST_TIMEOUT = 30000;
-
public Uri Endpoint { get; }
+ public int RequestTimeout = DEFAULT_REQUEST_TIMEOUT;
- private SubmodelHttpClient()
+ private SubmodelHttpClient(HttpClientHandler clientHandler) : base(clientHandler)
{
JsonSerializerSettings = new DependencyInjectionJsonSerializerSettings();
}
- public SubmodelHttpClient(Uri endpoint) : this()
+ public SubmodelHttpClient(Uri endpoint) : this(endpoint, DEFAULT_HTTP_CLIENT_HANDLER)
+ { }
+ public SubmodelHttpClient(Uri endpoint, HttpClientHandler clientHandler) : this(clientHandler)
{
endpoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint));
Endpoint = endpoint;
}
+ public SubmodelHttpClient(ISubmodelDescriptor submodelDescriptor) : this(submodelDescriptor, DEFAULT_HTTP_CLIENT_HANDLER)
+ { }
- public SubmodelHttpClient(ISubmodelDescriptor submodelDescriptor) : this()
+ public SubmodelHttpClient(ISubmodelDescriptor submodelDescriptor, HttpClientHandler clientHandler) : this(clientHandler)
{
submodelDescriptor = submodelDescriptor ?? throw new ArgumentNullException(nameof(submodelDescriptor));
- HttpEndpoint httpEndpoint = submodelDescriptor.Endpoints?.OfType<HttpEndpoint>()?.FirstOrDefault();
+ IEnumerable<HttpEndpoint> httpEndpoints = submodelDescriptor.Endpoints?.OfType<HttpEndpoint>();
+ HttpEndpoint httpEndpoint = null;
+ if (USE_HTTPS)
+ httpEndpoint = httpEndpoints?.FirstOrDefault(p => p.Type == Uri.UriSchemeHttps);
+ if (httpEndpoint == null)
+ httpEndpoint = httpEndpoints?.FirstOrDefault(p => p.Type == Uri.UriSchemeHttp);
+
if (httpEndpoint == null || string.IsNullOrEmpty(httpEndpoint.Address))
throw new Exception("There is no http endpoint for instantiating a client");
else
{
- if(!httpEndpoint.Address.EndsWith(SEPARATOR + SUBMODEL) || !httpEndpoint.Address.EndsWith(SEPARATOR + SUBMODEL + SEPARATOR))
+ if (!httpEndpoint.Address.EndsWith(SEPARATOR + SUBMODEL) && !httpEndpoint.Address.EndsWith(SEPARATOR + SUBMODEL + SEPARATOR))
Endpoint = new Uri(httpEndpoint.Address + SEPARATOR + SUBMODEL);
else
Endpoint = new Uri(httpEndpoint.Address);
}
-
}
public Uri GetUri(params string[] pathElements)
@@ -77,175 +91,175 @@
public IResult<ISubmodel> RetrieveSubmodel()
{
var request = base.CreateRequest(GetUri(), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<ISubmodel>(response, response.Entity);
}
public IResult<IProperty> CreateProperty(IProperty property)
{
var request = base.CreateJsonContentRequest(GetUri(PROPERTIES), HttpMethod.Put, property);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IProperty>(response, response.Entity);
}
public IResult<IEvent> CreateEvent(IEvent eventable)
{
var request = base.CreateJsonContentRequest(GetUri(EVENTS), HttpMethod.Put, eventable);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IEvent>(response, response.Entity);
}
public IResult<IOperation> CreateOperation(IOperation operation)
{
var request = base.CreateJsonContentRequest(GetUri(OPERATIONS), HttpMethod.Put, operation);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IOperation>(response, response.Entity);
}
public IResult DeleteProperty(string propertyId)
{
var request = base.CreateRequest(GetUri(PROPERTIES, propertyId), HttpMethod.Delete);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse(response, response.Entity);
}
public IResult DeleteEvent(string eventId)
{
var request = base.CreateRequest(GetUri(EVENTS, eventId), HttpMethod.Delete);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse(response, response.Entity);
}
public IResult DeleteOperation(string operationId)
{
var request = base.CreateRequest(GetUri(OPERATIONS, operationId), HttpMethod.Delete);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse(response, response.Entity);
}
public IResult<InvocationResponse> InvokeOperation(string operationId, InvocationRequest invocationRequest)
{
var request = base.CreateJsonContentRequest(GetUri(OPERATIONS, operationId), HttpMethod.Post, invocationRequest);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<InvocationResponse>(response, response.Entity);
}
public IResult<IProperty> RetrieveProperty(string propertyId)
{
var request = base.CreateRequest(GetUri(PROPERTIES, propertyId), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IProperty>(response, response.Entity);
}
public IResult<IElementContainer<IProperty>> RetrieveProperties()
{
var request = base.CreateRequest(GetUri(PROPERTIES), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<ElementContainer<IProperty>>(response, response.Entity);
}
public IResult<IValue> RetrievePropertyValue(string propertyId)
{
var request = base.CreateRequest(GetUri(PROPERTIES, propertyId, VALUE), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IValue>(response, response.Entity);
}
public IResult<IEvent> RetrieveEvent(string eventId)
{
var request = base.CreateRequest(GetUri(EVENTS, eventId), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IEvent>(response, response.Entity);
}
public IResult<IElementContainer<IEvent>> RetrieveEvents()
{
var request = base.CreateRequest(GetUri(EVENTS), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IElementContainer<IEvent>>(response, response.Entity);
}
public IResult<IOperation> RetrieveOperation(string operationId)
{
var request = base.CreateRequest(GetUri(OPERATIONS, operationId), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IOperation>(response, response.Entity);
}
public IResult<IElementContainer<IOperation>> RetrieveOperations()
{
var request = base.CreateRequest(GetUri(OPERATIONS), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<ElementContainer<IOperation>>(response, response.Entity);
}
public IResult UpdatePropertyValue(string propertyId, IValue value)
{
var request = base.CreateJsonContentRequest(GetUri(PROPERTIES, propertyId, VALUE), HttpMethod.Put, value);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse(response, response.Entity);
}
- public IResult<ISubmodelElement> CreateSubmodelElement(string rootSubmodelElementIdShort, ISubmodelElement submodelElement)
+ public IResult<ISubmodelElement> CreateOrUpdateSubmodelElement(string rootSubmodelElementIdShort, ISubmodelElement submodelElement)
{
var request = base.CreateJsonContentRequest(GetUri(SUBMODELELEMENTS), HttpMethod.Put, submodelElement);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<ISubmodelElement>(response, response.Entity);
}
public IResult<IElementContainer<ISubmodelElement>> RetrieveSubmodelElements()
{
var request = base.CreateRequest(GetUri(SUBMODELELEMENTS), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IElementContainer<ISubmodelElement>>(response, response.Entity);
}
public IResult<ISubmodelElement> RetrieveSubmodelElement(string submodelElementId)
{
var request = base.CreateRequest(GetUri(SUBMODELELEMENTS, submodelElementId), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<ISubmodelElement>(response, response.Entity);
}
public IResult<IValue> RetrieveSubmodelElementValue(string submodelElementId)
{
var request = base.CreateRequest(GetUri(SUBMODELELEMENTS, submodelElementId, VALUE), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<IValue>(response, response.Entity);
}
public IResult UpdateSubmodelElement(string submodelElementId, ISubmodelElement submodelElement)
{
var request = base.CreateJsonContentRequest(GetUri(SUBMODELELEMENTS, submodelElementId), HttpMethod.Put, submodelElement);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse(response, response.Entity);
}
public IResult DeleteSubmodelElement(string submodelElementId)
{
var request = base.CreateRequest(GetUri(SUBMODELELEMENTS, submodelElementId), HttpMethod.Delete);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse(response, response.Entity);
}
public IResult<CallbackResponse> InvokeOperationAsync(string operationId, InvocationRequest invocationRequest)
{
var request = base.CreateJsonContentRequest(GetUri(OPERATIONS, operationId, ASYNC), HttpMethod.Post, invocationRequest);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<CallbackResponse>(response, response.Entity);
}
public IResult<InvocationResponse> GetInvocationResult(string operationId, string requestId)
{
var request = base.CreateRequest(GetUri(OPERATIONS, operationId, INVOCATION_LIST, requestId), HttpMethod.Get);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse<InvocationResponse>(response, response.Entity);
}
public IResult UpdateSubmodelElementValue(string submodelElementId, IValue value)
{
var request = base.CreateJsonContentRequest(GetUri(SUBMODELELEMENTS, submodelElementId, VALUE), HttpMethod.Put, value);
- var response = base.SendRequest(request, REQUEST_TIMEOUT);
+ var response = base.SendRequest(request, RequestTimeout);
return base.EvaluateResponse(response, response.Entity);
}
}
diff --git a/sdks/dotnet/basyx-components/BaSyx.Submodel.Server.Http/SubmodelRepositoryHttpServer.cs b/sdks/dotnet/basyx-components/BaSyx.Submodel.Server.Http/SubmodelRepositoryHttpServer.cs
index 5d8cd69..7043fc7 100644
--- a/sdks/dotnet/basyx-components/BaSyx.Submodel.Server.Http/SubmodelRepositoryHttpServer.cs
+++ b/sdks/dotnet/basyx-components/BaSyx.Submodel.Server.Http/SubmodelRepositoryHttpServer.cs
@@ -19,8 +19,6 @@
{
public class SubmodelRepositoryHttpServer : ServerApplication
{
- private string submodelId = string.Empty;
-
public SubmodelRepositoryHttpServer() : this(null, null)
{ }
@@ -40,21 +38,6 @@
{
services.AddSingleton<ISubmodelRepositoryServiceProvider>(submodelRepositoryServiceProvider);
});
- }
-
- protected override void ConfigureServices(IServiceCollection services)
- {
- base.ConfigureServices(services);
-
- //Check whether Submodel Service Provider exists and bind it to the Submodel-Services-Controller
- services.AddTransient<ISubmodelServiceProvider>(ctx =>
- {
- ISubmodelServiceProvider submodelServiceProvider = ctx
- .GetRequiredService<ISubmodelRepositoryServiceProvider>()
- .GetSubmodelServiceProvider(submodelId);
-
- return submodelServiceProvider;
- });
- }
+ }
}
}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Clients/IAssetAdministrationShellClient.cs b/sdks/dotnet/basyx-core/BaSyx.API/Clients/IAssetAdministrationShellClient.cs
index 943d7fe..14be1ab 100644
--- a/sdks/dotnet/basyx-core/BaSyx.API/Clients/IAssetAdministrationShellClient.cs
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Clients/IAssetAdministrationShellClient.cs
@@ -9,7 +9,6 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
using BaSyx.Models.Core.AssetAdministrationShell.Generics;
-using BaSyx.Models.Core.Common;
using BaSyx.Utils.ResultHandling;
namespace BaSyx.API.Clients
@@ -17,17 +16,5 @@
public interface IAssetAdministrationShellClient
{
IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell();
-
- #region Submodel - CRUD-Operations
-
- IResult<ISubmodel> CreateSubmodel(ISubmodel submodel);
-
- IResult<IElementContainer<ISubmodel>> RetrieveSubmodels();
-
- IResult<ISubmodel> RetrieveSubmodel(string submodelId);
-
- IResult DeleteSubmodel(string submodelId);
-
- #endregion
}
}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Clients/IAssetAdministrationShellSubmodelClient.cs b/sdks/dotnet/basyx-core/BaSyx.API/Clients/IAssetAdministrationShellSubmodelClient.cs
new file mode 100644
index 0000000..13072e2
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Clients/IAssetAdministrationShellSubmodelClient.cs
@@ -0,0 +1,58 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Utils.ResultHandling;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Communication;
+
+namespace BaSyx.API.Clients
+{
+ public interface IAssetAdministrationShellSubmodelClient
+ {
+ IResult<ISubmodel> RetrieveSubmodel(string submodelId);
+
+ IResult<ISubmodelElement> CreateOrUpdateSubmodelElement(string submodelId, string rootSeIdShortPath, ISubmodelElement submodelElement);
+
+ IResult<IElementContainer<ISubmodelElement>> RetrieveSubmodelElements(string submodelId);
+
+ IResult<ISubmodelElement> RetrieveSubmodelElement(string submodelId, string seIdShortPath);
+
+ IResult<IValue> RetrieveSubmodelElementValue(string submodelId, string seIdShortPath);
+
+ IResult UpdateSubmodelElementValue(string submodelId, string seIdShortPath, IValue value);
+
+ IResult DeleteSubmodelElement(string submodelId, string seIdShortPath);
+
+ /// <summary>
+ /// Invokes a specific Operation synchronously
+ /// </summary>
+ /// <param name="operationIdShortPath">IdShort-Path to the Operation</param>
+ /// <param name="invocationRequest">Request-Parameters for the invocation</param>
+ /// <returns></returns>
+ IResult<InvocationResponse> InvokeOperation(string submodelId, string operationIdShortPath, InvocationRequest invocationRequest);
+
+ /// <summary>
+ /// Invokes a specific Operation asynchronously
+ /// </summary>
+ /// <param name="operationIdShortPath">IdShort-Path to the Operation</param>
+ /// <param name="invocationRequest">Request-Parameters for the invocation</param>
+ /// <returns></returns>
+ IResult<CallbackResponse> InvokeOperationAsync(string submodelId, string operationIdShortPath, InvocationRequest invocationRequest);
+
+ /// <summary>
+ /// Returns the Invocation Result of specific Operation
+ /// </summary>
+ /// <param name="operationIdShortPath">IdShort-Path to the Operation</param>
+ /// <param name="requestId">Request-Id</param>
+ /// <returns></returns>
+ IResult<InvocationResponse> GetInvocationResult(string submodelId, string operationIdShortPath, string requestId);
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelClient.cs b/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelClient.cs
index 1a57f48..78f7014 100644
--- a/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelClient.cs
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelClient.cs
@@ -19,42 +19,40 @@
{
IResult<ISubmodel> RetrieveSubmodel();
- IResult<ISubmodelElement> CreateSubmodelElement(string rootSubmodelElementPath, ISubmodelElement submodelElement);
+ IResult<ISubmodelElement> CreateOrUpdateSubmodelElement(string rootSeIdShortPath, ISubmodelElement submodelElement);
IResult<IElementContainer<ISubmodelElement>> RetrieveSubmodelElements();
- IResult<ISubmodelElement> RetrieveSubmodelElement(string pathToSubmodelElement);
+ IResult<ISubmodelElement> RetrieveSubmodelElement(string seIdShortPath);
- IResult<IValue> RetrieveSubmodelElementValue(string pathToSubmodelElement);
+ IResult<IValue> RetrieveSubmodelElementValue(string seIdShortPath);
- IResult UpdateSubmodelElementValue(string pathToSubmodelElement, IValue value);
+ IResult UpdateSubmodelElementValue(string seIdShortPath, IValue value);
- IResult UpdateSubmodelElement(string pathToSubmodelElement, ISubmodelElement submodelElement);
-
- IResult DeleteSubmodelElement(string pathToSubmodelElement);
+ IResult DeleteSubmodelElement(string seIdShortPath);
/// <summary>
/// Invokes a specific Operation synchronously
/// </summary>
- /// <param name="pathToOperation">IdShort-Path to the Operation</param>
+ /// <param name="operationIdShortPath">IdShort-Path to the Operation</param>
/// <param name="invocationRequest">Request-Parameters for the invocation</param>
/// <returns></returns>
- IResult<InvocationResponse> InvokeOperation(string pathToOperation, InvocationRequest invocationRequest);
+ IResult<InvocationResponse> InvokeOperation(string operationIdShortPath, InvocationRequest invocationRequest);
/// <summary>
/// Invokes a specific Operation asynchronously
/// </summary>
- /// <param name="pathToOperation">IdShort-Path to the Operation</param>
+ /// <param name="operationIdShortPath">IdShort-Path to the Operation</param>
/// <param name="invocationRequest">Request-Parameters for the invocation</param>
/// <returns></returns>
- IResult<CallbackResponse> InvokeOperationAsync(string pathToOperation, InvocationRequest invocationRequest);
+ IResult<CallbackResponse> InvokeOperationAsync(string operationIdShortPath, InvocationRequest invocationRequest);
/// <summary>
/// Returns the Invocation Result of specific Operation
/// </summary>
- /// <param name="pathToOperation">IdShort-Path to the Operation</param>
+ /// <param name="operationIdShortPath">IdShort-Path to the Operation</param>
/// <param name="requestId">Request-Id</param>
/// <returns></returns>
- IResult<InvocationResponse> GetInvocationResult(string pathToOperation, string requestId);
+ IResult<InvocationResponse> GetInvocationResult(string operationIdShortPath, string requestId);
}
}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelRepositoryClient.cs b/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelRepositoryClient.cs
new file mode 100644
index 0000000..fb258d0
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelRepositoryClient.cs
@@ -0,0 +1,27 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.Common;
+using BaSyx.Utils.ResultHandling;
+
+namespace BaSyx.API.Clients
+{
+ public interface ISubmodelRepositoryClient
+ {
+ IResult<ISubmodel> CreateOrUpdateSubmodel(ISubmodel submodel);
+
+ IResult<IElementContainer<ISubmodel>> RetrieveSubmodels();
+
+ IResult<ISubmodel> RetrieveSubmodel(string submodelId);
+
+ IResult DeleteSubmodel(string submodelId);
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/DistributedSubmodelServiceProvider.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/DistributedSubmodelServiceProvider.cs
index 93975da..bd7b492 100644
--- a/sdks/dotnet/basyx-core/BaSyx.API/Components/DistributedSubmodelServiceProvider.cs
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/DistributedSubmodelServiceProvider.cs
@@ -26,7 +26,7 @@
public ISubmodelDescriptor ServiceDescriptor { get; }
- private ISubmodelClient submodelClient;
+ private readonly ISubmodelClient submodelClient;
public DistributedSubmodelServiceProvider(ISubmodelClientFactory submodelClientFactory, ISubmodelDescriptor serviceDescriptor)
{
@@ -117,9 +117,9 @@
throw new NotImplementedException();
}
- public IResult<ISubmodelElement> CreateSubmodelElement(string rootSubmodelElementPath, ISubmodelElement submodelElement)
+ public IResult<ISubmodelElement> CreateOrUpdateSubmodelElement(string rootSubmodelElementPath, ISubmodelElement submodelElement)
{
- return submodelClient.CreateSubmodelElement(rootSubmodelElementPath, submodelElement);
+ return submodelClient.CreateOrUpdateSubmodelElement(rootSubmodelElementPath, submodelElement);
}
public IResult<IElementContainer<ISubmodelElement>> RetrieveSubmodelElements()
@@ -137,11 +137,6 @@
return submodelClient.RetrieveSubmodelElementValue(submodelElementId);
}
- public IResult UpdateSubmodelElement(string submodelElementId, ISubmodelElement submodelElement)
- {
- return submodelClient.UpdateSubmodelElement(submodelElementId, submodelElement);
- }
-
public IResult DeleteSubmodelElement(string submodelElementId)
{
return submodelClient.DeleteSubmodelElement(submodelElementId);
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/SubmodelServiceProvider.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/SubmodelServiceProvider.cs
index 3ea1ef9..20d5cce 100644
--- a/sdks/dotnet/basyx-core/BaSyx.API/Components/SubmodelServiceProvider.cs
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/SubmodelServiceProvider.cs
@@ -200,7 +200,13 @@
else
submodelElementHandler[pathToElement] = elementHandler;
}
-
+
+ public void UnregisterSubmodelElementHandler(string pathToElement)
+ {
+ if (submodelElementHandler.ContainsKey(pathToElement))
+ submodelElementHandler.Remove(pathToElement);
+ }
+
public void RegisterMethodCalledHandler(string pathToOperation, MethodCalledHandler handler)
{
if (!methodCalledHandler.ContainsKey(pathToOperation))
@@ -208,7 +214,7 @@
else
methodCalledHandler[pathToOperation] = handler;
}
-
+
public void RegisterEventDelegate(string pathToEvent, EventDelegate eventDelegate)
{
if (!eventDelegates.ContainsKey(pathToEvent))
@@ -407,12 +413,15 @@
return new Result<ISubmodel>(_submodel != null, _submodel);
}
- public IResult<ISubmodelElement> CreateSubmodelElement(string pathToSubmodelElement, ISubmodelElement submodelElement)
+ public IResult<ISubmodelElement> CreateOrUpdateSubmodelElement(string pathToSubmodelElement, ISubmodelElement submodelElement)
{
if (_submodel == null)
return new Result<ISubmodelElement>(false, new NotFoundMessage("Submodel"));
- return _submodel.SubmodelElements.Create(submodelElement);
+ var created = _submodel.SubmodelElements.CreateOrUpdate(pathToSubmodelElement, submodelElement);
+ if(created.Success && created.Entity != null)
+ RegisterSubmodelElementHandler(pathToSubmodelElement, new SubmodelElementHandler(submodelElement.Get, submodelElement.Set));
+ return created;
}
public IResult<IElementContainer<ISubmodelElement>> RetrieveSubmodelElements()
@@ -447,22 +456,11 @@
return new Result<IValue>(true, elementHandler.GetValueHandler.Invoke(submodelElement.Entity));
else
return new Result<IValue>(false, new Message(MessageType.Error, "SubmodelElement not found"));
- }
+ }
else
return new Result<IValue>(false, new Message(MessageType.Error, "SubmodelElementHandler not found"));
}
- public IResult UpdateSubmodelElement(string submodelElementId, ISubmodelElement submodelElement)
- {
- if (_submodel == null)
- return new Result(false, new NotFoundMessage("Submodel"));
-
- if (_submodel.SubmodelElements == null)
- return new Result(false, new NotFoundMessage(submodelElementId));
-
- return _submodel.SubmodelElements.Update(submodelElementId, submodelElement);
- }
-
public IResult UpdateSubmodelElementValue(string submodelElementId, IValue value)
{
if (_submodel == null)
@@ -491,7 +489,10 @@
if (_submodel.SubmodelElements == null)
return new Result(false, new NotFoundMessage(submodelElementId));
- return _submodel.SubmodelElements.Delete(submodelElementId);
+ var deleted = _submodel.SubmodelElements.Delete(submodelElementId);
+ if (deleted.Success)
+ UnregisterSubmodelElementHandler(submodelElementId);
+ return deleted;
}
}
}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/HttpEndpoint.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/HttpEndpoint.cs
index 63b4e86..d471775 100644
--- a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/HttpEndpoint.cs
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/HttpEndpoint.cs
@@ -21,7 +21,7 @@
[IgnoreDataMember]
public Uri Url { get; }
- public string Type => EndpointType.HTTP;
+ public string Type { get; }
public IEndpointSecurity Security { get; set;}
@@ -30,6 +30,7 @@
{
address = address ?? throw new ArgumentNullException(nameof(address));
Url = new Uri(address);
+ Type = Url.Scheme;
Address = Url.ToString();
}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/SubmodelElementCollection.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/SubmodelElementCollection.cs
index 99c42bb..f5d93d9 100644
--- a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/SubmodelElementCollection.cs
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/SubmodelElementCollection.cs
@@ -107,7 +107,7 @@
Value.AddRange(elements);
}
- IResult<T> ICrudContainer<string, ISubmodelElement>.Create<T>(T element)
+ public IResult<ISubmodelElement> Create(ISubmodelElement element)
{
return Value.Create(element);
}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/ElementContainer.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/ElementContainer.cs
index 74bbdf9..2429e24 100644
--- a/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/ElementContainer.cs
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/ElementContainer.cs
@@ -378,15 +378,24 @@
return new Result<TElement>(new ArgumentNullException(nameof(idShortPath)));
if (element == null)
return new Result<TElement>(new ArgumentNullException(nameof(element)));
-
+
var child = GetChild(idShortPath);
if (child != null)
{
child.Value = element;
return new Result<TElement>(true, element);
}
+ else if (idShortPath.Contains(PATH_SEPERATOR))
+ {
+ string parentPath = idShortPath.Substring(0, idShortPath.LastIndexOf('/'));
+ var parent = GetChild(parentPath);
+ if (parent != null)
+ return parent.Create(element);
+ else
+ return new Result<TElement>(false, new NotFoundMessage($"Parent element {parentPath} not found"));
+ }
else
- return Create(element);
+ return this.Create(element);
}
@@ -415,6 +424,7 @@
if (child != null)
{
child.ParentContainer.Remove(child.IdShort);
+ return new Result(true);
}
return new Result(false, new NotFoundMessage());
}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/ElementPath.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/ElementPath.cs
new file mode 100644
index 0000000..7ed2789
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/ElementPath.cs
@@ -0,0 +1,111 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace BaSyx.Models.Core.Common
+{
+ public class ElementPath : IEquatable<ElementPath>, IEnumerable<string>
+ {
+ public string Path { get; }
+ public List<string> PathComponents => Path?.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries)?.ToList();
+
+ public ElementPath Parent
+ {
+ get
+ {
+ if (PathComponents?.Count > 0)
+ {
+ ElementPath parentPath = new ElementPath("/");
+ foreach (var pathComponent in PathComponents)
+ {
+ parentPath.Add(new ElementPath(pathComponent));
+ }
+ return parentPath;
+ }
+ else
+ return this;
+ }
+ }
+
+ public ElementPath(string path)
+ {
+ Path = path ?? throw new ArgumentNullException(nameof(path));
+
+ if (Path[0] != '/')
+ Path = "/" + Path;
+ }
+
+ public ElementPath Add(ElementPath otherPath)
+ {
+ return new ElementPath(Path + otherPath.Path);
+ }
+
+ public bool Equals(ElementPath otherPath)
+ {
+ return string.Equals(Path, otherPath.Path, StringComparison.OrdinalIgnoreCase);
+ }
+
+ public bool Equals(ElementPath otherPath, StringComparison stringComparison)
+ {
+ return string.Equals(Path, otherPath.Path, stringComparison);
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (ReferenceEquals(null, obj))
+ return false;
+ return obj is ElementPath && Equals((ElementPath)obj, StringComparison.OrdinalIgnoreCase);
+ }
+
+ public override int GetHashCode()
+ {
+ return (Path != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(Path) : 0);
+ }
+
+ public static bool operator ==(ElementPath left, ElementPath right)
+ {
+ return left.Equals(right, StringComparison.OrdinalIgnoreCase);
+ }
+
+ public static bool operator !=(ElementPath left, ElementPath right)
+ {
+ return !left.Equals(right, StringComparison.OrdinalIgnoreCase);
+ }
+
+ public static ElementPath operator +(ElementPath left, ElementPath right)
+ {
+ return left.Add(right);
+ }
+
+ public static implicit operator string(ElementPath path)
+ {
+ return path.Path;
+ }
+
+ public static implicit operator ElementPath(string path)
+ {
+ return new ElementPath(path);
+ }
+
+ public IEnumerator<string> GetEnumerator()
+ {
+ return PathComponents.GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return PathComponents.GetEnumerator();
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/ElementTree.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/ElementTree.cs
index 68ed40f..82363cc 100644
--- a/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/ElementTree.cs
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/ElementTree.cs
@@ -1,4 +1,14 @@
-using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
using BaSyx.Utils.ModelHandling;
namespace BaSyx.Models.Core.Common
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/IElementContainer.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/IElementContainer.cs
index acf4b3d..556aa7d 100644
--- a/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/IElementContainer.cs
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/Common/IElementContainer.cs
@@ -19,8 +19,6 @@
{
public interface ICrudContainer<TIdentifier, TElement> : ICollection<TElement> where TElement : IReferable, IModelElement
{
- IResult<T> Create<T>(T element) where T : class, TElement;
-
IResult<TElement> Retrieve(TIdentifier id);
IResult<T> Retrieve<T>(TIdentifier id) where T : class, TElement;
@@ -31,10 +29,11 @@
IResult<TElement> CreateOrUpdate(TIdentifier id, TElement element);
+ IResult<TElement> Create(TElement element);
+
IResult<TElement> Update(TIdentifier id, TElement element);
IResult Delete(TIdentifier id);
-
}
[JsonConverter(typeof(ElementContainerConverter))]
diff --git a/sdks/dotnet/basyx-core/BaSyx.Utils/Client/Http/SimpleHttpClient.cs b/sdks/dotnet/basyx-core/BaSyx.Utils/Client/Http/SimpleHttpClient.cs
index 0752cf3..196b666 100644
--- a/sdks/dotnet/basyx-core/BaSyx.Utils/Client/Http/SimpleHttpClient.cs
+++ b/sdks/dotnet/basyx-core/BaSyx.Utils/Client/Http/SimpleHttpClient.cs
@@ -16,23 +16,47 @@
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
+using System.Net.Security;
+using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace BaSyx.Utils.Client.Http
{
- public abstract class SimpleHttpClient
+ public abstract class SimpleHttpClient : IDisposable
{
public HttpClient HttpClient { get; }
public HttpClientHandler HttpClientHandler { get; }
public JsonSerializerSettings JsonSerializerSettings { get; protected set; }
- public const int DEFAULT_REQUEST_TIMEOUT = 20000;
+ public const int DEFAULT_REQUEST_TIMEOUT = 30000;
- protected SimpleHttpClient()
+ public static HttpClientHandler DEFAULT_HTTP_CLIENT_HANDLER
{
- HttpClientHandler = new HttpClientHandler() { MaxConnectionsPerServer = 100, UseProxy = false };
- HttpClient = new HttpClient(HttpClientHandler);
+ get
+ {
+ return new HttpClientHandler()
+ {
+ MaxConnectionsPerServer = 100,
+ AllowAutoRedirect = true,
+ UseProxy = false,
+ ServerCertificateCustomValidationCallback = Validate
+ };
+ }
+ }
+
+ private static bool Validate(HttpRequestMessage message, X509Certificate2 cert, X509Chain chain, SslPolicyErrors policyErrors)
+ {
+ return true;
+ }
+
+ protected SimpleHttpClient(HttpClientHandler clientHandler)
+ {
+ if (clientHandler == null)
+ clientHandler = DEFAULT_HTTP_CLIENT_HANDLER;
+
+ HttpClientHandler = clientHandler;
+ HttpClient = new HttpClient(HttpClientHandler, true);
JsonSerializerSettings = new DefaultJsonSerializerSettings();
}
@@ -130,19 +154,23 @@
protected virtual IResult EvaluateResponse(IResult result, HttpResponseMessage response)
{
- var messageList = new List<IMessage>();
+ List<IMessage> messageList = new List<IMessage>();
messageList.AddRange(result.Messages);
if (response != null)
{
- var responseString = response.Content.ReadAsStringAsync().Result;
+ byte[] responseByteArray = response.Content.ReadAsByteArrayAsync().Result;
if (response.IsSuccessStatusCode)
{
messageList.Add(new Message(MessageType.Information, response.ReasonPhrase, ((int)response.StatusCode).ToString()));
- return new Result(true, messageList);
+ return new Result(true, responseByteArray, typeof(byte[]), messageList);
}
else
{
+ string responseString = string.Empty;
+ if(responseByteArray?.Length > 0)
+ responseString = Encoding.UTF8.GetString(responseByteArray);
+
messageList.Add(new Message(MessageType.Error, response.ReasonPhrase + " | " + responseString, ((int)response.StatusCode).ToString()));
return new Result(false, messageList);
}
@@ -153,12 +181,12 @@
protected virtual IResult<T> EvaluateResponse<T>(IResult result, HttpResponseMessage response)
{
- var messageList = new List<IMessage>();
+ List<IMessage> messageList = new List<IMessage>();
messageList.AddRange(result.Messages);
if (response != null)
{
- var responseString = response.Content.ReadAsStringAsync().Result;
+ string responseString = response.Content.ReadAsStringAsync().Result;
if (response.IsSuccessStatusCode)
{
try
@@ -183,5 +211,28 @@
messageList.Add(new Message(MessageType.Error, "Evaluation of response failed - Response from host is null", null));
return new Result<T>(false, messageList);
}
+
+ #region IDisposable Support
+ private bool disposedValue = false;
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!disposedValue)
+ {
+ if (disposing)
+ {
+ HttpClient.Dispose();
+ }
+ disposedValue = true;
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ }
+ #endregion
+
+
}
}
diff --git a/sdks/dotnet/basyx-examples/SimpleAssetAdministrationShell/Program.cs b/sdks/dotnet/basyx-examples/SimpleAssetAdministrationShell/Program.cs
index 8a4603b..b53acfa 100644
--- a/sdks/dotnet/basyx-examples/SimpleAssetAdministrationShell/Program.cs
+++ b/sdks/dotnet/basyx-examples/SimpleAssetAdministrationShell/Program.cs
@@ -33,8 +33,8 @@
ServerSettings submodelServerSettings = ServerSettings.CreateSettings();
submodelServerSettings.ServerConfig.Hosting.ContentPath = "Content";
submodelServerSettings.ServerConfig.Hosting.Environment = "Development";
- submodelServerSettings.ServerConfig.Hosting.Urls.Add("http://localhost:5040");
- submodelServerSettings.ServerConfig.Hosting.Urls.Add("https://localhost:5440");
+ submodelServerSettings.ServerConfig.Hosting.Urls.Add("http://+:5040");
+ submodelServerSettings.ServerConfig.Hosting.Urls.Add("https://+:5440");
SubmodelHttpServer submodelServer = new SubmodelHttpServer(submodelServerSettings);
ISubmodelServiceProvider submodelServiceProvider = testSubmodel.CreateServiceProvider();
@@ -47,8 +47,8 @@
ServerSettings aasServerSettings = ServerSettings.CreateSettings();
aasServerSettings.ServerConfig.Hosting.ContentPath = "Content";
aasServerSettings.ServerConfig.Hosting.Environment = "Development";
- aasServerSettings.ServerConfig.Hosting.Urls.Add("http://localhost:5080");
- aasServerSettings.ServerConfig.Hosting.Urls.Add("https://localhost:5443");
+ aasServerSettings.ServerConfig.Hosting.Urls.Add("http://+:5080");
+ aasServerSettings.ServerConfig.Hosting.Urls.Add("https://+:5443");
IAssetAdministrationShellServiceProvider serviceProvider = aas.CreateServiceProvider(true);
serviceProvider.SubmodelRegistry.RegisterSubmodelServiceProvider(testSubmodel.IdShort, submodelServiceProvider);
diff --git a/sdks/dotnet/basyx-openapi/BaSyx.Submodel.OpenApi.json b/sdks/dotnet/basyx-openapi/BaSyx.Submodel.OpenApi.json
index 28707dd..1b7a5ef 100644
--- a/sdks/dotnet/basyx-openapi/BaSyx.Submodel.OpenApi.json
+++ b/sdks/dotnet/basyx-openapi/BaSyx.Submodel.OpenApi.json
@@ -2,7 +2,7 @@
"openapi": "3.0.1",
"info": {
"title": "BaSyx Submodel HTTP REST-API",
- "description": "The full OpenAPI 3.0.1 specification of the BaSyx Submodel HTTP REST-API",
+ "description": "The full description of the generic BaSyx Submodel HTTP REST-API",
"contact": {
"name": "Constantin Ziesche",
"url": "https://www.bosch.com/de/",
@@ -15,10 +15,65 @@
"version": "v1"
},
"paths": {
+ "/submodel": {
+ "get": {
+ "tags": [
+ "Submodel"
+ ],
+ "summary": "Retrieves the entire Submodel",
+ "operationId": "GetSubmodel",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Submodel"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Submodel not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Result"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/submodel/values": {
+ "get": {
+ "tags": [
+ "Submodel"
+ ],
+ "summary": "Retrieves the minimized version of a Submodel, i.e. only the values of SubmodelElements are serialized and returned",
+ "operationId": "GetSubmodelValues",
+ "responses": {
+ "404": {
+ "description": "Submodel not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Result"
+ }
+ }
+ }
+ },
+ "200": {
+ "description": "Success"
+ }
+ }
+ }
+ },
"/submodel/table": {
"get": {
"tags": [
- "SubmodelServices"
+ "Submodel"
],
"summary": "Retrieves a customizable table version of a Submodel",
"operationId": "GetSubmodelAsTable",
@@ -38,20 +93,10 @@
"404": {
"description": "Submodel not found",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
}
}
},
@@ -61,95 +106,10 @@
}
}
},
- "/submodel/values": {
- "get": {
- "tags": [
- "SubmodelServices"
- ],
- "summary": "Retrieves the minimized version of a Submodel, i.e. only the values of SubmodelElements are serialized and returned",
- "operationId": "GetSubmodelValues",
- "responses": {
- "404": {
- "description": "Submodel not found",
- "content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- }
- }
- },
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/submodel": {
- "get": {
- "tags": [
- "SubmodelServices"
- ],
- "summary": "Retrieves the entire Submodel",
- "operationId": "GetSubmodel",
- "responses": {
- "200": {
- "description": "Success",
- "content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Submodel"
- }
- },
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Submodel"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Submodel"
- }
- }
- }
- },
- "404": {
- "description": "Submodel not found",
- "content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- }
- }
- }
- }
- }
- },
"/submodel/submodelElements": {
"get": {
"tags": [
- "SubmodelServices"
+ "Submodel"
],
"summary": "Retrieves all Submodel-Elements from the Submodel",
"operationId": "GetSubmodelElements",
@@ -157,14 +117,6 @@
"200": {
"description": "Returns a list of found Submodel-Elements",
"content": {
- "text/plain": {
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/SubmodelElement"
- }
- }
- },
"application/json": {
"schema": {
"type": "array",
@@ -172,67 +124,49 @@
"$ref": "#/components/schemas/SubmodelElement"
}
}
- },
- "text/json": {
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/SubmodelElement"
- }
- }
}
}
},
"404": {
"description": "Submodel not found",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
}
}
}
}
- },
+ }
+ },
+ "/submodel/submodelElements/{seIdShortPath}": {
"put": {
"tags": [
- "SubmodelServices"
+ "Submodel"
],
- "summary": "Adds a new Submodel-Element to the Submodel",
+ "summary": "Creates or updates a Submodel-Element at the Submodel",
"operationId": "PutSubmodelElement",
+ "parameters": [
+ {
+ "name": "seIdShortPath",
+ "in": "path",
+ "description": "The Submodel-Element's IdShort-Path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "The Submodel-Element's IdShort-Path",
+ "nullable": true
+ }
+ }
+ ],
"requestBody": {
"description": "The Submodel-Element object",
"content": {
- "application/json-patch+json": {
- "schema": {
- "$ref": "#/components/schemas/ISubmodelElement"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/ISubmodelElement"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/ISubmodelElement"
- }
- },
- "application/*+json": {
- "schema": {
- "$ref": "#/components/schemas/ISubmodelElement"
- }
}
}
},
@@ -240,82 +174,50 @@
"201": {
"description": "Submodel-Element created successfully",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/SubmodelElement"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/SubmodelElement"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/SubmodelElement"
- }
}
}
},
"400": {
"description": "Bad Request",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
}
}
},
"404": {
- "description": "Submodel not found",
+ "description": "Not Found",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
}
}
}
}
- }
- },
- "/submodel/submodelElements/{submodelElementIdShort}": {
+ },
"get": {
"tags": [
- "SubmodelServices"
+ "Submodel"
],
"summary": "Retrieves a specific Submodel-Element from the Submodel",
"operationId": "GetSubmodelElementByIdShort",
"parameters": [
{
- "name": "submodelElementIdShort",
+ "name": "seIdShortPath",
"in": "path",
- "description": "The Submodel-Element's short id",
+ "description": "The Submodel-Element's IdShort-Path",
"required": true,
"schema": {
"type": "string",
- "description": "The Submodel-Element's short id",
+ "description": "The Submodel-Element's IdShort-Path",
"nullable": true
}
}
@@ -324,150 +226,40 @@
"200": {
"description": "Returns the requested Submodel-Element",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/SubmodelElement"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/SubmodelElement"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/SubmodelElement"
- }
}
}
},
"404": {
- "description": "Submodel / Submodel Element not found",
+ "description": "Submodel Element not found",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
}
}
}
}
},
- "put": {
- "tags": [
- "SubmodelServices"
- ],
- "summary": "Updates the Asset Administration Shell's Submodel's Submodel-Element",
- "operationId": "PutSubmodelElementValueByIdShort",
- "parameters": [
- {
- "name": "submodelElementIdShort",
- "in": "path",
- "description": "The Submodel-Element's short id",
- "required": true,
- "schema": {
- "type": "string",
- "description": "The Submodel-Element's short id",
- "nullable": true
- }
- }
- ],
- "requestBody": {
- "description": "The new value",
- "content": {
- "application/json-patch+json": {
- "schema": {
- "$ref": "#/components/schemas/ElementValue"
- }
- },
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ElementValue"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/ElementValue"
- }
- },
- "application/*+json": {
- "schema": {
- "$ref": "#/components/schemas/ElementValue"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Submodel-Element's value changed successfully",
- "content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/ElementValue"
- }
- },
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ElementValue"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/ElementValue"
- }
- }
- }
- },
- "404": {
- "description": "Submodel / Submodel-Element not found",
- "content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- }
- }
- },
- "405": {
- "description": "Method not allowed"
- }
- }
- },
"delete": {
"tags": [
- "SubmodelServices"
+ "Submodel"
],
"summary": "Deletes a specific Submodel-Element from the Submodel",
"operationId": "DeleteSubmodelElementByIdShort",
"parameters": [
{
- "name": "submodelElementIdShort",
+ "name": "seIdShortPath",
"in": "path",
- "description": "The Submodel-Element's short id",
+ "description": "The Submodel-Element's IdShort-Path",
"required": true,
"schema": {
"type": "string",
- "description": "The Submodel-Element's short id",
+ "description": "The Submodel-Element's IdShort-Path",
"nullable": true
}
}
@@ -476,20 +268,10 @@
"200": {
"description": "Success",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
}
}
},
@@ -497,27 +279,27 @@
"description": "Submodel-Element deleted successfully"
},
"404": {
- "description": "Submodel / Submodel-Element not found"
+ "description": "Submodel-Element not found"
}
}
}
},
- "/submodel/submodelElements/{submodelElementIdShort}/value": {
+ "/submodel/submodelElements/{seIdShortPath}/value": {
"get": {
"tags": [
- "SubmodelServices"
+ "Submodel"
],
"summary": "Retrieves the value of a specific Submodel-Element from the Submodel",
"operationId": "GetSubmodelElementValueByIdShort",
"parameters": [
{
- "name": "submodelElementIdShort",
+ "name": "seIdShortPath",
"in": "path",
- "description": "The Submodel-Element's short id",
+ "description": "The Submodel-Element's IdShort-Path",
"required": true,
"schema": {
"type": "string",
- "description": "The Submodel-Element's short id",
+ "description": "The Submodel-Element's IdShort-Path",
"nullable": true
}
}
@@ -526,82 +308,109 @@
"200": {
"description": "Returns the value of a specific Submodel-Element",
"content": {
- "text/plain": {
- "schema": {
- "type": "object"
- }
- },
"application/json": {
"schema": {
"type": "object"
}
- },
- "text/json": {
- "schema": {
- "type": "object"
- }
}
}
},
"404": {
"description": "Submodel / Submodel-Element not found",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
}
}
},
"405": {
"description": "Method not allowed",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
}
}
}
}
+ },
+ "put": {
+ "tags": [
+ "Submodel"
+ ],
+ "summary": "Updates the Submodel-Element's value",
+ "operationId": "PutSubmodelElementValueByIdShort",
+ "parameters": [
+ {
+ "name": "seIdShortPath",
+ "in": "path",
+ "description": "The Submodel-Element's IdShort-Path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "The Submodel-Element's IdShort-Path",
+ "nullable": true
+ }
+ }
+ ],
+ "requestBody": {
+ "description": "The new value",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "The new value",
+ "nullable": true
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Submodel-Element's value changed successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ElementValue"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Submodel-Element not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Result"
+ }
+ }
+ }
+ },
+ "405": {
+ "description": "Method not allowed"
+ }
+ }
}
},
- "/submodel/submodelElements/{operationIdShort}/invoke/{async}": {
+ "/submodel/submodelElements/{idShortPathToOperation}/invoke": {
"post": {
"tags": [
- "SubmodelServices"
+ "Submodel"
],
"summary": "Invokes a specific operation from the Submodel synchronously or asynchronously",
"operationId": "InvokeOperationByIdShortAsync",
"parameters": [
{
- "name": "operationIdShort",
+ "name": "idShortPathToOperation",
"in": "path",
- "description": "The Operation's short id",
+ "description": "The IdShort path to the Operation",
"required": true,
"schema": {
"type": "string",
- "description": "The Operation's short id",
+ "description": "The IdShort path to the Operation",
"nullable": true
}
},
@@ -613,38 +422,15 @@
"type": "boolean",
"description": "Determines whether the execution of the operation is asynchronous (true) or not (false)"
}
- },
- {
- "name": "async",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
}
],
"requestBody": {
"description": "The parameterized request object for the invocation",
"content": {
- "application/json-patch+json": {
- "schema": {
- "$ref": "#/components/schemas/InvocationRequest"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvocationRequest"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/InvocationRequest"
- }
- },
- "application/*+json": {
- "schema": {
- "$ref": "#/components/schemas/InvocationRequest"
- }
}
}
},
@@ -652,40 +438,20 @@
"400": {
"description": "Bad Request",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
}
}
},
"404": {
- "description": "Submodel / Method handler not found",
+ "description": "Method handler not found",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
}
}
},
@@ -695,22 +461,22 @@
}
}
},
- "/submodel/submodelElements/{operationIdShort}/invocationList/{requestId}": {
+ "/submodel/submodelElements/{idShortPathToOperation}/invocationList/{requestId}": {
"get": {
"tags": [
- "SubmodelServices"
+ "Submodel"
],
"summary": "Retrieves the result of an asynchronously started operation",
"operationId": "GetInvocationResultByIdShort",
"parameters": [
{
- "name": "operationIdShort",
+ "name": "idShortPathToOperation",
"in": "path",
- "description": "The Operation's short id",
+ "description": "The IdShort path to the Operation",
"required": true,
"schema": {
"type": "string",
- "description": "The Operation's short id",
+ "description": "The IdShort path to the Operation",
"nullable": true
}
},
@@ -730,60 +496,30 @@
"200": {
"description": "Result found",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/InvocationResponse"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvocationResponse"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/InvocationResponse"
- }
}
}
},
"400": {
"description": "Bad Request",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
}
}
},
"404": {
- "description": "Submodel / Operation / Request not found",
+ "description": "Operation / Request not found",
"content": {
- "text/plain": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
- },
"application/json": {
"schema": {
"$ref": "#/components/schemas/Result"
}
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/Result"
- }
}
}
}
@@ -1109,62 +845,6 @@
}
}
},
- "MessageType": {
- "enum": [
- "Unspecified",
- "Debug",
- "Information",
- "Warning",
- "Error",
- "Fatal",
- "Exception"
- ],
- "type": "string"
- },
- "Message": {
- "type": "object",
- "properties": {
- "messageType": {
- "$ref": "#/components/schemas/MessageType"
- },
- "text": {
- "type": "string",
- "nullable": true
- },
- "code": {
- "type": "string",
- "nullable": true
- }
- }
- },
- "Result": {
- "type": "object",
- "properties": {
- "success": {
- "type": "boolean"
- },
- "isException": {
- "type": "boolean",
- "nullable": true,
- "readOnly": true
- },
- "entity": {
- "type": "object",
- "nullable": true
- },
- "entityType": {
- "type": "string",
- "nullable": true
- },
- "messages": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Message"
- },
- "nullable": true
- }
- }
- },
"ModelingKind": {
"enum": [
"Instance",
@@ -1284,159 +964,57 @@
}
}
},
- "AssetAdministrationShellReference": {
+ "MessageType": {
+ "enum": [
+ "Unspecified",
+ "Debug",
+ "Information",
+ "Warning",
+ "Error",
+ "Fatal",
+ "Exception"
+ ],
+ "type": "string"
+ },
+ "Message": {
"type": "object",
"properties": {
- "keys": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Key"
- },
+ "messageType": {
+ "$ref": "#/components/schemas/MessageType"
+ },
+ "text": {
+ "type": "string",
+ "nullable": true
+ },
+ "code": {
+ "type": "string",
"nullable": true
}
}
},
- "View": {
+ "Result": {
"type": "object",
"properties": {
- "idShort": {
- "type": "string",
- "nullable": true
+ "success": {
+ "type": "boolean"
},
- "containedElements": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Reference"
- },
- "nullable": true
- },
- "semanticId": {
- "$ref": "#/components/schemas/Reference"
- },
- "category": {
- "type": "string",
- "nullable": true
- },
- "description": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/LangString"
- },
- "nullable": true
- },
- "modelType": {
- "$ref": "#/components/schemas/ModelType"
- }
- }
- },
- "ConceptDescriptionReference": {
- "type": "object",
- "properties": {
- "keys": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Key"
- },
- "nullable": true
- }
- }
- },
- "ConceptDictionary": {
- "type": "object",
- "properties": {
- "idShort": {
- "type": "string",
- "nullable": true
- },
- "category": {
- "type": "string",
- "nullable": true
- },
- "description": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/LangString"
- },
- "nullable": true
- },
- "metaData": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- },
- "nullable": true
- },
- "conceptDescriptions": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ConceptDescriptionReference"
- },
- "nullable": true
- },
- "modelType": {
- "$ref": "#/components/schemas/ModelType"
- }
- }
- },
- "AssetAdministrationShell": {
- "type": "object",
- "properties": {
- "idShort": {
- "type": "string",
- "nullable": true
- },
- "asset": {
- "$ref": "#/components/schemas/Asset"
- },
- "submodels": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Submodel"
- },
- "nullable": true
- },
- "derivedFrom": {
- "$ref": "#/components/schemas/AssetAdministrationShellReference"
- },
- "views": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/View"
- },
- "nullable": true
- },
- "modelType": {
- "$ref": "#/components/schemas/ModelType"
- },
- "embeddedDataSpecifications": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/IEmbeddedDataSpecification"
- },
+ "isException": {
+ "type": "boolean",
"nullable": true,
"readOnly": true
},
- "conceptDictionaries": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ConceptDictionary"
- },
+ "entity": {
+ "type": "object",
"nullable": true
},
- "identification": {
- "$ref": "#/components/schemas/Identifier"
- },
- "administration": {
- "$ref": "#/components/schemas/AdministrativeInformation"
- },
- "category": {
+ "entityType": {
"type": "string",
"nullable": true
},
- "description": {
+ "messages": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/LangString"
+ "$ref": "#/components/schemas/Message"
},
"nullable": true
}
@@ -1600,13 +1178,165 @@
"$ref": "#/components/schemas/ExecutionState"
}
}
+ },
+ "AssetAdministrationShellReference": {
+ "type": "object",
+ "properties": {
+ "keys": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Key"
+ },
+ "nullable": true
+ }
+ }
+ },
+ "View": {
+ "type": "object",
+ "properties": {
+ "idShort": {
+ "type": "string",
+ "nullable": true
+ },
+ "containedElements": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Reference"
+ },
+ "nullable": true
+ },
+ "semanticId": {
+ "$ref": "#/components/schemas/Reference"
+ },
+ "category": {
+ "type": "string",
+ "nullable": true
+ },
+ "description": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/LangString"
+ },
+ "nullable": true
+ },
+ "modelType": {
+ "$ref": "#/components/schemas/ModelType"
+ }
+ }
+ },
+ "ConceptDescriptionReference": {
+ "type": "object",
+ "properties": {
+ "keys": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Key"
+ },
+ "nullable": true
+ }
+ }
+ },
+ "ConceptDictionary": {
+ "type": "object",
+ "properties": {
+ "idShort": {
+ "type": "string",
+ "nullable": true
+ },
+ "category": {
+ "type": "string",
+ "nullable": true
+ },
+ "description": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/LangString"
+ },
+ "nullable": true
+ },
+ "metaData": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "conceptDescriptions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ConceptDescriptionReference"
+ },
+ "nullable": true
+ },
+ "modelType": {
+ "$ref": "#/components/schemas/ModelType"
+ }
+ }
+ },
+ "AssetAdministrationShell": {
+ "type": "object",
+ "properties": {
+ "idShort": {
+ "type": "string",
+ "nullable": true
+ },
+ "asset": {
+ "$ref": "#/components/schemas/Asset"
+ },
+ "submodels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Submodel"
+ },
+ "nullable": true
+ },
+ "derivedFrom": {
+ "$ref": "#/components/schemas/AssetAdministrationShellReference"
+ },
+ "views": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/View"
+ },
+ "nullable": true
+ },
+ "modelType": {
+ "$ref": "#/components/schemas/ModelType"
+ },
+ "embeddedDataSpecifications": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/IEmbeddedDataSpecification"
+ },
+ "nullable": true,
+ "readOnly": true
+ },
+ "conceptDictionaries": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ConceptDictionary"
+ },
+ "nullable": true
+ },
+ "identification": {
+ "$ref": "#/components/schemas/Identifier"
+ },
+ "administration": {
+ "$ref": "#/components/schemas/AdministrativeInformation"
+ },
+ "category": {
+ "type": "string",
+ "nullable": true
+ },
+ "description": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/LangString"
+ },
+ "nullable": true
+ }
+ }
}
}
- },
- "tags": [
- {
- "name": "SubmodelServices",
- "description": "All Submodel Services provided by the component"
- }
- ]
+ }
}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-packages/BaSyx.AAS.Client.Http.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.AAS.Client.Http.1.0.0.nupkg
index 2d86d5b..b9f84e5 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.AAS.Client.Http.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.AAS.Client.Http.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.AAS.Client.Http.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.AAS.Client.Http.1.0.0.symbols.nupkg
index b805af2..eab83a6 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.AAS.Client.Http.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.AAS.Client.Http.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.AAS.Server.Http.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.AAS.Server.Http.1.0.0.nupkg
index ceb709a..dfac4d7 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.AAS.Server.Http.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.AAS.Server.Http.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.AAS.Server.Http.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.AAS.Server.Http.1.0.0.symbols.nupkg
index 4cdd80e..38d847d 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.AAS.Server.Http.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.AAS.Server.Http.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.API.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.API.1.0.0.nupkg
index 8f27bc2..31f7b20 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.API.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.API.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.API.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.API.1.0.0.symbols.nupkg
index c4edc54..48068f4 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.API.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.API.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.1.0.0.nupkg
index 415d991..6b9fd7c 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.1.0.0.symbols.nupkg
index 74edf28..8cdf464 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.AASX.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.AASX.1.0.0.nupkg
index 005f581..d26c926 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.AASX.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.AASX.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.AASX.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.AASX.1.0.0.symbols.nupkg
index 55909e9..2404720 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.AASX.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.API.Http.Controllers.AASX.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Common.UI.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Common.UI.1.0.0.nupkg
index 0fbd587..1759bdf 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Common.UI.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Common.UI.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Common.UI.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Common.UI.1.0.0.symbols.nupkg
index 9bce189..c7865d1 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Common.UI.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Common.UI.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Common.UI.Swagger.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Common.UI.Swagger.1.0.0.nupkg
index fd85bb0..ab1768c 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Common.UI.Swagger.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Common.UI.Swagger.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Common.UI.Swagger.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Common.UI.Swagger.1.0.0.symbols.nupkg
index 231342b..0f75fb0 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Common.UI.Swagger.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Common.UI.Swagger.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Components.Common.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Components.Common.1.0.0.nupkg
index 188ed51..2f8b802 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Components.Common.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Components.Common.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Components.Common.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Components.Common.1.0.0.symbols.nupkg
index 15c1086..a51f71d 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Components.Common.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Components.Common.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Discovery.mDNS.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Discovery.mDNS.1.0.0.nupkg
index 7b8358b..96f1f7b 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Discovery.mDNS.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Discovery.mDNS.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Discovery.mDNS.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Discovery.mDNS.1.0.0.symbols.nupkg
index 183e912..4ccd1eb 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Discovery.mDNS.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Discovery.mDNS.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Models.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Models.1.0.0.nupkg
index 9980c69..ce36bc0 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Models.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Models.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Models.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Models.1.0.0.symbols.nupkg
index b1be932..f12dbfc 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Models.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Models.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Models.Export.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Models.Export.1.0.0.nupkg
index 32663b1..319007e 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Models.Export.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Models.Export.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Models.Export.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Models.Export.1.0.0.symbols.nupkg
index 07a2f07..75a9c69 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Models.Export.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Models.Export.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Registry.Client.Http.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Registry.Client.Http.1.0.0.nupkg
index d174114..f055853 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Registry.Client.Http.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Registry.Client.Http.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Registry.Client.Http.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Registry.Client.Http.1.0.0.symbols.nupkg
index 5f2785b..9320ed3 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Registry.Client.Http.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Registry.Client.Http.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Registry.ReferenceImpl.FileBased.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Registry.ReferenceImpl.FileBased.1.0.0.nupkg
index 5ceecb7..ff890bd 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Registry.ReferenceImpl.FileBased.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Registry.ReferenceImpl.FileBased.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Registry.ReferenceImpl.FileBased.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Registry.ReferenceImpl.FileBased.1.0.0.symbols.nupkg
index eefde99..f37a8e8 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Registry.ReferenceImpl.FileBased.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Registry.ReferenceImpl.FileBased.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Registry.Server.Http.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Registry.Server.Http.1.0.0.nupkg
index 8f7cf46..74e3c6e 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Registry.Server.Http.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Registry.Server.Http.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Registry.Server.Http.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Registry.Server.Http.1.0.0.symbols.nupkg
index b4f0157..f84bb52 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Registry.Server.Http.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Registry.Server.Http.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Submodel.Client.Http.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Submodel.Client.Http.1.0.0.nupkg
index bbb22db..b13f0b4 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Submodel.Client.Http.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Submodel.Client.Http.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Submodel.Client.Http.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Submodel.Client.Http.1.0.0.symbols.nupkg
index 64c4fa1..1ee04bb 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Submodel.Client.Http.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Submodel.Client.Http.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Submodel.Server.Http.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Submodel.Server.Http.1.0.0.nupkg
index 7b3b2a8..dc8fb29 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Submodel.Server.Http.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Submodel.Server.Http.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Submodel.Server.Http.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Submodel.Server.Http.1.0.0.symbols.nupkg
index e3b654d..14b9494 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Submodel.Server.Http.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Submodel.Server.Http.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Utils.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Utils.1.0.0.nupkg
index 6b580a0..322d824 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Utils.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Utils.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Utils.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Utils.1.0.0.symbols.nupkg
index 2848004..1690999 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Utils.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Utils.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Utils.Client.Mqtt.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Utils.Client.Mqtt.1.0.0.nupkg
index 87dd50a..b779e39 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Utils.Client.Mqtt.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Utils.Client.Mqtt.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Utils.Client.Mqtt.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Utils.Client.Mqtt.1.0.0.symbols.nupkg
index fbd96c4..30af330 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Utils.Client.Mqtt.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Utils.Client.Mqtt.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.1.0.0.nupkg
index 1b39c57..d902242 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.1.0.0.symbols.nupkg
index e18234b..7e77439 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.1.0.0.symbols.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.Abstractions.1.0.0.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.Abstractions.1.0.0.nupkg
index b6ecc8d..2a22b39 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.Abstractions.1.0.0.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.Abstractions.1.0.0.nupkg
Binary files differ
diff --git a/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.Abstractions.1.0.0.symbols.nupkg b/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.Abstractions.1.0.0.symbols.nupkg
index 015546d..bd273f7 100644
--- a/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.Abstractions.1.0.0.symbols.nupkg
+++ b/sdks/dotnet/basyx-packages/BaSyx.Utils.DependencyInjection.Abstractions.1.0.0.symbols.nupkg
Binary files differ