Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [basyx-dev] Operation invoke problem
  • From: "Laack, Markus van" <markus.van.laack@xxxxxxxxxxxxxxxxx>
  • Date: Tue, 15 Jun 2021 12:28:03 +0000
  • Accept-language: de-DE, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ieg.fraunhofer.de; dmarc=pass action=none header.from=ieg.fraunhofer.de; dkim=pass header.d=ieg.fraunhofer.de; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SvT72sdH03H+hgXMj25uoYhvLAjy22mUjnI4hP+QfRo=; b=NZwRImh//VHWg1hCa5QTZnT0g7ojK7+Yofwxbzw4N1NqvscuKPo+1M/zJO9f0z+aI8CC4MzWprIjLA2k6K/objl6wR1eQUHBvq2ipE0Cv5mJXaeuq8EhkurBpw1Jkig3vOEKHKIUZJBwrcRUS9cMLWopmXadrToqs9QWUZWFu2Cgf43UqumWu9mgRI984NcmSOjJurIgQ9E35tYNYY1NrxMB71UnrqLOCLjtCdBnSMvHclyI8KWlGM9gR1/xJprCs1TtEcqabbNt8XxLQlW08/VgSwONyY7W2KRbEi4KtSPafxpGt6E2XscMj0MhoC+N2IMZatCjylFOzOqs+FAaYg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bGxoWDtB3Y1qenVW+dPrsqK/C55NtqAJQcwh+vQwklAFZvb8+GD+Ll+Wf876etLrzXNDKzggluXjMTrD1jQH//wxLTuTNo7Rev8Hwd1A9XRFZ2gCp9eqLMiaQoKyI93jrCK6Zvs0c+GNjtTEF9EUgAOuV1tc3sO/+xWl1Ooj/AgcLyKdDwIejwNTMr2PjXnOZnRa2Ahr/D5rM1lh1pl657H9RuHDw9cINULruMoFNeLYEAaDR6NzsFLPM3W8wUJ+EXr5uBjYh463jOiFmgGmvI0uRLee8gXu/N32sDkZoK1Hx3hX2Npf3rIJ4sjFxc2wHyBTwtbtDq3BqR+1UU8KVw==
  • Delivered-to: basyx-dev@xxxxxxxxxxx
  • Ironport-hdrordr: A9a23:23EhoaCnJgp54fjlHeg/sceALOsnbusQ8zAXPh9KJiC9I/b1qynxppkmPEfP+UwssQIb6K290ci7MD/hHPtOj7X5Uo3SOjUO1FHYT72KqLGSuAEIeBeOudK1t50QCpSWYeeYZTMR7KbHCUuDYq4dKbG8gfmVbIzlvhJQpHRRGsZdBnBCe2Km+yNNNWt7LKt8MKDZyttMpjKmd3hSRN+8HGM5U+/KoMCOvI76YDYdbiRXpjWmvHeN0vrXAhKY1hARX3dk2rE561XIlAT/++GKr+y78BnBzGXehq4m2ecJi+EzRPBkuPJlaAkEuTzYIbiJnIfy+Azdldvfq2rCVuO85CvIcf4DrU85NVvF3ScFkzOQrwrGrUWSkWNwyEGT3/DRVXY0DdFMipledQac4008vMtk2KYOxG6BsYFLZCmw1BgVyuK4IS2CrHDE6EbKUNRj+kB3QM8bcvtcvIYf9ERaHNMJGz/78pkuFK1rANvH7PhbfFuGZzSB11MfiuCETzA2BFOLU0ICssua33xfm2141VIRwIgakm0b/JwwRpFY76DPM7hulrtJUsgKBJgNT9vpgfHHfVAlZCi8fV56DW6XZ53vCki936Ifuo9FlN1CUKZ4vqfatq6xIW9liQ==
  • Ironport-phdr: A9a23:mLC1RhGnYjJdDwn4WiAOH51GfsoY04WdBeZdwpcsj7NWaanl+I7tbwTT5vRo2VnOW4iTq/dJkPHfvK2oX2scqY2Av3YPfN0pNVcFhMwakhZmDJuDDkv2f/Phay0iB8kEU0VqrDm3NEFPE5P4YFvf6nS58T8VHED5Mgx4Q4a9GoPbg8mtke6o/JiGYghHwjSnaK50LBK4oB+XusRF6bY=
  • Ironport-phdr: A9a23:UhXSkBNruP4k9Cah310l6nfvWUAX0o4cdiYY4Z4mk6lDNKO58MeqME/e4KBri1nEFcXe5ulfguXb+6bnRSQb4JmHvXxDFf4EVxIMhcgM2QB1BsmDBB72J/rrdzc3WsNYWwwt83SyK0MAHsH4ahXbqWGz6jhHHBL5OG8XbuT4E4LflYK5zee3rpzebENGnjOgZ7N1Ihis6wnc5aEr
  • Ironport-sdr: KzWX/MENEnOZpzF9wpcWqwAfk3Znjrj4Pun5Vm664RNr3e5tRqmfL3cPc4CKPAwq0BogAC16Qo MWA0opsxUJEA==
  • Ironport-sdr: LmctVhTMqLBJbRDO4HgVYkP0kM5qQi3ZdWRUxheh2fcXYHr5gnDK1dPoc+X1pxKeibTFFkkO4v hUJXFCwXUtzCb8ftEphm9WiuRmJr+pPb4=
  • List-archive: <https://www.eclipse.org/mailman/private/basyx-dev/>
  • List-help: <mailto:basyx-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/basyx-dev>, <mailto:basyx-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/basyx-dev>, <mailto:basyx-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: Addbfi/wr8wA5AyKRSCITD8okVK5xwFfIqnAAAByW+AAN3/i0A==
  • Thread-topic: Operation invoke problem

