VMware vSphere Web Services SDK – WDSL issues building the DLLs

As per the developer setup guide for VMware vSphere Web Services SDK 5.0, you have to build your own DLLs from the wsdl files provided.
There are a few changes from SDK 4.0, most notably the lack of the genvimstubs.cmd and OptimiseWsStubs.exe files. However it is still fairly straightforward… apart from the initial wsdl command! read on…

Depending on where you extract the SDK zip file to you may end up with spaces in your path. After lots of head scratching it turns out wsdl.exe does not like this! If you have spaces in your path, then when running command “wsdl.exe /n:VimyyApi vim.wsdl vimService.wsdl” you will get an error as follows – despite trying all combinations of environment variables, running from Visual Studio command prompt in the actual vim25 directory:
Error: Could not find a part of the path ‘c:\program%20files\microsoft%20visual%20studio%209.0\sdk\vsphere5\vsphere-ws\wsdl\vim25\query-messagetypes.xsd’.

So rather than copy to e.g. Visual Studio/SDK path, just extract to e.g. C:\vSphere5\… and then once produced the two DLLs if you want to compile the samples, then move/copy to correct folder afterwards. The main DLL gets produced twice – the first time ‘as is’ to then produce the second XMLSerialisers DLL, then again when the reference to this DLL has been added to the vimservice.cs file and the XMLAttributes commented out – this is all in the Developer Setup Guide.

Hopefully this will save a few hours as I spent trying to work out what was going on! (This was with VS2008).

Advertisements

3 thoughts on “VMware vSphere Web Services SDK – WDSL issues building the DLLs

  1. Dude this saved my life! thank you. I spent about 5 hours trying to build these libraries before I found this. The space was the problem.

    • Glad found the post useful – it had me stumped for ages! I guess they leave it do do yourself rather than provide compiled DLLs so you can set your own namespace(?). It did prove useful for me being able to compile own though as I need un-optimised DLLs to enable my Alarm export stuff to work. Good luck with rest of your coding! SF.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s