IOperationServiceCallExternalOperationTRequest, TResponse(Int32, String, String, TRequest, ITerminal, IReadOnlyCollectionType) Method |
Calls an operation which is implemented in another plugin.
Namespace: Resto.Front.ApiAssembly: Resto.Front.Api.V10 (in Resto.Front.Api.V10.dll)
SyntaxTResponse CallExternalOperation<TRequest, TResponse>(
int pluginModuleId,
string serviceName,
string operationName,
TRequest request,
ITerminal terminal = null,
IReadOnlyCollection<Type> knownTypes = null
)
Parameters
- pluginModuleId Int32
-
Licensable module identifier of the plugin to be called. That module id have to be pre-shared with consumer plugins.
- serviceName String
-
Name of the external service which is implemented in another plugin. That name have to be pre-shared with consumer plugins.
- operationName String
-
Name of the external operation which is implemented in another plugin and have been registered using RegisterExternalOperationTRequest, TResponse(String, String, FuncValueTupleTRequest, String, Int32, Guid, TResponse, IReadOnlyCollectionType). That name have to be pre-shared between producer and consumer plugins.
- request TRequest
-
The data which will be transferred as an incoming argument into the external operation.
- terminal ITerminal (Optional)
-
Terminal for executing the external operation remotely. Leave it null to execute the operation on the local terminal.
- knownTypes IReadOnlyCollectionType (Optional)
- A list of types to be recognized by serializer for polymorphic serialization. Default is null.
Type Parameters
- TRequest
- TResponse
Return Value
TResponse
Response returned by the producer plugin.
Exceptions
Remarks
Different plugins running under the same Syrve POS application instance can communicate via external operations. Syrve POS just transfers requests and responses between plugins without knowing any details. Both producer and consumer plugins should understand the data structure, developers should negotiate a protocol specification, pre-share operation names, handle versioning and so on. Producer plugin registers an operation using
RegisterExternalOperationTRequest, TResponse(String, String, FuncValueTupleTRequest, String, Int32, Guid, TResponse, IReadOnlyCollectionType) and consumer plugin call it using
CallExternalOperationTRequest, TResponse(Int32, String, String, TRequest, ITerminal, IReadOnlyCollectionType).
See Also