Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I'm trying to set up QV server in DMS mode with ticketing. OS - Windows2008, IIS7.
But when I request the ticket using
I get the following result:
- <result>
<message text="Invalid call" />
</result>
Has anybody experienced the same problem?
Thanks
Y
Awesome. Changing the App Pool in IIS7 for the root site did it! Great tip.
Has anyone managed to get this working for a non admin user using getticketforme or something similar?
Hey @ll,
I'm trying to do the same with my IIS. But I don't know how I can implement this code.
Did anyone solve the issue with IIS, Ticketing and custom user?
Thank you in advance,
olli
use getwebticket instead
HI All,
GetTicket.aspx?admin= Not working................
we are developing an asp.net service that need to be validate QlikeView user.
Can any one sages best approach for that.
My approach not working:
i am used to validate the user by getting tokens form the existing QlikeView service.
But the results always "invalid call" XML.
Asp.net code we using:
private string GetTicket(string username)
{
string qlikviewserver = "http://localhost/qvajaxzfc/GetTicket.aspx?admin=";
string postData = "<Global method=\"GetTicket\"><UserId>" + username + "</UserId></Global>";
byte[] buffer = System.Text.Encoding.ASCII.GetBytes(postData);
System.Net.WebRequest request = System.Net.HttpWebRequest.Create(qlikviewserver);
request.ContentType = "text/xml";
request.Method = "POST";
request.ContentLength = postData.Length;
request.Credentials = new NetworkCredential("Admin UserName", "Password");
System.IO.Stream st = request.GetRequestStream();
st.Write(buffer, 0, buffer.Length);
st.Flush();
st.Close();
WebResponse res = request.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
try
{
doc.LoadXml(sr.ReadToEnd());
if (doc.InnerXml.Length > 0)
{
return doc.InnerXml.ToString();
}
//throw new Exception("Could not get ticket");
}
catch
{
throw new Exception("Could not get ticket, invalid response");
}
return "";
}
Thanks in advance..............................
its because you use getticket.
if you use getwebticket instead you wont get invalid call.. I had the same problem.
Hi,
Thanks for your help.
Now i checked with getwebticket, this also throw me same invalid call.
can you please share the working code if you have....
Thanks in advance.
Thanks,
Jagadesan S
<html>
<head>
</head>
<body>
<form runat="Server" id="MainForm">
<H2>QlikView WebTicket Example</H2>
Username: <asp:TextBox runat="server" id="txtUser">MyTestUser</asp:TextBox> <br />
Password: <asp:TextBox runat="server" id="txtPassword">MyPassword</asp:TextBox> <br />
Groups: <asp:TextBox runat="server" id="txtGroups">Sales,Finance</asp:TextBox> <br />
<asp:Button ID="GO" runat="server" Text="Login..." onclick="GO_Button_Click" />
</form>
</body>
</html>
<script language="c#" runat="server">
//Firsly Set up a few properties
static string QlikViewServerURL = @"http://localhost/QVAJAXZFC/getwebticket.aspx"; //address of the QlikView server
static string ticketinguser = "qvadmin"; //Service account used to ask for a ticket (QV Administrator), this is not the end user
static string ticketingpassword = "qvadmin1234";
static string document = "Sales compass.qvw"; // specify a single QVW or leave blank for access point
protected void GO_Button_Click(object sender, EventArgs e)
{
//Grab the details the user provides
string username = txtUser.Text;
string password = txtPassword.Text;
string groups = txtGroups.Text;
// Test if the user is valid
bool loginOK = ValidateUser(username, password);
//If the user is valid get a ticket and log them in
string ticket = "";
if (loginOK)
{
//Get the Ticket
ticket = getTicket(username, groups, ticketinguser, ticketingpassword); // add groups into the empty string if required
//Build a redirect link to either access point or to a single document
string RedirectLink = "";
if (document.Length > 0)
{//Send to a single document
RedirectLink = "/qvajaxzfc/authenticate.aspx?type=html&try=/qvajaxzfc/opendoc.htm?document=" + document + "&back=/LoginPage.htm&webticket=" + ticket;
}
else
{//Send to a Access Point
RedirectLink = "/qvajaxzfc/authenticate.aspx?type=html&try=/qlikview&back=/LoginPage.htm&webticket=" + ticket;
}
//Redirect the user
Response.Redirect(RedirectLink);
}
}
// This function is a place holder for code to test the user id and password against a database or LDAP
// For the purpose of this example we are not going to test it at all, just return "true" for logged in
// Of course this means anyone would be let in, so this needs to be added
private bool ValidateUser(string User, string pass)
{
//here you would have some logic to test the user id and password against a data base.
return true;
}
// This function is going to take the username and groups and return a web ticket from QV
// User and groups relate to the user you want to reuqest a ticket for
// ticketinguser and password are the credentials used to ask for the ticket and needs to be a QV admin
private string getTicket(string user,string usergroups,string ticketinguser, string ticketingpassword)
{
StringBuilder groups = new StringBuilder();
if (!string.IsNullOrWhiteSpace(usergroups))
{
groups.Append("<GroupList>");
foreach (string group in usergroups.Split(new char[] { ',' }))
{
groups.Append("<string>");
groups.Append(group);
groups.Append("</string>");
}
groups.Append("</GroupList>");
groups.Append("<GroupsIsNames>");
groups.Append("true");
groups.Append("</GroupsIsNames>");
}
string webTicketXml = string.Format("<Global method=\"GetWebTicket\"><UserId>{0}</UserId></Global>", user);
HttpWebRequest client = (HttpWebRequest)WebRequest.Create(new Uri(QlikViewServerURL));
client.PreAuthenticate = true;
client.Method = "POST";
client.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
client.Credentials = new NetworkCredential(ticketinguser,ticketingpassword);
using (StreamWriter sw = new StreamWriter(client.GetRequestStream()))
sw.WriteLine(webTicketXml);
StreamReader sr = new StreamReader(client.GetResponse().GetResponseStream());
string result = sr.ReadToEnd();
XDocument doc = XDocument.Parse(result);
return doc.Root.Element("_retval_").Value;
}
</script>
HI,
Thanks for the instant reply,
i gone through the code, It seems for using getwebticket we have to pass
user group also(one of the parameter).
Is there any other to validate the username alone, he/she have account in
QlikeView?
Right now i have only username with me, how to validate the user.
Pls advice me.
Thank in advance.
Thanks,
Jagadesan S