Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Remote triggering of QlikView 11 tasks from Java

 Folks, I have been trying to identify if we can remotely trigger tasks in QlikView Publisher using Java. EDX initially appeared to be the way to go, but as per this article: [http://community.qlik.com/docs/DOC-2650], it can only be used with a client written in .NET. I am surprised that a web service cannot be accessible using simple HTTP! According to Rakesh Mehta in http://community.qlik.com/message/186385#186385, the web service should be accessible using any technology, but this appears to be contrary to posts made by Arthur Lee. Could someone please resolve this doubt?                                                       Our system is an automated one where we will need to trigger: 1. Document reloads.  2. File operations such as move/rename/copy, etc.  If EDX cannot be triggered using a non-.NET system, could someone please suggest an approach that will help our requirements?  Thanks!

16 Replies
Not applicable
Author

We are triggering QDS tasks from Java/Scala apps.  For this I have created a simple facade in a .NET web service which I host in IIS on the server hosting the QDS.  The reason for doing this are as follows:

  • encapsulation of QV API from other applications
  • provides ability to implement more flexible and granular security layer. 

I did not even attempt to integrate our Java/Scala apps directly with the QMS API directly for the reasons above - I don't want them having any knowledge about QV specifics (E.g. when I upgrade QV, I just need to update and regression test my facade, and not 100 consuming applications).

I'm not directly answering your question, but if you haven't managed to get the java to QMS API integration working, then perhaps the above approach might work for you, as well as providing some additional benefits.

Cheers,

Graeme

Not applicable
Author

Hi Graeme,

I'm very interested with you're approach.

Kindly give me more detail how did you encapsulate the QV API.

Thanks,

Arnold

Not applicable
Author

Hi Arnold,

There's not much to tell really.  I just created a new .NET web application, and wrote some services to expose the required functionality from the QMS API and implemented our own custom security layer on top of this (e.g. we only allow certain AD groups perform certain actions).   Additionally, we also capture statistics to a database for usage monitoring and audit trail. 

The nice thing about this is that most consuming applications don't need much knowledge about QV specifically, so we just expose very generic methods (E.g. RunTask(taskID)).  If we upgrade QV or change the way it works behind the scenes, as long as we don't change the interface of the facade, none of the consumers need to know about it.

Graeme

Not applicable
Author

Hi Graeme,

I created a web service to wrap the qms api using the sample below code. Unfortunately I'm having a problem on the line highlighted because the code cannot locate QlikviewDistributionService and it returns null.

Have you ever tried to use the QlikviewDistributionService?

//START OF CODE

IQMS apiClient = new QMSClient(); 

//retrieve a time limited service key

ServiceKeyClientMessageInspector.ServiceKey = apiClient.GetTimeLimitedServiceKey();

ServiceInfo serviceInfo = apiClient.GetServices(ServiceTypes.QlikViewDistributionService).FirstOrDefault();

if (serviceInfo != null) { QDSDocumentSessionConfiguration sessionConfig = new QDSDocumentSessionConfiguration();  sessionConfig.QDSID = serviceInfo.ID; sessionConfig.FilePath = @"C:\ProgramData\QlikTech\Documents\FastFood.qvw";  QDSDocumentSession documentSession = apiClient.CreateSession(sessionConfig);  if (documentSession != null && documentSession.OpenDocumentResult == DocumentState.OpenedSuccessfully) { List<Field> fields = apiClient.GetFieldList(documentSession); fields.ForEach(f=>Console.WriteLine(f.Name));  apiClient.CloseSession(documentSession); } else { Console.WriteLine("Failed to open the document."); } }

//END OF CODE

Thanks,

Arnold

Not applicable
Author

Hi Arnold,

I would recommend, as a starting point, that you take a look at the sample code in the QMS API documentation. 

You should be able to find it in C:\Program Files\QlikView\Management Service\QMSAPIDocumentation.chm

If you look in the contents pane, there is a Samples node and within that a Service Key Injection Sample page.  If you follow the steps on that page, you should have everything you need to get up and running.

Regards,

Graeme

Not applicable
Author

Hi,

I don't know if you already solved this but we had the same problem i.e. accessing the API from unmanaged code but a native Windows application. We simply created a .NET assembly that we call from the native application using COM Interop. It was pretty straightforward.

Not applicable
Author

Hi Arnold,

I've got the same problem. Were you ever able to resolve it?

mj