Welcome Guest, you are in: Login

QVSource: The QlikView & Qlik Sense API Connector (Docs)

The following end point added allows you to check that QVSource is up and running by making a request to:
http://localhost:5555/QVSource?format=xml

Note that a html human readable version of this page can be found at:
http://localhost:5555/QVSource

Both the above assume that you have not changed the default port number.

This should return something like the following:

Image

Which you can then load as the first step in your QlikView or Qlik Sense application, performing steps such as:
  • Ensuring QVSource is up and running at all.
  • Ensuring QVSource is licensed and any specific non beta Connectors you are using are licensed.
  • Ensuring that the correct version of QVSource (or individual connectors) are present.

If any of these steps fail, you can exit your QlikView or Qlik Sense script, perhaps utilising the Notification Connector to send an email (which could be converted to a Tweet or SMS message using a number of online services) to the relevant person to look into the issue.

NOTE: That this endpoint may be different for QVSource Web Edition (although you should be always be able to access it from the local machine where QVSource is running from the above URL. If you are trying to access it from another machine the URL will look something like:

http://MACHINE_NAME:5555/QVSource?format=xml&loadAccessToken=XXXXXXX

Or

http://MACHINE_NAME:5555/QVSource?loadAccessToken=XXXXXXX

Where XXXXXXX is your personal load access token which you can find on the 'My Settings' tab in the Web UI.

Sample Script

The following sample script shows how we could use this end point to check QVSource is up and running before proceeding to load the rest of the application.



sub CheckQVSourceStatus

	set errormode = 0;
	
	QVSourceStatus:
	LOAD Version,
		SubField(Version, '.', 1) as Version_Major,
		SubField(Version, '.', 2) as Version_Minor,
		SubField(Version, '.', 3) as Version_Build,
		SubField(Version, '.', 4) as Version_Revision,
		ServerMode,
		Path,
		Licensed,
		LicenceExpires,
		IsLicensedAsServer
	FROM [http://localhost:5555/QVSource?format=xml] (XmlSimple, Table is [QVSource]);
         
	if(ScriptError <> '') then   
		//
		// Looks like QVSOurce is not even running.
		//
		// Log message here or send email using QVSource Notifier Connector
		//
		trace 'QVSource is not running or not running on the requested port number.';
		exit script;
	endif     
     
	if(peek('Licensed', 0, 'QVSourceStatus') <> 'true') then
		//
		// QVSource is running but not licensed.
		//
		// Log message here or send email using QVSource Notifier Connector
		//
		trace 'QVSource is running but not licensed.';
		exit script;
	endif

	if(peek('ServerMode', 0, 'QVSourceStatus') = 'true' and peek('IsLicensedAsServer', 0, 'QVSourceStatus') = 'false') then
		//
		// QVSource is running but not licensed to run in server mode.
		//
		// Log message here or send email using QVSource Notifier Connector
		//
		trace 'QVSource is running but not licensed to run in server mode.';
		exit script;
	endif     
    
	let currentVersionAsInt = (peek('Version_Major', 0, 'QVSourceStatus') * 1000) + (peek('Version_Minor', 0, 'QVSourceStatus') * 100) + (peek('Version_Build', 0, 'QVSourceStatus') * 10) + peek('Version_Revision', 0, 'QVSourceStatus');

	// Let's pretend we need QVSource 1.4.2.6 or later....	
	if(currentVersionAsInt < 1426) then
		// Log message here or send email using QVSource Notifier Connector
		trace 'Version too low. Please update QVSource.';
		exit script;
	endif
	
	QVSourceConnectorStatus:
	LOAD Name as ConnectorName,
	    Version as ConnectorVersion,
	    Licensed as ConnectorLicensed
	FROM [http://localhost:5555/QVSource?format=xml] (XmlSimple, Table is [QVSource/Connectors/Connector]);
	
	//
	// Run other QVSource or connector specific tests here before deciding whether
	// to proceed and load the rest of the application.
	//
	
	set errormode = 1;

endsub

call CheckQVSourceStatus;
  Name Size
- qvsource status xml.png 34.10 KB
- QVSource Status.png 45.94 KB


(QVSource works with Qlik Sense as well as QlikView - See this page for notes.)
QVSource - The QlikView & Qlik Sense API Connector | © Copyright 2011 - 2016 Industrial CodeBox Ltd