Vault Customization

Vault Customization

Reply
Member
3 Posts
0 Kudos
Registered: ‎06-03-2012
Post 1 of 3
Accepted Solution

Updating file category with UpdateFileCategories throws Excerption

250 Views, 2 Replies
06-03-2012 08:03 AM

 

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

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

Employee
61 Posts
8 Kudos
Registered: ‎05-25-2011
Post 2 of 3

Re: Updating file category with UpdateFileCategories throws Excerption

06-06-2012 02:10 PM 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.
Member
3 Posts
0 Kudos
Registered: ‎06-03-2012
Post 3 of 3

Re: Updating file category with UpdateFileCategories throws Excerption

06-07-2012 04:19 AM 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 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post