Tony Wall’s Blog

Remember quality? A bit more time upfront saves a ton of trouble later ;-)

Extracting VMware Web Service Proxies for .NET

Microsoft .NET, VMware

The current VMware 5.1 SDK no longer redistributes pre-built .NET proxies, just the source WSDL. If you follow the documentation you are directed to complete a complicated procedure to generate and your own signed proxies.

Fortunately, there is an easier way to extract official signed assemblies from a VMware PowerCLI (PowerShell extensions) installation. This is much better than the previous method as you are using original DLLs provided (and supported by) VMware.

  1. Download and install the current VMware PowerCLI.
  2. Install the PowerCLI which includes the VMware VIX infrastructure components.
  3. Although the PowerCLI documentation suggests you reference VMware.Vim.dll in the program files infrastructure path, we won’t do this because some additional files are missing and we want a full stand-alone copy. The VMware VIX setup installs everything primarily in the GAC. So we will run one command to extract  the files we need from the GAC and copy them into the source so they can be referenced locally and checked-in. Change the “.” at the end of the following command to your own target path, else it copies into the current directory:
    [code]for /f %i in (‘dir %WinDir%assemblyGAC_MSIL*Vim*.dll /s /b’) do copy %i .[/code]
  4. This will find several files of which the following are necessary to call VMware web services:
  5. Add a reference to VMware.Vim.dll then use the proxy classes there to call the web services, according to the VMware Web Services SDK documentation. Note that the main VIM assembly will load the relevant VimService## proxy according to the version it detects when connecting to the server (factory pattern), so you need them all including the XML serialization assemblies (it’s hard-coded, they are not optional)!

As a best practice I like to check-in all stand-alone dependencies into a “Dependencies” folder of the solution/checked-in source tree. Make sure you also redistribute these files with your application. I prefer this “local copy” method because this enables your code to compile on any developer PC or build server and be deployed as a stand-alone package.

Tagged , , ,

9 thoughts on “Extracting VMware Web Service Proxies for .NET

  • Thanks for the tip! Just a small point I had to look at the source HTML to be able to see the entire command in FF 🙂

    for /f %i in (‘dir %WinDir%Microsoft.NETassemblyGAC_MSIL*Vim*.dll /s /b’) do copy %i .

    The copy %i . isn’t visible 🙂

  • Unfortunately there are no such files in the folder you’ve mentioned. I’ve just installed the newest Version of PowerCLI: and tried to find the files under the GAC_MSIL folder, but they’re gone. And they’re also not found in the PowerCLIs own folders.

    1. Hi Kjellski, Thanks for the information there was a mistake in the copy command. It should have used the legacy assembly directory below %WinDir% not the new one below the Microsoft.NET subdirectory. The post has been corrected now. Good luck with your VMware code! Tony

  • you’re a life saviour 😉 i got my VimService55.dll and VimService55.XmlSerializers.dll files in no time with this method! vmware should support it!

Leave a Reply

Your email address will not be published. Required fields are marked *