Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I went through the Qlik.Net Document links based on which I have rendered the code as mentioned below but on Execution Iam able to create an app but Iam failing to create the rest data source with invalid parameters error:
A)CODE FOR CONNECTING TO QLIKSENSE SERVER:
static void Main(string[] args)
{
var uri = new Uri("https://server.domain.com");
ILocation location = SetupConnection(uri);
RestDataSourceCreation(location);
}
private static ILocation SetupConnection(Uri uri)
{
ILocation location = Qlik.Engine.Location.FromUri(uri);
location.AsNtlmUserViaProxy(proxyUsesSsl: true);
return location;
}
---------------------------------------------------------------------------
B)CODE FOR CREATING APP AND CONFIGURING REST DATA SOURCE
private static void RestDataSourceCreation(ILocation location)
{
try
{
using (IHub hub = location.Hub(noVersionCheck: true))
{
string timeStamp = GetTimeStamp(DateTime.Now);
IAppIdentifier newAppIdentifier = location.CreateAppWithName("TestURLDataSourceAPP" + timeStamp);
string qName = "restConnection";
string qType = "QvRestConnector.exe";
string qConnectionString = "CUSTOM CONNECT TO" + " \\\"provider" + "=" + "QvRestConnector.exe" + ";" + "url" + "=" + "http://dummy.restapiexample.com/api/v1/employees;timeout=30;method=GET;httpProtocol=1.1;isKeepAlive=..."";
using (var app = location.App(newAppIdentifier))
{
var connection = new Connection { Name = qName, ConnectionString = qConnectionString.Trim(), Type = qType };
app.CreateConnection(connection);
}
}
}
In the above code iam not sure how to specify the connection string accurately:
1)Should we specify CONNECT TO & PROVIDER details ?
2)can you kindly suggest on how to specify the URL data source with required properties in the connection string parameter