Code Example to Connect to File Net is as Follows:
Code Example to Connect to FileNet is as Follows:
public static IObjectStore Connect()
{
try
{
// Set connection parameters; substitute for the placeholders.
string uri = GetConfigValue("FileNetServerURL");
//"http://filenetserverurl:9082/wsi/FNCEWS40MTOM/";
string username = GetConfigValue("FileNetServerAdmin"); //"P8Admin";
string password = GetConfigValue("FileNetServerAdminPassword"); //"Password";
string objectstorename = GetConfigValue("FileNetObjectStore");//ECMStore
// Get client context.
IConnection conn = Factory.Connection.GetConnection(uri);
// UsernameToken
UsernameCredentials creds = new UsernameCredentials(username, password);
ClientContext.SetProcessCredentials(creds);
// Get default domain.
IDomain domain = Factory.Domain.FetchInstance(conn, null, null);
// Get object stores for domain.
IObjectStore os = Factory.ObjectStore.FetchInstance(domain, objectstorename, null);
return os;
}
catch (Exception ex)
{
return null;
}
}
Comments