Hi Frank,

 

thank you for your reply and explanation regarding the example. Considering this it indeed makes sense to not be able to push executable code onto a remote server.

Maybe enabling this feature considering an authentication with a certain certificate, as Thomas suggested, could be an interesting topic for further development (thank you as well for your input, Thomas), but for my use-case it is fine for now to predefine the runtime behavior on their own server.

 

Therefore, I had a look at the cloudedgedeployment example and indeed I can invoke (from the client application) the Operation now that is part of the Edge Submodel.

However, I still receive an error afterwards on both the client and server application, even though the operation is executed successfully!!!

The error message printed in the client console even looks the same to me as the one I had in my initial attempt (HelloWorld example).

Still the client crashes after the execution, while the server application (CloudEdgeDeploymentScenario.java) does not.

 

Client:

Exception in thread "main" org.eclipse.basyx.vab.exception.provider.ProviderException: [HTTP POST] Failed to request http://localhost:8082/oven/curr_temp/submodel with mediatype application/json;charset=UTF-8

 

Server:

[http-nio-8082-exec-8] ERROR o.e.b.v.c.j.p.JSONProvider - Unknown Exception in JSONProvider

java.util.NoSuchElementException: null

 

Is there still a point I miss/do wrong to invoke an operation?

 

Best regards

Markus van Laack

 

Von: basyx-dev <basyx-dev-bounces@xxxxxxxxxxx> Im Auftrag von Thomas.Kuhn@xxxxxxxxxxxxxxxxxx
Gesendet: Montag, 14. Juni 2021 11:07
An: basyx-dev@xxxxxxxxxxx
Betreff: Re: [basyx-dev] Operation invoke problem

 

Hi Frank,

 

spannend wäre es natürlich wenn wir das pushen von Code von autorisierten Hosts zulassen. Diese könnten sich ja mit einem Zertifikat ausweisen…

 

LG, Thomas

 

 

 

-------------------------------------------

Dr. Thomas Kuhn

Division Manager Embedded Systems

Fraunhofer IESE

Fraunhofer-Platz 1 | 67663 Kaiserslautern | Germany

