eclipse-basyx / basyx-java-components

java-components
MIT License
25 stars 31 forks source link

Wrong address in registry when loading .aasx files #21

Closed SamedAga closed 2 years ago

SamedAga commented 2 years ago

Hi there,

I've noticed that when I load in .aasx files a part of the URL for submodels on the registry server is wrong. To be precise, it seems that the "shells" part in the URL is missing.

For example it shows like that:

http://localhost:4001/aasServer/DemoAAS_iD/aas/submodels/DemoSubmodel/submodel

where as the correct form should be:

http://localhost:4001/aasServer/**shells**/DemoAAS_iD/aas/submodels/DemoSubmodel/submodel

The code that I use to load .aasx files is this one:

AASXPackageManager aasx_packman = new AASXPackageManager("C:/blub/demo_aas.aasx");

Set<AASBundle> bundles = aasx_packman.retrieveAASBundles();

AASBundleHelper.integrate(new AASAggregatorProxy(AASSERVERPATH), bundles);

AASRegistryProxy proxy = new AASRegistryProxy(REGISTRYPATH);
AASBundleHelper.register(proxy, bundles, AASSERVERPATH);

I'm not sure if I did something wrong or if it is a bug.

Best,

Samed

OParczyk commented 2 years ago

I recently stumbled across the same thing. The AASAggregatorProxy doesn't want the AAS server path but the AAS Aggregator path, which includes the /shells: http://localhost:4001/aasServer/shells in your example.

See this example line 47

FrankSchnicke commented 2 years ago

Many thanks for pointing this out. The AASRegistryProxy checks for existence of this /shells suffix and adds it, if necessary. However, the AASBundleHelper does not contain this failsafe logic. Thus, the described behavior is exposed.

We will add the failsafe logic to the AASBundleHelper to create a consistent handling of paths. I'll update this ticket accordingly.

FrankSchnicke commented 2 years ago

Your remark is addressed in https://github.com/eclipse-basyx/basyx-java-sdk/pull/42 and will be included in the upcoming 1.1 release.

Many thanks again for pointing this out!