In the vSphere Web Services SDK, VMware supplies sample vSphere clients for Visual Studio 2008. The SDK includes a project (.csproj) file for each sample, and a solution (.sln) file for the whole set of samples. The project files reference the DLLs through which a client communicates with the Web service.
■ For an example of how to script this procedure using a Windows batch file, see Scripting the C# DLL Build.
3 Generate the VimService.cs file from the WSDL, using the following command syntax with the WSE WSDL tool:This command generates VimService.cs, the default output file, in the current directory, using the Vim25Api namespace.
4 Compile VimService.cs to a library, using the following command syntax:
5 Use the sgen tool to pregenerate and compile the XML serializers, using the following command syntax:This command outputs the Vim25Service.XmlSerializers.dll file in the current directory. This DLL file contains pregenerated XML serializer code.
6 Using a source code editor, find occurrences of the following string in the VimService.cs file that you generated in Step 3.This will prevent .NET from processing the Xml.Serialization.XmlIncludeAttribute attributes that are the main cause of the slow instantiation of the Vim25Service class.
7 Annotate the VimService class in the VimService.cs file that you generated in Step 3, adding this XmlSerializerAssemblyAttribute to point to the location of the XML serializer assembly:
8 Save the modified VimService.cs file.
9 Regenerate the Vim25Service.dll library with the following command syntax:
10 Copy the generated files Vim25Service.dll and Vim25Service.XmlSerializers.dll to the %SDK_HOME%\vsphere-ws\dotnet\cs\samples\lib directory.