Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [basyx-dev] Query on invoking Operation with REST API
  • From: <maximilian.conradi@xxxxxxxxxxxxxxxxxx>
  • Date: Mon, 22 Nov 2021 13:13:17 +0000
  • Accept-language: de-DE, en-US
  • Delivered-to: basyx-dev@xxxxxxxxxxx
  • Ironport-data: A9a23:6nT1CqtdMv2ILVVLSl5+nMyGL+fnVBZYMUV32f8akzHdYApBsoF/q tZmKTjXP/qNZmCket9+a9jjpEoF7cfXzYA1Hgs9+CtgQ38RgMeUXt7xwmUckM+xwm0vaGo9s q3yv/GZdJhcokf0/0zrb/69xZVF/fngqoDUUYYoAQgsA187IMsdoUg7wbdg29Qy2YHR7z6l4 LseneWPYDdJ5BYpagr424rbwP+4lK2v0N+wlgVWicFj5DcypVFMZH4sDf3Zw0/Df2VhNrXSq 9AvbF2O1jixEx8FUrtJm1tgG6EAaua60QOm0hK6V0U+6/RPjnRa70o1CBYTQWty1RqPgMkv8 YQXjq7uFA47GJXdvftIBnG0EwkmVUFH0LzcZH6yrIqSwlbLNXX2yuhoDEY4MJde9usf7WNmr KFDbmFTKEnY3KTsqF64YrEEasALKcD7PYYevnBpy3fSCvA8SJzCa6TH/tIe0i05m8ZOGvjTf YwVZFKDaTyZPUUeYQpNU8lWcOGAh3ildydxkGupn4E86GLYnQkpgLa3P4+AEjCNbZ8MxR/D9 jOuE37CKhsTL82PjDaI7FqhjevOhTj2HoUIG9WFGuVChkbVx2EIBVsYT1Kmp/m+hEOkHd5SQ 6AJxsYwhYQXqmOtUcCjZkzim0za4xcOfeJBNvJvvWlh1ZHoywqeA2EFSBtIZ9onqNI6SFQWO rmhw4KB6dtH7eb9dJ6NyluHhW/jZXNJcwfucQdbElRbvrEPtalu1nryosBf/LmdovCd9dvY4 DmLtyUknLEakNIGzaPTEbvv3W3y+MOhouId3AXaX2Sh5wV1Ibarboi6gWU3AN5GN8CYQ0KM+ nYektWY7OcAAIvLmCHlrAQ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mFE43GgYypLrWd9dPgE/P n13LsDm9L+Ek5nKfhSYxE+Lqr+juyOsKijTQ8NBhYh5gXLpyiv8qTGHx+R2Qpbey9TwJ85mF K12jDR1+GGibWW2xXc32jc49B9g9360OZOA8SKl4w8NijssAC1f45sMofy9Azd4dvfo2rCou O87ivIDP4Dp085uVvF7icF7jOQmgrGLUWSh2Nwz0GT4PARDwhKdvapzbgpDicxQXBQ/KA77E sM5RPci3MfN2K+oA3to9fPTB1kjUyyvD4rlvMSlWVWVc8EZKZWtpF3xjIgLH4sJlOJ1GkcKp gaMCjx3ocmTbqqVQGrgoA0+q3TYp0aJGb3fnQ/
  • Ironport-sdr: PH8k0G9I9DDCArIkaxpj11YSMFwD/Qc2jUqJXCMqg1sG5OwL3lTsnT5ji/i+1qZuCNTFO7BxgM XW0I8QcCbzZHzCo0wMsH2zuvluoORN9GpqoMzLOCHrkPCt9RXW9R1qWJ9cS2BWy8ugBpXtgPNJ lF1AkO2rRyDNczVEVKqu3Xqc/8OowObo2yGZKLJMxOwPpdBiyNWJ9Ps87Rpb1nmGSgEoASWAkx AzPcGtgy6QmDu465BADTtcGjq/oQJBf3xqJXxfDTlIb9rooxK4xKdjNOhXJMJNocK+ee512Aag 6TI=
  • Ironport-sdr: JYx19Bs9nDuLOQVr1cJmXjLL9OB2cV1GuSliKQ8tnhClwLTRcxWwCc1HKYayVWOVZFbBYi/VJM QlBn3BNuRFgB8/RNN99KRO9u2SB8BGes4=
  • 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: AdffoqJx3IzG8OVzRHmbmLyRanVCTA==
  • Thread-topic: RE: [basyx-dev] Query on invoking Operation with REST API

