When does DocumentManagementClient.GetNodeByPath() method in C# program hit error
I am developing a C# program to upload a document into a folder in OpenText. I use the following C# code snippet to obtain the Node ID of the target folder in OpenText.
=================================================================
long myRootID = 2000;
DocumentManagementClient docManClient = new DocumentManagementClient();
string FolderPath = @"NOM\Member Services\Nomination Scheme (restricted access)\Nomination applications for alive members (CCC Nominations & Revocations)\Processed (i.e. actions taken)\Nomination Forms and Booklets Year 2020";
Node myNode = null;
string[] myFolderPath;
myFolderPath = FolderPath.Split('\');
// Create the OTAuthentication object and set the authentication token
OTAuthentication otAuth = new OTAuthentication();
otAuth.AuthenticationToken = authToken;
myNode = docManClient.GetNodeByPath(ref otAuth, myRootID, myFolderPath);
=================================================================
However, when running the above C# codes, each time at the line of "docManClient.GetNodeByPath", the program will throw an exception of "Object reference not set to an instance of an object".
I can 100% guarantee that the full path of the folder (under the variable "FolderPath") is accurate and it really exists in the OpenText environment.
To make things clearer, I would like to show the C# source codes of the method GetNodeByPath() in nested levels as below.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
public CPFDocumentUpload.CWS.Node GetNodeByPath(ref CPFDocumentUpload.CWS.OTAuthentication OTAuthentication, long rootID, string[] pathElements) {
CPFDocumentUpload.CWS.GetNodeByPathRequest inValue = new CPFDocumentUpload.CWS.GetNodeByPathRequest();
inValue.OTAuthentication = OTAuthentication;
inValue.rootID = rootID;
inValue.pathElements = pathElements;
CPFDocumentUpload.CWS.GetNodeByPathResponse retVal = ((CPFDocumentUpload.CWS.DocumentManagement)(this)).GetNodeByPath(inValue);
OTAuthentication = retVal.OTAuthentication;
return retVal.GetNodeByPathResult;
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
CPFDocumentUpload.CWS.GetNodeByPathResponse CPFDocumentUpload.CWS.DocumentManagement.GetNodeByPath(CPFDocumentUpload.CWS.GetNodeByPathRequest request) {
return base.Channel.GetNodeByPath(request);
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Anybody can help to give me an idea why it can throw such an exception?
Many Thanks.
Categories
- All Categories
- 117 Developer Announcements
- 52 Articles
- 121 General Questions
- 130 Services
- 51 OpenText Hackathon
- 35 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 910 Cloud Fax and Notifications
- 81 Digital Asset Management
- 9.3K Documentum
- 28 eDOCS
- 156 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 4 XM Fax