Hello everybody -
after unsuccessfull websearch I have to ask for your help. I am struggeling to update the category of a file. I try to use the UpdateFileCategories method (see below in the third codeline). In the third line (UpdateFileCategories) an SOAPExcerption 1013 "GetFileFailed" is thrown (see below). So I added the lines 1 and 2 to confirm, that the requested FileId and the CatId do exist and confirmed my administrator right... no progress.
Cat myCat = ServiceManager.CategoryService.GetCategoryById(catIds); File myFile = ServiceManager.DocumentService.GetFileById(foundFile.Id); ServiceManager.DocumentServiceExtensions.UpdateFileCategories(new long[] { myFile.Id }, new long[] { myCat.Id }, "UpdtKat");
Excerption:
SOAPExcerption {"1013"} Source: Autodesk.Connectivity.WebServices Stacktrace: bei Autodesk.Connectivity.WebServices.DocumentExSvc._DocumentServiceExtensions.Invoke(String methodName, Object[] parameters) bei Autodesk.Connectivity.WebServices.DocumentExSvc._DocumentServiceExtensions.UpdateFileCategories(Int64[] masterIds, Int64[] categoryIds, String comment) bei DatenWerkzeug.VaultCon.setCats(DataTable art2toKat) in C:\Dokumente und Einstellungen\dik\Eigene Dateien\Visual Studio 2010\Projects\Datenwerkzeug\Datenwerkzeug\VaultCon.cs:Zeile 122. [...]
What am I doing wrong or do you see alternatives to my approach?
Thanks for your help!
Peter
Solved! Go to Solution.
Solved by Daniel.Dulzo. Go to Solution.
Hello Peter,
One thing that might be the issue is I believe you're using the file's Iteration ID instead of the file's Master ID. Please try changing your third line from:
ServiceManager.DocumentServiceExtensions.UpdateFileCategories(new long[] { myFile.Id }, new long[] { myCat.Id }, "UpdtKat");
To:
ServiceManager.DocumentServiceExtensions.UpdateFileCategories(new long[] { myFile.MasterId }, new long[] { myCat.Id }, "UpdtKat");
The UpdateFileCategories() takes master IDs because the category applies to all versions of a file. This means the category is associated with the file master, not an individual file version. Some more information can be found here: http://justonesandzeros.typepad.com/blog/2010/05/entities.html (near the bottom of the article).
Regards
Hello Daniel -
thanks alot for the solution and the explaination. Everything works smoothly with the masterID. With this background knowledge - now i see the solution pretty obvious in the excerption... thanks for opening my eyes.
Serious - you made my day!
Peter