10 Replies Latest reply: Mar 2, 2016 2:12 AM by Hardik Patel RSS

    Service key is missing

      Hello all,

       

      I have created a task in publisher and set a trigger for EDX execution.

       

      Now I have created a web application to trigger this task using qlikview 11 EDX.

       

      But am getting error as

      "

      Service key is missing

      "

       

      at the below line:

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

        • Re: Service key is missing
          Magnus Lovsten

          You probably haven't called the GetTimeLimitedServiceKey properly.

           

          Check this thread for useful info: Re: EDX Triggers Not Working Since 11 Upgrade

            • Re: Service key is missing

              ya have called GetTimeLimitedServiceKey and getting a key returned also.

               

              But when it executes the line

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

               

              it throws an error..

                • Re: Service key is missing
                  Magnus Lovsten

                  The error normally occur when you do not have the key in the header of the API call.

                  Can you please share your code where you assign the ServiceKey to the Endpoint?

                    • Re: Service key is missing

                      Hello Magnus,

                       

                      Below is the function user to set the servicekey and trigger the EDX task.

                       

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

                              {

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

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

                                  string key = Client.GetTimeLimitedServiceKey();

                                 

                                 

                                  ServiceKeyClientMessageInspector.ServiceKey = key;

                                  lbl.Text = ServiceKeyClientMessageInspector.ServiceKey;

                                  ////Trigger the task

                                 

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

                       

                                 

                              }

                       

                      I had added a label on the web page to check if the service key is generated or not.

                      after doing so, yes service key is getting generated and shown in the label.

                       

                      But then get error at the below line:

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

                       

                      checked the error log in browser and below is the error in detail:

                      <!--

                      [FaultException]: Service key is missing

                       

                      Server stack trace:

                         at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)

                         at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

                         at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

                         at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

                       

                      Exception rethrown at [0]:

                         at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

                         at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

                         at EDXfromWebPage.QMSBackendService.IQMS.TriggerEDXTask(Guid qdsID, String taskNameOrID, String password, String variableName, String[] variableValues)

                         at EDXfromWebPage.QMSBackendService.QMSClient.TriggerEDXTask(Guid qdsID, String taskNameOrID, String password, String variableName, String[] variableValues)

                         at Portals.Admin_ManagePublisherTasks.reloadviaEDX(String Taskname, String Taskpassword, String QMSURL) in c:\inetpub\vhosts\safalweb\Admin\ManagePublisherTasks.aspx.cs:line 55

                         at Portals.Admin_ManagePublisherTasks.lnkStart_Click(Object sender, EventArgs e) in c:\inetpub\vhosts\safalweb\Admin\ManagePublisherTasks.aspx.cs:line 41

                         at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)

                         at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

                      [HttpUnhandledException]: Exception of type &#39;System.Web.HttpUnhandledException&#39; was thrown.

                         at System.Web.UI.Page.HandleError(Exception e)

                         at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

                         at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

                         at System.Web.UI.Page.ProcessRequest()

                         at System.Web.UI.Page.ProcessRequest(HttpContext context)

                         at ASP.admin_managepublishertasks_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\eb56a966\5587d34b\App_Web_managepublishertasks.aspx.fdf7a39c.jzf9udaz.0.cs:line 0

                         at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

                         at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

                      -->

                • Re: Service key is missing
                  Magnus Lovsten

                  Looks ok pending you have not touched the underlying ServiceKeyClientMessageInspector.

                  I suggest you use WireShark to verify the message truely has the header "X-Service-Key" set correctly.

                   

                  Another thing I noticed it that you should get the correct Distribution Service ID rather than using new Guid(). Retrieve this using GetServices. And if you don't use variables send in Null. Like this:

                   

                  List<ServiceInfo> qdsServices = Client.GetServices(ServiceTypes.QlikViewDistributionService);

                  Client.TriggerEDXTask(qdsServices[0].ID, Taskname, Taskpassword, "", null);

                   

                  Hope this helps.

                    • Re: Service key is missing

                      Now getting "service key is missing" error at below line:

                      List<ServiceInfo> qdsServices = Client.GetServices(ServiceTypes.QlikViewDistributionService);

                       

                      am actually unable to debug the issue, because it does not run on my local machine.

                      so have to make changes, upload on server and then verify.

                       

                      you asked me to use wireshark... please can tell what exactly do you mean by this?

                        • Re: Service key is missing
                          Magnus Lovsten

                          This makes sense. Service key is checked at almost every call to the Management Service. It indicates that the service key is not passed in to the API as expected. And it is in fact missing (if it would be incorrect you would see another error message). Either the header name is incorrect or something is filtering out the header data in your environment.

                           

                          Wireshark is a tool which you can use to listen to the network traffic and see the messages/headers. If you have other tools you prefer please use the one of your choise. Maybe you can contact your IT staff and they can assist you.

                           

                          Looking forward to hear the root issue of all this.  

                      • Re: Service key is missing
                        Hardik Patel

                        Make sure you have added below highlighted line in bold in your config file.

                         

                        <client>

                              <endpoint address="http://<servername>:4799/QMS/Service" binding="basicHttpBinding"

                                bindingConfiguration="BasicHttpBinding_IQMS" contract="QMSBackendService.IQMS"

                                name="BasicHttpBinding_IQMS" behaviorConfiguration="ServiceKeyEndpointBehavior" />

                              <endpoint address="http://<servername>:4799/ANY/Service" binding="basicHttpBinding"

                                bindingConfiguration="BasicHttpBinding_IQTService" contract="QMSBackendService.IQTService"

                                name="BasicHttpBinding_IQTService" behaviorConfiguration="ServiceKeyEndpointBehavior" />

                            </client>

                         

                        This solved this problem for me.