Vault Customization

Reply
New Member
kmecke
Posts: 2
Registered: ‎06-03-2012
Message 1 of 3 (234 Views)
Accepted Solution

Updating file category with UpdateFileCategories throws Excerption

234 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

Employee
Daniel.Dulzo
Posts: 61
Registered: ‎05-25-2011
Message 2 of 3 (220 Views)

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.
New Member
kmecke
Posts: 2
Registered: ‎06-03-2012
Message 3 of 3 (213 Views)

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 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community