-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for opc-twin module api direct method calls with input arguments (not requiring OPC Twin micro services) #1512
Comments
|
@DidierDrogba2, can you check if calling this method works when using the engineering tool UI? Everything you did seem to be fine. So maybe you want to double check if the nodesId (method&object) are correct and the method's attributes have the datatypes, order and count as expected by the server. If you can confirm that, we will have to validate if indeed this is a regression. |
I just checked and i definitely used the correct nodeId and attributes. But I got this issue with every method of my opc server(if the method gets one or more input arguments). I changed the method itself temporary so that no input arguments are required. You can see the response below (The same node I used before): The engineering tool works too. |
In case it is relevant: I'm also working on invoking methods on an OPC UA server using OPC Twin, and I got it to work both with a command without arguments, and one with a simple string argument. However, I'm going through the ImmutableList<JsonElement> argumentList = ...;
new MethodCallRequestApiModel()
{
MethodId = "ns=1;s=setLanguageMethod",
ObjectId = "ns=1;s=Foo:Bar:System:Language",
Arguments = argumentList.Select(x => new MethodCallArgumentApiModel() { DataType = "String", Value = jsonElementToVariantValueConverter.Convert(x) }).ToList(),
} (The If I serialize the above object, I get something like this: {
"MethodId": "ns=1;s=setLanguageMethod",
"ObjectId": "ns=1;s=Foo:Bar:System:Language",
"Arguments": [
{
"Value": {
"PropertyNames": [],
"Value": "english",
"Values": [],
"Count": 0,
"IsListOfValues": false,
"IsArray": false,
"IsObject": false,
"IsDecimal": false,
"IsInteger": false,
"IsInt64": false,
"IsUInt64": false,
"IsDouble": false,
"IsFloat": false,
"IsTimeSpan": false,
"IsDateTime": false,
"IsGuid": false,
"IsBoolean": false,
"IsString": true,
"IsBytes": false
},
"DataType": "String"
}
],
"MethodBrowsePath": null,
"ObjectBrowsePath": null,
"Header": null
} This probably happens because the Not sure if that helps in any way, but I hope it does. |
@NoTuxNoBux are you using the OPC Twin module standalone? Usage in context of Industrial-IoT is only tested as part of the end-to-end use via the REST API as pointed out in our documentation: We have no plans to enable use of Industrial-IoT OPC Twin standalone functionality, but will offer a subset of its functionality as part of another product. |
Partially, yes, mainly the API client library without the microservice, and I seem to have completely missed that information, thanks. Right now since we have an Azure Function that needs to talk to the Twin, and the additional microservice seemed an unnecessary cost as it wraps the API client we could instantiate ourselves in a couple of lines, but we can still rather easily insert it as intermediary if it becomes problematic later on. |
# Changes introduced: - New Namespaces for all projects and simplified code structure. There are now 2 SDK projects, one for the OPC Publisher module, and another for the optional cloud WebAPI companion service. - Ability to run platform (modules, services) "standalone" on the edge #464 - [OPC Discovery] has been included into the OPC Publisher module, the container name must be updated to refer to OPC Publisher. - [OPC Discovery] A new synchronous FindServer API has been added to allow discovery by discovery url through a single API call. - [OPC Twin] has been included into the OPC Publisher module, the container name must be updated to refer to OPC Publisher. - [OPC Twin] we removed the Activate and Deactivate calls. - [OPC Twin] OPC TWIN Method call #996 - Support for opc-twin module api direct method calls with input arguments (not requiring OPC Twin micro services) #1512 - Support for a new TestConnection API to test a connection to a server and receiving detailed error information back. - [OPC Publisher] (breaking change) The publisher id in each message is now always the same value across all writer groups rather than previously where a random guid was used per writer group when a publisher id was not configured. - [OPC Publisher] Several bug fixes for preview 1 (#1964) - [OPC Publisher] DatasetMessage SequenceNumber is now correctly incremented (preview) (#1961) - [OPC Publisher] Enabling using DisplayNames defined for the event fields in pn.json as keys in the payload of dataset messages (#1963) - [OPC Publisher] Request opc server's nodes information #1960 - [OPC Publisher] dotnet publish can be used to build a docker container for OPC Publisher #1949 - [OPC Publisher] Metrics output and log output showing number of sessions currently active (related to #1923) - [OPC Publisher] Added new OPC UA stack which addressess #1937 and latest CVE's - [All micro services] Have been combined into a single WebAPI with the same resource paths as the 2.8 AKS deployment and all-in-one service. - [OPC Registry service] Supervisor, Discoverer entities have been removed, but the API has been layered on top of the publisher entity for backwards compatibiltiy. Do not use these API's anymore. - [OPC Registry service] A new RegisterEndpoint API has been added that calls the new sync FindServer API and adds the result into the registry in one call. - [Telemetry processor] The telemetry and onboarding processors have been integrated into the WebAPI, but only forwards to SignalR. The secondary event hub has been removed. If you need to post process telemetry you must read telemetry data directly from IoT Hub. - Document the diagnostics output and troubleshooting guide #1952 # Stats: * Consolidated down to 1 edge module and 1 optional cloud companion web app. * Maintained 99% of API and even added new capabilities/functionality such as Event and MQTT broker support. * Reduced LOC for shipped binaries by 53% from to 641844 in 2.8.6 to 297144 in 2.9.0 preview 2 * Increased Test coverage (blocks) by around 50% from 51.34% to 76.36%
Release 2.9.0 preview 2 of OPC Publisher was just released. It supports the OPC Twin API which can be invoked without cloud services. Documentation will be provided soon. Regarding variant value: The variant value is just an object (it is similar to JObject or JDocument, but supports msgpack also), it can be any valid json in the payload in and out that conforms to the encoding rules for JSON in Part 6 of the OPC UA spec. |
Hi, want to call some opcua-methods with the opc-twin restapi. The restapi and the authentication worked just fine for me, but every time I want to call a method with some arguments I get the same error. Methods which dont take any parameters work fine.
Example Request body (using postman):
![Screenshot 2021-12-22 161134](https://user-images.githubusercontent.com/96531996/147113885-7f9c66a8-49cb-48c6-bb70-b8cda050a6a9.png)
Example Response:
![Screenshot 2021-12-22 161331](https://user-images.githubusercontent.com/96531996/147114124-23ba22c1-c4d1-4b46-abf1-8ba885516fc1.png)
Also if run the method with no argument the request will get to the server (and will fail there):
![Screenshot 2021-12-22 161645](https://user-images.githubusercontent.com/96531996/147114568-40b17e78-9941-48f3-9829-850d5f30b6fa.png)
The api documentation says that the parameter arguments exprects an < MethodCallArgumentApiModel > array which contains the
keys dataType and value. All of these are optional.
The text was updated successfully, but these errors were encountered: