smallredville
Programmer
Hi everyone,
I recently tried the sample code to add document from DR LAPI site...
But unsuccessful...
I got the following error message:
Failed to Add Document
Status Code: 100402
Api Error:
Error Message:
Status Message: Required System Attributes
I tried to debug but to no avail.
The following is my source code:
------------------------------------------------------------
package LAPI;
import com.opentext.api.*;
public class addDoc {
private static String Server = "localhost";
private static int Port = 2099;
private static String DFT = "";
private static String User = "Admin";
private static String Pass = "password";
public static void main (String [] args)
{
try
{
//variables
LLSession session;
LAPI_DOCUMENTS doc;
LLValue entInfo= new LLValue();
LLValue objInfo = new LLValue();
LLValue verInfo = new LLValue();
session = new LLSession (Server, Port, DFT, User, Pass);
doc = new LAPI_DOCUMENTS (session);
int volumeID,objectID,objID;
String objName, FilePath;
if(doc.AccessEnterpriseWS(entInfo) != 0)
{
System.out.println("AccessEnterpriseWS Failed.");
return;
}
else
{
volumeID = entInfo.toInteger("VolumeID");
objectID = entInfo.toInteger("ID");
System.out.println("Enterprise Volume"+volumeID+"Enterprise ObjID"+objectID);
}
objID = 684436; //684436 is object ID for a folder in DTREE
objName = "New Document";
FilePath = "C:\\yoyo\\AddDocument.java";
if (doc.AddDocument(volumeID, objID, objName, FilePath, objInfo, verInfo) == 0)
{
System.out.println("This version's name is"+verInfo.toString("Name"));
System.out.println("This version's created at "+objInfo.toDate("CreateDate"));
System.out.println("This objects id is"+verInfo.toInteger("NodeID"));
System.out.println("Document Added Successfully");
}
else
{
System.out.println("Failed to Add Document");
//Error Checking
System.out.println("Status Code: " + session.getStatus());
System.out.println("Api Error: " + session.getApiError());
System.out.println("Error Message: " + session.getErrMsg());
System.out.println("Status Message: " + session.getStatusMessage());
}
}
catch (Throwable e)
{
System.err.println(e.getMessage());
e.printStackTrace (System.err);
}
}//main ends
}//class ends
------------------------------------------------------------
In addition, where can I find the description for the Status Code e.g. 100401 means bla bla...
I tried to google on this but to no avail
___________________________________________________________
I hope somebody who has the idea about this, can share with me on how to solve the above mentioned error.
Many thanks in advance.... (^o^)
smallredville
I recently tried the sample code to add document from DR LAPI site...
But unsuccessful...
I got the following error message:
Failed to Add Document
Status Code: 100402
Api Error:
Error Message:
Status Message: Required System Attributes
I tried to debug but to no avail.
The following is my source code:
------------------------------------------------------------
package LAPI;
import com.opentext.api.*;
public class addDoc {
private static String Server = "localhost";
private static int Port = 2099;
private static String DFT = "";
private static String User = "Admin";
private static String Pass = "password";
public static void main (String [] args)
{
try
{
//variables
LLSession session;
LAPI_DOCUMENTS doc;
LLValue entInfo= new LLValue();
LLValue objInfo = new LLValue();
LLValue verInfo = new LLValue();
session = new LLSession (Server, Port, DFT, User, Pass);
doc = new LAPI_DOCUMENTS (session);
int volumeID,objectID,objID;
String objName, FilePath;
if(doc.AccessEnterpriseWS(entInfo) != 0)
{
System.out.println("AccessEnterpriseWS Failed.");
return;
}
else
{
volumeID = entInfo.toInteger("VolumeID");
objectID = entInfo.toInteger("ID");
System.out.println("Enterprise Volume"+volumeID+"Enterprise ObjID"+objectID);
}
objID = 684436; //684436 is object ID for a folder in DTREE
objName = "New Document";
FilePath = "C:\\yoyo\\AddDocument.java";
if (doc.AddDocument(volumeID, objID, objName, FilePath, objInfo, verInfo) == 0)
{
System.out.println("This version's name is"+verInfo.toString("Name"));
System.out.println("This version's created at "+objInfo.toDate("CreateDate"));
System.out.println("This objects id is"+verInfo.toInteger("NodeID"));
System.out.println("Document Added Successfully");
}
else
{
System.out.println("Failed to Add Document");
//Error Checking
System.out.println("Status Code: " + session.getStatus());
System.out.println("Api Error: " + session.getApiError());
System.out.println("Error Message: " + session.getErrMsg());
System.out.println("Status Message: " + session.getStatusMessage());
}
}
catch (Throwable e)
{
System.err.println(e.getMessage());
e.printStackTrace (System.err);
}
}//main ends
}//class ends
------------------------------------------------------------
In addition, where can I find the description for the Status Code e.g. 100401 means bla bla...
I tried to google on this but to no avail
___________________________________________________________
I hope somebody who has the idea about this, can share with me on how to solve the above mentioned error.
Many thanks in advance.... (^o^)
smallredville