IOperationServiceCallExternalOperationTRequest, TResponse Method (Int32, String, String, TRequest, ITerminal, SerializationBinder, ISurrogateSelector) |
Calls an operation which is implemented in another plugin.
Namespace:
Resto.Front.Api
Assembly:
Resto.Front.Api.V8 (in Resto.Front.Api.V8.dll)
Syntax TResponse CallExternalOperation<TRequest, TResponse>(
int pluginModuleId,
string serviceName,
string operationName,
TRequest request,
ITerminal terminal = null,
SerializationBinder binder = null,
ISurrogateSelector surrogateSelector = null
)
Parameters
- pluginModuleId
- Type: SystemInt32
Licensable module identifier of the plugin to be called. That module id have to be pre-shared with consumer plugins.
- serviceName
- Type: SystemString
Name of the external service which is implemented in another plugin. That name have to be pre-shared with consumer plugins.
- operationName
- Type: SystemString
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, SerializationBinder, ISurrogateSelector). That name have to be pre-shared between producer and consumer plugins.
- request
- Type: TRequest
The data which will be transferred as an incoming argument into the external operation.
- terminal (Optional)
- Type: Resto.Front.Api.Data.OrganizationITerminal
Terminal for executing the external operation remotely. Leave it null to execute the operation on the local terminal.
- binder (Optional)
- Type: System.Runtime.SerializationSerializationBinder
A serialization binder for custom mapping between types and names. Default is null. - surrogateSelector (Optional)
- Type: System.Runtime.SerializationISurrogateSelector
The ISurrogateSelector to use for serialization. Default is null.
Type Parameters
- TRequest
- TResponse
Return Value
Type:
TResponse
Response returned by the producer plugin.
Exceptions 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
RegisterExternalOperationTRequest, TResponse(String, String, FuncValueTupleTRequest, String, Int32, Guid, TResponse, SerializationBinder, ISurrogateSelector) and consumer plugin call it using
CallExternalOperationTRequest, TResponse(Int32, String, String, TRequest, ITerminal, SerializationBinder, ISurrogateSelector).
See Also