The service enables you to add a new Remote Database connection.
The return value of the operation is the new connection id.
Parameters:
The operation excepts and ExternalConnection object with the following properties required:
-
String ConnectionString
The connection string to the remote database.
-
String ConnectionName
The display name of the new connection.
-
int DbType
The type of the remote database.
* At the moment only SQL Server is supported and this value must be set to 1.
Java Code:
//get a reference to the service InwiseWebServices ws = new InwiseWebServices();
InwiseWebServicesSoap inwiseWebServicesSoap = ws.getInwiseWebServicesSoap();
//fill the security header
HeaderHandler hh = new HeaderHandler("myusername", "myPassword");
hh.setHeader(inwiseWebServicesSoap);
//create a new instance of ExternalConnection
inwise.ExternalConnection ec = new inwise.ExternalConnection();
//the connection string property
ec.setConnectionString("server=192.168.12.1;Database=dbName;User ID=username;Password=password;Trusted_Connection=False");
//the type of the remote database
ec.setDbType(1);
//the name for the new database connection
ec.setConnectionName("connection 1");
//call the operation
int newConnectionID = inwiseWebServicesSoap.groupsExternalAddNewDBConnection(ec);
C# Code:
//get a reference to the service
InwiseWebServices.InwiseWebServices ws = new InwiseWebServices.InwiseWebServices();
//fill the security header
InwiseWebServices.SecHeader header = new InwiseWebServices.SecHeader();
header.username = "username";
header.pass = "myPassword";
ws.SecHeaderValue = header;//set credentials
//create a new instance of ExternalConnection
InwiseWebServices.ExternalConnection ec = new InwiseWebServices.ExternalConnection();
//the connection string property
ec.ConnectionString = "server=192.168.12.1;Database=dbName;User ID=username;Password=password;Trusted_Connection=False";
//the type of the remote database
ec.DbType = 1;
//the name for the new database connection
ec.ConnectionName = "connection 1";
//call the operation
int newConnectionID = ws.Groups_External_AddNewDBConnection(ec);
VB Code:
'get a reference to the service
Dim ws As InwiseWebServices.InwiseWebServices = New InwiseWebServices.InwiseWebServices()
'fill the security header
Dim header As InwiseWebServices.SecHeader = New InwiseWebServices.SecHeader()
header.username = "username"
header.pass = "myPassword"
ws.SecHeaderValue = header 'set credentials
'create a new instance of ExternalConnection
Dim ec As InwiseWebServices.ExternalConnection = New InwiseWebServices.ExternalConnection()
'the connection string property
ec.ConnectionString = "Server=192.168.12.1;Database=dbName;User ID=username;Password=password;Trusted_Connection=False"
'the type of the remote database
ec.DbType = 1
'the name for the new database connection
ec.ConnectionName = "connection 1"
'call the operation
Dim NewConnectionID As Integer = ws.Groups_External_AddNewDBConnection(ec)