Create connection
Opens a gRPC connection
- Parameters
- Advanced call ?
Function CreateConnection(Val Parameters, Val Tls = Undefined, Val Logging = Undefined) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Parameters | - | String | ✔ | Connection parameters. See GetConnectionParameters |
| Tls | - | Structure Of KeyAndValue | ✖ | TLS settings, if necessary. See GetTlsSettings |
| Logging | - | Structure Of KeyAndValue | ✖ | Logging settings. See GetLoggingSettings |
Returns
Arbitrary - Client object or map with error information
| Parameter | Description |
|---|---|
| addin_mode | Manual selection of external component connection mode (for 1C): Isolated, NotIsolated |
Caution
NOCLI: this method is not available in CLI version
1C:Enterprise/OneScript code example
Address = "https://grpcb.in:9001";
Proto1 = "https://hut.openintegrations.dev/test_data/grpcbin_with_import.proto"; // String, path to file or URL
Proto2 = "https://hut.openintegrations.dev/test_data/mt.proto"; // String, path to file or URL
Scheme = New Map;
Scheme.Insert("main.proto" , Proto1); // Primary
Scheme.Insert("my_types.proto", Proto2); // For import in primary
Meta = New Structure("somekey", "somevalue");
Parameters = OPI_GRPC.GetConnectionParameters(Address, Scheme, Meta);
Tls = OPI_GRPC.GetTlsSettings(True);
Result = OPI_GRPC.CreateConnection(Parameters, Tls);
Result
"AddIn.OPI_GRPC.Main"