Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LiveLink Session Status A required privilege is not held by client

Status
Not open for further replies.

lwich

Programmer
Oct 3, 2007
4
US
I am trying to connect to livelink folder via java. When I call doc.AccessEnterpriseWS(pwsInfo) the status is -2147482645 and has the message "A required privilege is not held by the client.". Any suggestions on what may be wrong. Once I get beyond this error have what I need to add a document.

int status = 0;
int nodeID = 0;
int parentID =0;
int nodeVol = 0;
int parentVol = 0;

LLSession session;
LAPI_DOCUMENTS doc;
LLValue pwsInfo= new LLValue();
LLValue objInfo = new LLValue();
LLValue verInfo = new LLValue();


String server = "server";
int port = 2099;
String db = ""; // empty string uses the default database
String username = "username";
String password = "password";

session = new LLSession(server, port, db, username, password);

doc = new LAPI_DOCUMENTS (session);

if ((status = doc.AccessEnterpriseWS(pwsInfo)) != 0)
{
throw new RuntimeException("Error accessing personal workspace");
}
 
there are one or two privileges the livelink service user needs to get.It is quite possible that you are running this as Local system.Change that account to an Administrator groups account or add a domain user that has admin rights to the box and then you will get one or two
messages frim windows saying "you have been granted log on as service" and "act as part of operating system" and some other stuff.See if that works.Oh I assumed the livelink is on windows.

"You can also search in the KB for the exact error and it tells you how the lapi user can be granted permissions from the user admin interface as well in windows"


Go to Control Panel / Administrative Tools, and run Local Security Policy. Select User Rights Assignment under Local Policies in the left pane. Double-click the "Act as part of the operating system"

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Yes I can access the Enterprise Workspace through the browser. I have full system and user rights.

Livelink is actually running on a server and I am trying to access it from my local machine using my domain credentials. Are you saying it is actually a problem with my windows permissions not my Livelink permission that are causing the problem?

Also I am not sure what you by I can find the exact error in the KB. Can you clarify please. Thanks.
 
can anybody get to it with lapi ? other than you...

When you say you get in thru browser at first try does it present you with the login page

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
I don't know if anyone else can get to this server using lapi, but they have done it on a different server.

no I not presented with a login, because it automatically logins in using my windows credentials.
 
that just means you are on SSo and you should use tunneling thru the webserver.Your session is not like this anymore


session = new LLSession(server, port, db, username, password);

it will be a config assoc,it is in the documentation

session = new LLSession(server, port, db, username, password,config);

I have written a sample at this link see if this makes sense.


that will make you register it is a good web site.

anyways the relevant code also

Code:
using System;
using System.Collections.Generic;
using System.Text;
using com.opentext.api; 

/*For more samples on java you could always visit 
 [URL unfurl="true"]http://www.greggriffiths.org/livelink/development/lapi/[/URL]
 I started with java so C# was a pretty easy switch
 Just follow the rudimentaries on your proj refrences
 which are using com.opentext.api which should eb installed on the 
 client.LAPI_Netp and LAPI_SSPIp if you are doing dir svcs stuff 
 rather than socket calls.vjslib so that you can get native java stuff
 I also work and program in oscript so debugging lapi is kind of easy for me
 but basically lapi gives everything out to you as huge beautiful data structures
 so rev up your Sartaj Sahni and Ellis Horowitz books  Data Structures(the things
 you learned   in CS but never thought would use)
 */

/*
  Intent of the program
  Access a livelink personal workspace using Livelink API and DirSvcs running on the 
  livelink server
  Tested with hideen password option on an IIS machine that has 
  Basic Authentication checked.Creds from AD
  If succesfull I put something in the personal workspace
 THIS CODE MAY NOT BE USED FOR PRODUCTION UNLESS YOU KNOW WHAT IT DOES 
 THIS IS EXPLANATORY CODE AND I AS AUTHOR CANNOT B HELD LIABLE FOR
 ANY DAMAGE TO YOUR SYSTEM
 */


