Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Updating file category with UpdateFileCategories throws Excerption

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
kmecke
778 Views, 2 Replies

Updating file category with UpdateFileCategories throws Excerption

 

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

2 REPLIES 2
Message 2 of 3
Daniel.Dulzo
in reply to: kmecke

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.UpdateFil​eCategories(new long[] { myFile.Id }, new long[] { myCat.Id }, "UpdtKat");

 

To:

 

ServiceManager.DocumentServiceExtensions.UpdateFil​eCategories(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



Daniel Dulzo
Software Engineer
Autodesk, Inc.
Message 3 of 3
kmecke
in reply to: Daniel.Dulzo

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 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums