I'm having trouble creating a new object in the repository, using the DFS .NET productivity layer and the object service APIs.
First, I initialize the service context programmatically:
AppConfig.Instance.ConfigObject.DefaultModuleName = "core";
AppConfig.Instance.ConfigObject.RegistryProviderModuleName = "core";
AppConfig.Instance.ConfigObject.RequireSignedUcfJars = true;
ModuleInfo coreModule = new ModuleInfo();
coreModule.ContextRoot = "services";
coreModule.Host = "dtordam01";
coreModule.Name = "core";
coreModule.Port = "9080";
coreModule.Protocol = "http";
AppConfig.Instance.ConfigObject.Modules = new List<ModuleInfo>();
AppConfig.Instance.ConfigObject.Modules.Add(coreModule);
Next, I create a DataObject and assign it an ObjectIdentity:
DataPackage newObjects = new DataPackage();
newObjects.RepositoryName = "DMS";
DataObject newObject1 = new DataObject();
ObjectIdentity newObjId = new ObjectIdentity();
ObjectPath newObjPath = new ObjectPath("/Broadcasting Documents/Test/Object1");
newObjId.ValueType = ObjectIdentityType.OBJECT_PATH;
newObjId.Value = newObjPath;
newObjId.RepositoryName = "DMS";
newObject1.Identity = newObjId;
I then set some attributes, create a relationship to the parent folder, and add the object to a DataPackage and pass it to the Create() method:
ReferenceRelationship folderObjRel = new ReferenceRelationship();
folderObjRel.Name = Relationship.RELATIONSHIP_FOLDER;
folderObjRel.Target = folderId;
folderObjRel.TargetRole = Relationship.ROLE_PARENT;
newObject1.Relationships.Add(folderObjRel);
//OperationOptions ops = new OperationOptions();
OperationOptions ops = null;
newObjects.AddDataObject(newObject1);
DataPackage returnedPackage = objectService.Create(newObjects, ops);
However, I always get Create() invocation failed. Am I missing anything in programmatically setting the AppConfig object, or am I passing an incorrect ObjectIdentity object to my new DataObject?