Try something like this, if IIS doesn't work try QlikView Webserver.
Dim request As WebRequest = WebRequest.Create("http://" + qvshost + "/QvAjaxZfc/GetTicket.aspx?admin=")
Dim str As String
str = "<Global method='GetTicket'><UserId>" + username + "</UserId></Global>"
request.ContentLength = str.Length
request.Method = "POST"
request.Credentials = CredentialCache.DefaultCredentials
Dim writer As New StreamWriter(request.GetRequestStream())
We are not using the IIS, we are using the QVWS.
We tried the approach that you have mentioned also. This does not give the desired results.
The environment that we are using is as follows. QVWS is hosted on one machine and we are trying to access the QV files from a different system. The 'qvshost' is replaced with the server name in our case.
When we tried accessing this from the url,
http://Servername/QvAJAXZfc/getticket.aspx?cmd=<Global method="GetTicket"><UserId>264375</UserId></Global>, we get the error that the 'webpage is not found'.
We tried accessing a different page to find if we are able to access the server. This we acheived by using the url,
2) http://Servername/QvAJAXZfc/qvsviewclient.aspx?cmd=<Global method="GetTicket"><UserId>264375</UserId></Global>.
At this point, we get an xml output which gives us an error, 'empty request'.
In both the above urls, we also hae tried using 'admin' instead of 'cmd'.
Also, the QVWS is in DMS mode and the users are present in the QVAdmin group.
In the server, we did not find the file, GetTicket.aspx. Should this page be existing at the time of installation or do we need to create this page. Are we missing any other access rights? Should we add the users in the QVAdmin group in the web.config file of the .Net application in the <impersonate> section?
Please let us know if we are missing anything.
Here are a few tidbits that might be helpful.
The call to qvsviewclient is obselete in QV10. For security purposes we are no longer allowing direct admin connections to qvsviewclient. you now need to call getticket.aspx on your QVWS machine. This call needs to be a POST as a GET is not allowed.
The caller also must be able to resolve as a member of QlikView Administrators on the QVS machine.
Don't know if you've found your answer but here're some tidbits I've found for this issue.
The GetTicket.aspx page should be located in the Ajax client folder (QlikView\Server\QlikViewClients\QlikViewAjax\)
Since QV 9, the only command I was able to get working for issuing tickets is with your second command:
A thing that helped me debug the correct way to call this page is by checking the server log files under QlikTech\WebServer\Log\. You can see the GetTicket call and whether it successfully returns a ticket.
We are also using it under DMS mode and the username is tied to an Active Directory name so it's actually domain\username in place of "USERNAME" for us.