namespace ConnectAsZID
{
    class Program
    {
        static void Main(string[] args)
        {
       /*Make a LAPI tunneled call*/
       /*Do not know how HTTPS works*/

            try
            {

                LLSession session = null;
                LAPI_DOCUMENTS documents = null;
                int status = 0;
                int nodeID = 0;
                int parentID = 0;
                int nodeVol = 0;
                int parentVol = 0;

                LLValue pwsInfo = (new LLValue()).setAssocNotSet();
                LLValue objInfo = (new LLValue()).setAssocNotSet();
                LLValue versionInfo = (new LLValue()).setAssocNotSet();

                // Instantiate session object as a SOCKET call
                //session = new LLSession("houlnkdev1", 2099, "",
                                       //  "zknn1", "password", null);

                // Instantiate session object as a TUNNELED call
                //Here LAPI is making use of the logged in user
                //For HTTP Connection***********************************
                String Server = "255.255.255.1"; //the livelink server IP or a DNS name for the web server
                int Port = 80;                   //We are hitting the web server
                String DFT = "";
                String User = "domain\\zknn1";//submit domain or you could get it from windows
                String Pass = "password"; //the correct password not needed dummy will suffice
                LLValue config = new LLValue().setAssoc();
                config.add("HTTPS", 0);
                config.add("LivelinkCGI", "/HOULivelinkTest/llisapi.dll");
                config.add("EnableNTLM", 1);
                config.add("HTTPUserName", "");//Putting my ad username here did not work
                config.add("HTTPPassword", "");//Same as above
                session = new LLSession(Server, Port, DFT, User, Pass, config);


                // Instantiate documents object
                documents = new LAPI_DOCUMENTS(session);
                
                // Access the user's Personal Workspace
                status = documents.AccessPersonalWS(pwsInfo);

                if (status == 0)
                {
                    Console.WriteLine("Accessed Personal Workspace");
                    parentVol = pwsInfo.toInteger("VolumeID");
                    parentID = pwsInfo.toInteger("ID");
                    Console.WriteLine("ParentVol****" + parentVol);
                    Console.WriteLine("ParentID****" + parentID);


                }

               
                
            
                
               

                
                if (status == 0)
                {
                    // Add document
                    status = documents.AddDocument(parentVol, parentID,
                                "Nair's Document", "c:\\temp\\helloworld.txt",
                                objInfo, versionInfo);

                    if (status == 0)
                    {
                        Console.WriteLine("Added document");
                        nodeVol = objInfo.toInteger("VolumeID");
                        nodeID = objInfo.toInteger("ID");
                        Console.WriteLine("Added document**** details are " + nodeVol + "new nodeID" + nodeID);
                    }
                }
                




                if (status != 0)
                {
                    // Display status code in both integer and hex
                    System.Console.WriteLine("Status=" + status +
                          " (0x" + Convert.ToString(status, 16) + ")");

                    // If the session handle is valid, get the session's error 
                    // information
                    if (session != null)
                    {
                        // Get the error information
                        int stat = session.getStatus();
                        string message = session.getStatusMessage();
                        string errMsg = session.getErrMsg();
                        string apiError = session.getApiError();

                        Console.WriteLine("Session failure status is " + stat +
                                   " (0x" + Convert.ToString(stat) + ")");

                        if (message != "" || errMsg != "" || apiError != "")
                        {
                            Console.WriteLine("Message=" + message);
                            Console.WriteLine("errMsg=" + errMsg);
                            Console.WriteLine("apiError=" + apiError);
                        }
                    }
                }

                Console.WriteLine("End of sample");
                Console.ReadLine();
            }

            catch (Exception e)
            {
                // Display exception
                Console.WriteLine("Application encountered an exception:");
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            } 




        
        
        }
    }
}




Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Using tunneling to connect I am now getting a com.opentext.api.LLUnsupportedAuthMethodException: The webserver requires an unsupported authentication method error. I found that error in the lapi documentation, but it isn't very useful in helping me debug the problem. Any ideas.
 
it is pretty difficult to undesratnd any of these without knowing what kind of sso,http or S what kind of env variable remote_user etc.Shouldn't it be possible for you to to get the lapi test connection utility and try this and at least see if you can get to some state of accomplishment.This forum can only give you some tips but specifics should really be addressed thru OT support.

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top