Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
We are using QV server 9.0 SR2 in DMS authorization mode. We are trying to set authorization for each document through programatically by using the QvsNetRemote. Below the sample code we used to add a user to the document. But it somehow doesn't work. So please help us by pointing out the exact problem with below code. Also it would be grateful if someone can provide the way to write a custom directory service provider(DSP) to programatically add/read custom user details to QV server.
Dim oQVClient As QvClient = New QvClient("localhost", QvClient.Mode.Admin)
Dim oXMLAnswer As New XmlDocument()
Dim oXMLRequest As New XmlDocument()
Dim oXMLResult As XmlElement
oXMLAnswer.LoadXml(oQVClient.Execute(
"<update mark='' view='' level='0' stamp='' kind='MetaServiceData_obj' ident='new:films.qvw' /> "))
oXMLRequest.LoadXml(
"<update mark='' view='' kind='MetaServiceData_obj' />")
oXMLRequest.DocumentElement.SetAttribute(
"stamp", oXMLAnswer.DocumentElement.GetAttribute("stamp"))
oXMLRequest.DocumentElement.SetAttribute(
"ident", oXMLAnswer.DocumentElement.GetAttribute("ident"))
oXMLRequest.DocumentElement.SetAttribute(
"session", oXMLAnswer.DocumentElement.GetAttribute("session"))
Dim oXMLNode1 As XmlElement
oXMLNode1 = oXMLRequest.CreateElement(
"set")
oXMLNode1.SetAttribute(
"name", "AccessList.Append")
oXMLNode1.SetAttribute(
"action", "")
oXMLRequest.DocumentElement.AppendChild(oXMLNode1)
oXMLNode1 = oXMLRequest.CreateElement(
"set")
oXMLNode1.SetAttribute(
"name", "AccessList.Selected.User")
oXMLNode1.SetAttribute(
"text", "domain\user")
oXMLRequest.DocumentElement.AppendChild(oXMLNode1)
oXMLNode1 = oXMLRequest.CreateElement(
"set")
oXMLNode1.SetAttribute(
"name", "AccessList.Selected.Allow")
oXMLNode1.SetAttribute(
"text", "Always")
oXMLRequest.DocumentElement.AppendChild(oXMLNode1)
oXMLAnswer.LoadXml(oQVClient.Execute(oXMLRequest.OuterXml))
Seems these codes are not working on QVS 10 SR2 and SR3. I have printed the response from QVS and I found that the session is empty in the response XML. But same codes are working on QVS 9 successfully. I do not know what happened in QVS 10.