2 Replies Latest reply: Jul 3, 2015 12:05 PM by Nitasha Chopra RSS

    EDX Reload -

      Hi,

       

      I am new to Qlikview and from few days had been readling posts to use EDX reload Functionality.

       

      This is the latest post that I have read. I even downloaded the CommandLIne & project from the link but I am not sure how things will link together. The post is very helpful.

      Using EDX in QlikView 11

       

      What I understand is that as soon as the button is clicked on .NET Application , a task is triggered that will relaod the document and the published folder on server refreshes.

      How does the application know which document to reload and where on server?

      The application compiles well but does nothing.

       

       

      My WebCOnfig:

      <?xml version="1.0"?>

      <configuration>

       

        <system.web>

          <identity impersonate="true"/>

          <compilation debug="true"/>

        </system.web>

       

       

       

        <appSettings>

          <add key="QMSAPIURL" value="http://localhost:4780/qmc/Default.htm"/>

          <add key="Taskname" value="Reload of EDX Test.qvw"/>

          <add key="TaskPassword" value="edxtest"/>

        </appSettings>

       

        <system.serviceModel>

          <!-- Added for QMS API  -->

          <extensions>

            <behaviorExtensions>

              <add name="serviceKeyBehavior" type="EDXfromWebPage.ServiceSupport.ServiceKeyBehaviorExtensionElement, EDXfromWebPage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>

            </behaviorExtensions>

          </extensions>

          <behaviors>

            <endpointBehaviors>

              <behavior name="ServiceKeyEndpointBehavior">

                <serviceKeyBehavior/>

              </behavior>

            </endpointBehaviors>

          </behaviors>

          <!--  END Added for QMS API -->

          <bindings>

            <basicHttpBinding>

              <binding name="BasicHttpBinding_IQMS" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">

                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>

                <security mode="TransportCredentialOnly">

                  <transport clientCredentialType="Ntlm" proxyCredentialType="None" realm=""/>

                  <message clientCredentialType="UserName" algorithmSuite="Default"/>

                </security>

              </binding>

              <binding name="BasicHttpBinding_IQTService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">

                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>

                <security mode="TransportCredentialOnly">

                  <transport clientCredentialType="Ntlm" proxyCredentialType="None" realm=""/>

                  <message clientCredentialType="UserName" algorithmSuite="Default"/>

                </security>

              </binding>

            </basicHttpBinding>

          </bindings>

          <client>

            <endpoint address="http://localhost:4780/qmc/Default.htm" binding="basicHttpBinding" behaviorConfiguration="ServiceKeyEndpointBehavior" bindingConfiguration="BasicHttpBinding_IQMS" contract="QMSBackendService.IQMS" name="BasicHttpBinding_IQMS"/>

            <endpoint address="http://localhost:4780/qmc/Default.htm" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IQTService" contract="QMSBackendService.IQTService" behaviorConfiguration="ServiceKeyEndpointBehavior" name="BasicHttpBinding_IQTService"/>

          </client>

        </system.serviceModel>

       

       

      </configuration>

      Foll is my default page:

      using EDXfromWebPage.ServiceSupport;

      using EDXfromWebPage.QMSBackendService;

       

       

       

       

       

       

      //Basic example of how to start a QlikView Task using EDX

      namespace EDXfromWebPage

      {

          public partial class _Default : System.Web.UI.Page

          {

       

       

              QMSClient Client;

       

       

              // For this example we will pick up some settings from web.config for the QMS URL, the name of task in QV and its password

              // Of course you need to create the QV reload task with an EDX trigger first.

              // Edit web.config for your needs

       

       

              string QMSURL = ConfigurationManager.AppSettings["QMSAPIURL"];

              string Taskname = ConfigurationManager.AppSettings["Taskname"];

              string Taskpassword = ConfigurationManager.AppSettings["Taskpassword"];

       

       

       

       

              protected void Page_Load(object sender, EventArgs e)

              {

                  // When the page loads we will just display a link for the user to click on.

       

       

                  // To start an EDX task users need to be either a QV Administrator OR be in a group called QlikView EDX

                  // When you run a web page it may not run as the end user, but as the Web Servers identity instead

                  // This example uses impersonation so that the end users identity is used to start the task but many other approaches could be used

       

       

                  lnkStart.Text = "Start Task:  " + Taskname;

              }

       

       

       

       

              void reloadviaEDX(string Taskname, string Taskpassword, string QMSURL)

              {

                  // First of all connect to the QMS service and handle the service key

                  try

                  {

                      Client = new QMSClient("BasicHttpBinding_IQMS", QMSURL);

                      string key = Client.GetTimeLimitedServiceKey();

                      ServiceKeyClientMessageInspector.ServiceKey =

       

       

                      //Trigger the task

                      Client.TriggerEDXTask(new Guid("00000000-0000-0000-0000-000000000000"), Taskname, Taskpassword, "", new string[0]);

                  }

                  catch (System.IO.IOException e)

                  {

                      Console.WriteLine("Error reading from {0}. Message = {1}", e.Message);

       

       

       

       

                  }

       

       

                  finally

                  {

                      Console.WriteLine("Error reading from {0}. Message = {1}");

                  }

              }

       

       

              protected void lnkStart_Click(object sender, EventArgs e)

              {

                  reloadviaEDX(Taskname, Taskpassword, QMSURL);

              }

          }

      }

        • Re: EDX Reload -
          Peter Cammaert

          The application won't ever need to know what document to reload because that is not what the application intends to do... The application will trigger the start of a Task that should already be defined in QMC with trigger type "On an external event", and the Task will reload the document.

           

          How to tell the application what task to trigger? Look at this part of the block of code you posted:

           

            <appSettings>

              <add key="QMSAPIURL" value="http://localhost:4780/qmc/Default.htm"/>

              <add key="Taskname" value="Reload of EDX Test.qvw"/>

              <add key="TaskPassword" value="edxtest"/>

            </appSettings>

           

          The first key specifies which QlikView Server to contact. Replace the dummy url with a real URL of your QlikView server. This can be as simple as replacing localhost with your Windows server name.

           

          The second key specifies the name of the target task to trigger. This is the either the Task name itself as defined in the QMC (if you have a publisher) or a special task name with the target document (if you don't have a Publisher).

           

          The third key specifies the (optional) password that may be required to trigger this task. If in QMC you entered a password when you defined the task with trigger "On an external event", then repeat the value in this key. Otherwise you will not be permitted to start the task as you password-protected it.

           

          Best,

           

          Peter

            • Re: EDX Reload -

              Hi Peter,

               

              Thank you so much for your reply.

               

              I got that working eventually and the last line of your post was a Bulls Eye.

               

              he most important thing that I didnt read on any of the posts is that on the Qlikview Task, there has to be a trigger and that trigger should have a password. The Taskpassword that we pass in our .NET Application is this password, given in the trigger.

               

              There are two parts:

                   .NET Application - Calls the Task with TriggerEDX Function

                   Qlikview Console - Where the Task is listed and you put a Trigger on it with password

               

              Points to remember:

                 1)       You have to be part of either of the two Qlikview Groups - QlikView Administrators or QlikView EDX groups

                 2)       In WebConfig of .NET Application : Dont miss this line

                       <serviceKeyBehavior/><!-- this may give Warning, but ignore it-->

                3)      In WebConfig: The TaskName should not have any spaces in the name

                                       The Task Password is the Trigger Password set on Qlikview Console.

               

                     <appSettings>

                              <add key="QMSAPIURL" value="http://localhost:4799/QMS/Service" />

                              <add key="Taskname" value="EDXTest" />

                              <add key="TaskPassword" value="go" />  <!-- for the external Trigger Task password --

                     </appSettings>

               

               

              Here is my complete function which gets called on Button Click:

                                              void reloadviaEDX(string Taskname, string Taskpassword, string QMSURL)

                      {

              // First of all connect to the QMS service and handle the service key

              apiClient = new QMSClient("BasicHttpBinding_IQMS", QMSURL);

              string key = apiClient.GetTimeLimitedServiceKey();

              ServiceKeyClientMessageInspector.ServiceKey = key;

               

              // list of services

              List<ServiceInfo> qdsServices = apiClient.GetServices(ServiceTypes.All).ToList();

               

              // list of tasks

              TaskInfo[] tasks = apiClient.GetTasks(ServiceId);

               

              // Service Id

              //System.Guid ServiceId = qdsServices[0].ID;

              System.Guid ServiceId = new Guid("00000000-0000-0000-0000-000000000000");

               

                     

               

               

                         

                          // command file

              string varName = "";

               

                          // parameters

              string[] parameterList = null;

               

               

              // Trigger the task

              EDXfromWebPage.QMSBackendService.TriggerEDXTaskResult result = apiClient.TriggerEDXTask(ServiceId, Taskname, Taskpassword, varName, parameterList);

               

              EDXStatus executionStatus = null;

               

              // give the Task a chance to complete

              //As the task takes some time to complete we add a sleeptime

              System.Threading.Thread.Sleep(6000);

               

              executionStatus = apiClient.GetEDXTaskStatus(ServiceId, result.ExecId);

               

              if (executionStatus != null)

              txtStatus.Text = executionStatus.TaskStatus.ToString();

              else

              txtStatus.Text = "Failed to get execution status.";

               

              Console.WriteLine("Done");

                      }

               

              My Config File:

               

              <?xml version="1.0"?>

              <configuration>

                     <system.web>

              <identity impersonate="true"/>

              <compilation targetFramework="4.0" debug="true">

              </compilation>

              <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>

              <webServices>

              <protocols>

              <add name="HttpGet"/>

              <add name="HttpPost"/>

              <add name="HttpSoap"/>

              </protocols>

              </webServices>

                     </system.web>

                     <appSettings>

              <add key="QMSAPIURL" value="http://localhost:4799/QMS/Service" />

              <add key="Taskname" value="EDXTest" />

              <add key="TaskPassword" value="go" />  <!-- for the external Trigger Task password -->

                     </appSettings>

                     <system.serviceModel>

              <!-- Added for QMS API  -->

              <extensions>

              <behaviorExtensions>

              <add name="serviceKeyBehavior" type="EDXfromWebPage.ServiceSupport.ServiceKeyBehaviorExtensionElement, EDXfromWebPage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>

              </behaviorExtensions>

              </extensions>

              <behaviors>

                <endpointBehaviors>

              <behavior name="ServiceKeyEndpointBehavior">

              <serviceKeyBehavior/><!-- this may give Warning, but ignore it-->

              </behavior>

              </endpointBehaviors>

              </behaviors>

              <!-- END Added for QMS API -->

              <bindings>

              <basicHttpBinding>

              <binding name="BasicHttpBinding_IQMS" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">

              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>

              <security mode="TransportCredentialOnly">

              <transport clientCredentialType="Ntlm" proxyCredentialType="None" realm=""/>

              <message clientCredentialType="UserName" algorithmSuite="Default"/>

              </security>

              </binding>

              <binding name="BasicHttpBinding_IQTService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">

              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>

              <security mode="TransportCredentialOnly">

              <transport clientCredentialType="Ntlm" proxyCredentialType="None" realm=""/>

              <message clientCredentialType="UserName" algorithmSuite="Default"/>

              </security>

              </binding>

              </basicHttpBinding>

              </bindings>

              <client>

              <endpoint address="http://localhost:4799/QMS/Service" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IQMS" contract="QMSBackendService.IQMS" name="BasicHttpBinding_IQMS" behaviorConfiguration="ServiceKeyEndpointBehavior" />

              </client>

                     </system.serviceModel>

              </configuration>


              The .NET Applciation should have bin folder with DLL , DataSources, Service Reference , Service Suppport and Default page which has a button to call the EDXreload.

               

              You can visit your console from a URL like this and make sure the task name and trigger password are mentioned correctly.

              http://localhost:4780/QMc/Default.htm


              Lastly check the log file of EDXTest (my Task) in Windows Exploer and it should have refreshed as soon as you hit the button on .NET Application.


              Many Thanks ,

              Nitasha Chopra.