Hello Mr. Shaik,

 

thank you for your message.

I think the exception you are getting is caused by a slightly wrong body you use for your request.

The correct body should look like this:

 

{

"requestId" : "1",

"inputArguments": [

    {

      "value": {

           "idShort": "finput",

           "valueType": "string",

           "value": "MyInput",

           "modelType": {

               "name": "Property"

           }

      }

    }

  ],

    "timeout" : 5000

}

 

Some of the content of “value” needs to be slightly different to what you had.

I hope this helps.

 

Kind regards

Maximilian Conradi

 

--

Maximilian Conradi

Software Architect

Dept. Virtual Engineering

 

Fraunhofer IESE

Fraunhofer-Platz 1 | 67663 Kaiserslautern

+49 631 6800 2278
maximilian.conradi@xxxxxxxxxxxxxxxxxx

www.iese.fraunhofer.de

 

 

 

 

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

Von: basyx-dev <basyx-dev-bounces@xxxxxxxxxxx> Im Auftrag von Nayabrasul Shaik

Von: basyx-dev <basyx-dev-bounces@xxxxxxxxxxx> Im Auftrag von Nayabrasul Shaik
Gesendet: Dienstag, 16.
November 2021 16:28
An:
basyx-dev@xxxxxxxxxxx
Betreff: [basyx-dev] Query on invoking Operation with REST API

 

Dear Basyx Developers Community,

I am Nayabrasul Shaik, working for Service Robotics Research Center at the Ulm University of Applied Sciences, Germany.
Our group is currently working on providing AAS interface to the Service Robots. We choose Basyx implementation for this purpose and appreciate your effort.


I have a query on invoking the operation using the REST interface. I am using the
Cloud Edge Deployment example for this purpose.


I added an Operation(which takes a string as input and returns a string) to Submodel and tried to invoke it using Postman rest client.
The response from REST api is unsuccessful and I see the following error in Basyx.


Error from Basyx:
-------------------------
15:56:39.870 [http-nio-8082-exec-5] ERROR org.eclipse.basyx.vab.coder.json.provider.JSONProvider - Unknown Exception in JSONProvider
org.eclipse.basyx.aas.metamodel.exception.MetamodelConstructionException: Could not construct meta model element org.eclipse.basyx.submodel.metamodel.map.submodelelement.operation.OperationVariable. Passed argument was {modelType={name=OperationVariable}, value={valueId=null, kind=Template, valueType=string, modelType={name=Property}, value=foutput}}
    at org.eclipse.basyx.submodel.metamodel.map.submodelelement.operation.OperationVariable.createAsFacade(OperationVariable.java:69)
   
   

Below snippet shows the operation added to submodel:
-----------------------------------------------------------------------------

        complex.setIdShort("complex");       
        Property inProp1 = new Property("finput");
        inProp1.setModelingKind(ModelingKind.TEMPLATE);
        inProp1.setValueType(ValueType.String);
       
        Property outProp = new Property("foutput");
        outProp.setModelingKind(ModelingKind.TEMPLATE);
        outProp.setValueType(ValueType.String);
       
        complex.setInputVariables(Arrays.asList(new OperationVariable(inProp1)));
        complex.setOutputVariables(Collections.singleton(new OperationVariable(outProp)));       
               
        edgeSm.addSubmodelElement(complex);



Following is the REST API used and JSON input used for invoking the operation:
-------------------------------------------------------------------------------------------------------------

POST
http://localhost:8082/oven/curr_temp/submodel/submodelElements/complex/invoke


{
"requestId" : "1",
"inputArguments": [
    {
      "value": {
        "idShort": "finput",
        "category": "string",
        "kind": "Template",
        "value": "MyInput",
        "mimeType": "string"
      }
    }
  ],
    "timeout" : 5000
}



I appreciate any cues in getting the successful response for REST API invocation of operation.
Thanks in advance.


--
Mit freundlichen Grüßen / Kind regards

Nayabrasul Shaik

Research associate
Service Robotics Research Center
University of Applied Sciences Ulm
Prittwitzstrasse 10
89075 Ulm
Germany
Telefon: +49 (0731) 50-28148
E-Mail:
nayabrasul.shaik@xxxxxx

 


Back to the top