Phone: +49 631 / 6800- 2177 | Fax: +49 631 / 6800-1199

www.iese.fraunhofer.de

Email: Thomas.Kuhn@xxxxxxxxxxxxxxxxxx

 

 

 

From: basyx-dev <basyx-dev-bounces@xxxxxxxxxxx> On Behalf Of Schnicke, Frank
Sent: Montag, 14. Juni 2021 11:00
To: basyx-dev@xxxxxxxxxxx
Subject: Re: [basyx-dev] Operation invoke problem

 

Dear Markus,

 

the code in the Hello World Example is pushing the defined submodel to a remote AAS server. Pushing a Submodel with runtime code right now is not supported due to security concerns – however, the error message could be clearer here. I’m taking a note on improving the message in this case.

 

To enable your use case, you can easily host submodels with runtime behavior on their own server. How to do this is showcased in https://wiki.eclipse.org/BaSyx_/_Scenarios_/_Cloud_Edge_Deployment.

 

The code of this example is found in basyx.examples in the org.eclipse.basyx.examples.scenarios.cloudedgedeployment package.


Best regards,

Frank

 

--

Frank Schnicke

Expert »Industrie 4.0 System Architectures«

Dept. Virtual Engineering

 

Fraunhofer IESE

Fraunhofer-Platz 1 | 67663 Kaiserslautern

+49 631 6800-2259

frank.schnicke@xxxxxxxxxxxxxxxxxx

www.iese.fraunhofer.de

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

25 Jahre Fraunhofer IESE  –  Engineering the Digital Future

Reisen Sie mit uns in die Vergangenheit, aber vor allem in die digitale Zukunft!

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 

Von: basyx-dev <basyx-dev-bounces@xxxxxxxxxxx> Im Auftrag von Laack, Markus van
Gesendet: Montag, 7. Juni 2021 11:19
An: basyx-dev@xxxxxxxxxxx
Betreff: [basyx-dev] Operation invoke problem

 

Dear BaSyx Developer,

 

I’m Markus van Laack working for the Fraunhofer IEG. We are planning to use BaSyx within our project and I’m currently doing my first steps and tests with it.

One requirement I am trying to get to work is to invoke a defined Operation. The goal for later will be to call a local Python script but for now I’m just trying to be able to invoke an Operation at all.

 

As a fist start I took the “Hello_World” example and added an Operation to the Server.java as it is explained in the Step 3 of the Introductory Examples.

I’ve extended the code of the Server.java by the following lines to create my Operation and to add it to the Documentation Submodel:

 

// Function to become Operation

Function<Object[], Object> runModel = (argus) -> {

System.out.println("Hello");

      return null;

};          

 

// Create Operation

Operation runModelOperation = new Operation(runModel);

// Set ID of the operation

runModelOperation.setIdShort(OPID);

// Add the operation to the Submodel

documentationSubmodel.addSubmodelElement(runModelOperation);

 

 

Inside the Client.java I’ve just added the following lines to the bottom to retrieve and to invoke the new Operation:

 

ISubmodel submdl = manager.retrieveSubmodel(Server.OVENAASID, Server.DOCUSMID);

IOperation runMdlOperation = submdl.getOperations().get(Server.OPID);

System.out.println(runMdlOperation.getIdShort()); // This line works and prints the ID short

runMdlOperation.invoke();// This line fails

 

 

But when executing the invoke I face the following error message:

 

Exception in thread "main" org.eclipse.basyx.vab.exception.provider.ProviderException: [HTTP POST] Failed to request http://localhost:4001/aasServer/shells/eclipse.basyx.aas.oven/aas/submodels/documentationSm/submodel with mediatype application/json;charset=UTF-8

 

In fact the line above is still working and printing out the ID short in the Console, so I assume that the Operation was successfully created and added to the Docu Submodel, but I don’t see why I cannot invoke it?!

 

I’m looking forward hearing from you.

Best regards and thank you for your time.

Markus van Laack


Back to the top