Autodesk.Connectivity.WebServices.dll is one of the new additions to the Vault 2011 SDK. I wrote the DLL with one goal in mind: The elimination of everything I hated about working with web services.
Overall, it worked out pretty well. (Of course, if it was a crushing failure, I wouldn't bother blogging about it.) All SDK sample and apps from this blog are built on the DLL, so there are plenty of examples on how to use.
Summary
Autodesk.Connectivity.WebServices.dll is an alternative mechanism for using the Web Services API. Instead of creating Web References, you just create a regular DLL reference.
I encourage you to use this DLL if possible instead of the web service approach. Not only is it easier to use, but it's the future direction of the Web Services API.
Advantages
- WSE 3.0 issues fixed. With web references, you have to go through extra steps to get WSE to work with Visual Studio 2008. Use of the DLL takes care of those steps for you. No extra steps needed.
- All service classes are WSE enabled. No more confusion between DocumentService and DocumentServiceWse. There is just one class, DocumentService, and it is WSE enabled.
- Single namespace. If you get a File object back from a DocumentService call, it's in the same namespace as a File object from the ItemService. No more need to copy an object from one namespace to another.
The only exception is SecurityHeader. For technical reasons, they each need to live in separate namespaces. - Single reference. There are 17 web services in Vault 2011. That's a lot of references to deal with. True, your app will probably not use all 17, but you can expect about 3 or 4 on average. The DLL allows you to get everything with a single reference.
Example
Here is a comparison between web references and the DLL. The code is taken from the VaultList sample in the SDK. You'll notice that the two pieces of code are almost identical, and that's kind of the point. The API is the same, it's just been made easier to use.
Using web references:
| using VaultList.Document; SecurityService secSrv = new SecurityService(); |
Using Autodesk.Connectivity.WebServices.dll:
| using Autodesk.Connectivity.WebServices; SecurityService secSrv = new SecurityService(); |
Other notes
- This DLL will works with all Vault 2011 products. However some of the services will only work with a specific product. So the burden is on the programmer to use only the API pieces that fit the target Vault product.
For example, if you are developing an app for Vault Workgroup, don't reference the Item Service. - There are two cases where different classes have the same name. The result is a single class in the DLL with properties merged in from both cases. This shouldn't affect how your program runs, but it might be a bit confusing when you are writing code.
Here are the two cases:- ItemService.Attmt and PackageService.Attmt
- DocumentServiceExtensions.LfCycDef and (ItemService or ChangeOrderService).LfCycDef
- You can't use partial classes with a class in another DLL. So if you are using the trick I documented earlier with the Invoke method, that won't work the same. The new way of doing things is to subclass the service object and overwrite the Invoke method.

Subscribe