iikoFront Api V7Preview7 Code Reference
iikoFront Api V7Preview7 Code Reference
Resto.Front.Api
IOperationService Interface
IOperationService Methods
CallExternalOperation Method
CallExternalOperation Method (Int32, String, String, Byte[], ITerminal)
CallExternalOperation(TRequest, TResponse) Method (Int32, String, String, TRequest, ITerminal, SerializationBinder, ISurrogateSelector)

# IOperationService CallExternalOperation Method (Int32, String, String, Byte , ITerminal)

Calls an operation which is implemented in another plugin.

Namespace: Resto.Front.Api
Assembly: Resto.Front.Api.V7Preview7 (in Resto.Front.Api.V7Preview7.dll) Version: 1ca4876affdd3bc5359a98b321fc115a647d2251
Syntax
C#
Copy

    byte[] CallExternalOperation(
    	int pluginModuleId,
    	string serviceName,
    	string operationName,
    	byte[] request,
    	ITerminal terminal = null
    )

#### Parameters

pluginModuleId
  Type: System
  Int32
  Licensable module identifier of the plugin to be called. That module id have to be pre-shared with consumer plugins.
serviceName
  Type: System
  String
  Name of the external service which is implemented in another plugin. That name have to be pre-shared with consumer plugins.
operationName
  Type: System
  String
  Name of the external operation which is implemented in another plugin and have been registered using RegisterExternalOperation(String, String, Func
  ValueTuple
  Byte
  , String, Int32, Guid
  ,
  Byte
  ). That name have to be pre-shared between producer and consumer plugins.
request
  Type:
  System
  Byte
  The data which will be transferred as an incoming argument into the external operation.
terminal (Optional)
  Type: Resto.Front.Api.Data.Organization
  ITerminal
  Terminal for executing the external operation remotely. Leave it null to execute the operation on the local terminal.

#### Return Value

Type:
Byte
Response returned by the producer plugin.
Exceptions

Exception | Condition
--- | ---
ExternalOperationCallingException | When an external operation calling or execution throws any kind of exception, caller receives the ExternalOperationCallingException with original message and reason. Orignal stacktrace can be found in api.log.

Remarks
Different plugins running under the same iikoFront application instance can communicate via external operations. iikoFront 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 RegisterExternalOperation(String, String, Func
ValueTuple
Byte
, String, Int32, Guid
,
Byte
) and consumer plugin call it using CallExternalOperation(Int32, String, String,
Byte
, ITerminal).
See Also

#### Reference

IOperationService Interface
CallExternalOperation Overload
Resto.Front.Api Namespace
IOperationService
RegisterExternalOperation(String, String, Func
ValueTuple
Byte
, String, Int32, Guid
,
Byte
)