Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
"
"
at the below line:
Client.TriggerEDXTask(new Guid(), Taskname, Taskpassword, "", new string[0]);
You probably haven't called the GetTimeLimitedServiceKey properly.
Check this thread for useful info: Re: EDX Triggers Not Working Since 11 Upgrade
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..
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?
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 'System.Web.HttpUnhandledException' 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)
-->
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.
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?
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.
Hello Magnus,
I have windows exe for the same feature and which is working fine on the same server.
But when I use the web application it is not working.
Actually I tried to give a call to the same exe through web page but on button click from the web page, nothing happens.
how to check if the header name is incorrect?
I do believe you need to check the network traffic like I indicated before.